Draw GUI

F

Freedom2Fight

Guest
Edit:

Draw GUI End will draw over stuff in Draw GUI Begin right? Is that right?

Can I draw over stuff but still be in the Draw GUI Begin? For example I have two sprites in the Draw GUI

Begin event but I want one to be on top of the other - is that possible?

===============================================================================
Below here is stuff that is resolved.
===============================================================================

I'm trying to use Draw GUI for something but I can't get it to work.

I need to draw a sprite to occupy the view. I did to manage to do that with the Draw Event using...


Code:
draw_sprite_ext(spr_inventory,0, view_xview+view_wview/2,view_yview+view_hview/2,view_wview/inv_width,view_hview/inv_height,0,c_white,1)


The larger sprite is the Draw event. The smaller one, peeking at the bottom is the one using the Draw GUI.

Is there a way to achieve the same thing using Draw GUI?


This is what it normally looks like. I set the "view_object = camera (the green box with the movie camera)". Could that be contributing to my problem?
 
Last edited by a moderator:
F

Freedom2Fight

Guest
Thanks Mordecai142, I'm a freakin' dumbass.

Err. Now everything GUI related got deformed.
 
Last edited by a moderator:
M

Mordecai142

Guest
Thanks Mordecai142, I'm a freakin' dumbass.

Err. Now everything GUI related got deformed.
no probs n_n you might have to change the gui size when you go into your inventory then reset it when you exit?
 

YanBG

Member
To scale it in Draw GUI, instead of
view_wview/inv_width use window_get_width()/inv_width(then the height too).

Code:
draw_sprite_ext(spr_inventory,0, window_get_width()/2,window_get_height()/2,window_get_width()/sprite_width(spr_inventory),window_get_height()/sprite_height,0,c_white,1)
The x,y(0,0) positions are from your screen not room and depend on the origin of your sprite, if it's in the middle you just place it in the middle of the screen and then scale it.
 
F

Freedom2Fight

Guest
To scale it in Draw GUI, instead of
view_wview/inv_width use window_get_width()/inv_width(then the height too).

Code:
draw_sprite_ext(spr_inventory,0, window_get_width()/2,window_get_height()/2,window_get_width()/sprite_width(spr_inventory),window_get_height()/sprite_height,0,c_white,1)
The x,y(0,0) positions are from your screen not room and depend on the origin of your sprite, if it's in the middle you just place it in the middle of the screen and then scale it.
It took a little adjustment but I got the delicious morsel of code you gave to work, YanBG.

Well, almost. Its a little off to the right. Maybe its the sprite itself?

Thanks. This helped a lot.
 

YanBG

Member
Check in the sprite properties if the origin is in the middle also if the width of the sprite can be divided by 2(so there are no half pixels).
 
F

Freedom2Fight

Guest
Draw GUI End will draw over stuff in Draw GUI Begin right? Is that right?

Can I draw over stuff but still be in the Draw GUI Begin? For example I have two sprites in the Draw GUI Begin event but I want one to be on top of the other - is that possible?
 
I personally use
Create:
Code:
Display-set_gui_size (room_width/320, room_height/240)
320 and 240 are the base sizes, you change them on how ever you want
 
Top