• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

(Solved) How to draw a rectangle over depth = -y;

R

robproctor83

Guest
You can not draw shapes at a given depth. When you draw something it can only be drawn from the drawing objects depth. SO, if you want to change the depth of the rectangle you have to change the depth of the object which is drawing it.

On a side note, if this is something you think you will need to do a lot, it may be worth making a controller object that does the drawing for you, and wrap it in a script. So, instead of draw_rectangle(blahblah...) you would say draw_rectangle_depth(blahblah) and in your custom draw_rectangle_depth() script you would have it just create an instance at the depth you want to draw.
 

rIKmAN

Member
If it's UI then do the drawing in the Draw GUI Event, which will always draw on top of everything drawn in regular Draw Events and won't be affected by camera or view position within a room etc.

The name kind of implies that it's for UI - "DrawGUI Event"
 
if i just make the depth = -100000; it is solved. GML GUI system in my opinion is far more clunky buggy and slow then simply using draw functions.
 

rIKmAN

Member
if i just make the depth = -100000; it is solved. GML GUI system in my opinion is far more clunky buggy and slow then simply using draw functions.
I haven't mentioned a GUI system, I'm talking about the Draw GUI Event, which is exactly the same as the regular Draw Event except that it draws on top of everything else and with fixed coordinates that are not affeced by camera or view positions.

What clunky / buggy / slow issues are have you experienced using the Draw GUI Event?
Maybe you are getting confused and thinking I was recomending some sort of GUI system?
 
I thought you where referring to the GUI System i tried to use Shuan Spladling system but it was way to clunky and far to hard to draw new text so i just use the draw event. I will look into the Draw GUI event.
 
Top