playable area

scorpafied

Member
trying to learn a few new skills in gm. im looking at having a map thats bigger then the screen. but having an interface placed over top of the screen.

now instead of just using a camera and drawing it over top of everything im wondering if theres an efficient way of ensuring everything doesnt wander where the ui is.
 

Evanski

Raccoon Lord
Forum Staff
Moderator
for the ui draw everything in the draw_gui event
it automatically manages where it is in the view
 

scorpafied

Member
for the ui draw everything in the draw_gui event
it automatically manages where it is in the view
ahh ok. and how would i manage the stuff that happens inside the view so for example the player couldnt move under the gui?

or is that managed automatically in that event?

figured thered have to be an easier way then micro managing x and y values on every object.
 

Evanski

Raccoon Lord
Forum Staff
Moderator
ahh ok. and how would i manage the stuff that happens inside the view so for example the player couldnt move under the gui?

or is that managed automatically in that event?

figured thered have to be an easier way then micro managing x and y values on every object.
if the player has a higher depth then the object that has the gui event
then the player will be drawn under it

visa-versia if the gui object has a higher depth then the player
 

Nidoking

Member
Anything drawn during the GUI Draw events will be in front of anything drawn in normal Draw events. The GUI events happen after all of the other draws.
 

NastyMonk

Member
ahh ok. and how would i manage the stuff that happens inside the view so for example the player couldnt move under the gui?

or is that managed automatically in that event?

figured thered have to be an easier way then micro managing x and y values on every object.
What do you mean by player couldn't move under the gui? Like there is some kind of invisible barrier surrounding all GUI?
 

scorpafied

Member
ok so lets say i have some sort of you like level name and display of powerups and health ect...

this could take upbthe width of the screen along the top at a height of 100 pixels. then a border along the sides and bottom of screen. all of which 20 pixels in size.

so to draw that and not have say a character be able to walk under neath the interface which happened the way i did it with normal draw events.

what id do is id draw this stuff in a gui draw event. then id set the cameras x to 20. the y to 100. then the width 440 and the height to 360.
(for examples sake we will say the total window size is 480 by 480)

then the game will basically function only within that area of the screen?
 

HayManMarc

Member
Maybe use a separate view for the play field and set it to the appropriate coordinates? Then the gui stuff can be in the main view? (Not sure if this will work -- just guessing.)
 
Top