Energy Engine
Member
Hi all!
Simple issue, but not able to get it to work correctly.
I have a mouse object. I want it to draw the precise x and y coordinates (text and values) on itself. Its correctly drawing a cursor sprite that I've set for it in its object properties, but the text that's supposed to be on the sprite is constantly being offset and shows incorrect values. Here's what I have:
End Step:
Draw GUI End:
draw_text(x,y,"X"+string(x))
draw_text(x,y+10,"Y"+string(y))
Please note that the game is scaled up by a factor of 4 from the default resolution. So I tried multiplying the x/y position by 4 as well, but it still gives incorrect values.
Relevant code in controller object:
Room start (I know, compat scripts...):
Thanks in advance!
Simple issue, but not able to get it to work correctly.
I have a mouse object. I want it to draw the precise x and y coordinates (text and values) on itself. Its correctly drawing a cursor sprite that I've set for it in its object properties, but the text that's supposed to be on the sprite is constantly being offset and shows incorrect values. Here's what I have:
End Step:
GML:
x=mouse_x
y=mouse_y
draw_text(x,y,"X"+string(x))
draw_text(x,y+10,"Y"+string(y))
Please note that the game is scaled up by a factor of 4 from the default resolution. So I tried multiplying the x/y position by 4 as well, but it still gives incorrect values.
Relevant code in controller object:
Code:
global.window_size_native_width=384
global.window_size_native_height=216
global.window_size_windowed_width=1536
global.window_size_windowed_height=864
game_w_start = global.window_size_windowed_width; //fixed
game_h_start = global.window_size_windowed_height; //fixed
game_w = round(global.window_size_windowed_width)
game_h = round(global.window_size_windowed_height)
display_set_gui_size(game_w_start, game_h_start); //fixed
window_set_size(game_w_start, game_h_start); //fixed
surface_resize(application_surface, game_w, game_h); //port
camera_set_view_size(view_camera[0], game_w, game_h); //view
Code:
__view_set( e__VW.WView, 0, global.window_size_native_width)
__view_set( e__VW.HView, 0, global.window_size_native_height)
__view_set( e__VW.WPort, 0, global.window_size_windowed_width)
__view_set( e__VW.HPort, 0, global.window_size_windowed_height)