Jump to content


mcf1lmnfs

Member Since 08 Nov 2011
Offline Last Active Jun 30 2012 12:25 AM

Topics I've Started

how to find view angle from display size

30 May 2012 - 06:04 PM

i am using d3d_set_projection_ext (wich has an argument called angle, it affects on how much space is visible) in my 3d game, i build it on pc with 1680x1050 display, and when i tryed to play it on another PC with 1280x1024 screen size, it was scaled to that screen size,

for temporarly solution i wrote a script that finds out the best fit to the screen size, but then there are blank spaces around, i useed this code:

var dw, dh,dr,rr;

dw=display_get_width()
dh=display_get_height()
window_set_fullscreen(argument0)
if (room_width=dw and room_height<=dh) or (room_width<=dw and room_height=dh) or (room_width=dw and room_height=dh)
{return 0 exit}
else
{dr=dw/dh
rr=room_width/room_height

if rr>dr
{room_set_height(room0,dw/room_width*room_height)
room_set_width(room0,dw)}
else
{room_set_width(room0,dh/room_height*room_width)
room_set_height(room0,dh)
}

now i am searching for a way how to use full screen size, (no blank spaces), and i can not figure out how to do this with out scaling the picture, can i calculate the view angle and then insert it in that function, previously mentioned? if that would be posible can someone writes how to calculate that? or any better suggestion to avoid scaling the picture?

thank you in advance, mcf

Find value of red, green and blue color in a pixel

07 April 2012 - 02:28 PM

I am trying to make advanced image editor, which also needs to know how to take a color to pieces.
for exemple with code:  make_color_rgb(222,111,122) , i get code for color, i can also get the code with draw_getpixel(x,y),  
now i need to know how can i get from this code values for red, green blue,   i need exactly oposite procedure of this: make_color_rgb(222,111,122),

can anyone help me with this? i would be really grateful.