GameMaker 【QUESTION】 How to set the transparency of view?

M

mather12

Guest
I build UI with view.I can't find any function to set set the transparency of view.


I'm so sorry i didn't make myself clear.It's goes that ,I'm build UI with the "view" which allowed have eight only,because I think it's too much trouble to build it by usual way.You need to set the code in "draw GUI" to set the position and size of different UI component objects,and then set their function area in "step"...etc.The problem is this all with nonintuitive code,it's impatient to me,especially when I want to make something similar to item bar .So I try to set some "UI area" outside room ,use the camera to display there,when I want to close the UI I just set the view invisible.All thing goes well but there is a trouble to my game is the UI is not translucent,this wouldn't look well.So I want know how to make the view or camera display translucent.
 
Last edited by a moderator:

Niels

Member
Not exactly sure what you mean. You want to set the transparency of the objects of your UI? That's just setting the image_alpha of those objects on less than 1
 
D

Deleted member 13992

Guest
Could you explain in more detail? "view" has a very specific meaning in gamemaker, and refers specifically to the camera frame. I don't think you meant that.
 

Jakylgamer

Member
you can change the global alpha with
Code:
draw_set_alpha(0.5); //set alpha to 0.5
//draw gui stuff here
draw_set_alpha(1);//reset alpha back to 1 (if you dont change this back it will show all things at an alpha value)
 
M

mather12

Guest
I'm so sorry i didn't make myself clear.It's goes that ,I'm build UI with the "view" which allowed have eight only,because I think it's too much trouble to build it by usual way.You need to set the code in "draw GUI" to set the position and size of different UI component objects,and then set their function area in "step"...etc.The problem is this all with nonintuitive code,it's impatient to me,especially when I want to make something similar to item bar .So I try to set some "UI area" outside room ,use the camera to display there,when I want to close the UI I just set the view invisible.All thing goes well but there is a trouble to my game is the UI is not translucent,this wouldn't look well.So I want know how to make the view or camera display translucent.
 

Gzebra

Member
Don't use views, use surfaces. Doing stuff directly with views is complicated, managing surfaces yourself is much easier when you're working with GML. My conclusion from being a GM'er for over 15 years is, don't use views, only use objects when it makes sense architecturally, and never draw anything directly to the application surface. (Except other surfaces of course) You might find your self having to take over the management of the application surface, don't think of this as a bad thing, think of it as a limitation of the engine.
 
Top