Getting an object's x/y screen pos.
#1
Posted 04 June 2011 - 10:01 PM
#2
Posted 04 June 2011 - 10:05 PM
object.x-window_get_x(),object.y-window_get_y()
Or if you by "screen" mean the view:
object.x-view_xview,object.y-view_yview
#3
Posted 04 June 2011 - 10:29 PM
#4
Posted 28 February 2012 - 08:46 PM
#5
Posted 28 February 2012 - 09:35 PM
Edited by gardian20, 28 February 2012 - 09:36 PM.
#6
Posted 28 February 2012 - 10:30 PM
Maybe you would draw the room height and width. Like this:how do you get on-view coordinates of non-objects? like to draw something
draw_text(x,x,""+room_height+" and "+room_width)
is that even what you mean?
#7
Posted 28 February 2012 - 10:48 PM
wait........i wanted it to draw something on the view as it moves. i do not quite under stand what you mean.....but i am not sure it is what i am looking forMaybe you would draw the room height and width. Like this:
how do you get on-view coordinates of non-objects? like to draw somethingdraw_text(x,x,""+room_height+" and "+room_width)
is that even what you mean?
#8
Posted 28 February 2012 - 11:06 PM
wait........i wanted it to draw something on the view as it moves. i do not quite under stand what you mean.....but i am not sure it is what i am looking for
Maybe you would draw the room height and width. Like this:
how do you get on-view coordinates of non-objects? like to draw somethingdraw_text(x,x,""+room_height+" and "+room_width)
is that even what you mean?
I read that you wanted to draw the room height and width. Can you upload your .gm* so i can see?
#9
Posted 28 February 2012 - 11:20 PM
how do i do that? anyway, if i do this, would i come out with something drawn on a coordinate that is compared to the view not to the whole room?
wait........i wanted it to draw something on the view as it moves. i do not quite under stand what you mean.....but i am not sure it is what i am looking for
Maybe you would draw the room height and width. Like this:
how do you get on-view coordinates of non-objects? like to draw somethingdraw_text(x,x,""+room_height+" and "+room_width)
is that even what you mean?
I read that you wanted to draw the room height and width. Can you upload your .gm* so i can see?
#10
Posted 29 February 2012 - 04:42 AM
view_xview[n] and view_yview[n] return the (x, y) coordinates of the top-left corner of the n'th view. So just offset your coordinates from there. For example, if you want something to stay at (10, 10) from the view 0 position instead of the room, you'd draw/place it at (view_xview[0]+10, view_yview[0]+10). Make sense?how do you get on-view coordinates of non-objects? like to draw something
-IMP
#11
Posted 29 February 2012 - 01:08 PM
EDIT: It works perfectly!!!!! thanks!
Edited by gardian20, 29 February 2012 - 01:26 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











