GML moving HUD with window size

C

Capptianm

Guest
With my next game, I want the player to be able to resize the game window. One thing I want is a HUD that moves as the window resizes, stuff like the health bar and points moving to the outside of the room as the window gets wider.

The problem is that as the window gets taller and wider, the room scales to fit the window. is there any way to measure the distance between the edge of the room and the edge of the window? if there isn't, is there any way to achieve what I want a different way?
 
C

Capptianm

Guest
While I am not confident to post THE code that would achieve this, I do suggest you look in to the interaction between the view, the port and th application surface.

Something like this might get you started

https://docs.yoyogames.com/source/dadiospice/002_reference/windows and views/views/view_xport.html
Thanks for the help! this did help point me in the right direction.

what I did was put this line of code in the step event:
Code:
var xxx = window_get_width()
view_set_xport(0, xxx - room_width)
and this for the draw gui event:
Code:
if (view_xport[0] > 50)
{
     //gui code
}
 
Top