Maybe I am missing something but I would very much like to be able to toggle the visibility of an object. Why do we have two seperate actions for visibility? Show and Hide. Why not just one action Visibility that can be Show and Hide which can be also replaced by a boolean variable for example or better just have a toggle function already. I do understand I can just make two seperate conditions to solve this but it would maybe just be a little bit more clean? Just my 50p and honest question. Please indulge my ignorance in this.
As far as I remember this is done for backwards compatibility among some other backend reasons.
That said you could just use the opacity action instead and use 0 opacity for hidden and 255 for show.
Hello!
As said by @Silver-Streak, this can be easily bypassed.
So, a new functionality for correcting this, is not a priority in GD, in my opinion.
A+
Xierra
On one hand i would like toggle action
On other hand we would clutter action list with additional actions if we would add any possible ones
You can simply do this
![]()
abs(Player.Opacity::Value()-255)
Right click
Opacity 0 does not draw the object?
That would make sense indeed. But it could be added like they changed from MouseX() to CursorX() for example while both still work. you will not find MouseX() in the editor anymore.
I don’t understand your question
I wonder if there is a difference. for example : The Hide does not draw the object on the screen which performance wise would be better the other does but changes the opacity. Also If the object is drawn it could still be hitting other objects for example. I do not know the internal workings of the 3 actions. I am wondering about the reason why they are made 2 or even 3 seperate actions. Which could be easily understood as one action called visibilty. Which it is also in the condition. You do not have a condition hidden and visible. Just visibility and then ofcourse the option to invert that condition (which is hidden). So why two actions it is counter intuitive imho.
I give you orange into your hand
Now i make it become invisible
Its still there you just can’t see it
But you still can feel it you can tell what shape it is and what is its weight
Same with objects
If you think hiding/changing opacity will help your performance you are wrong
Same for all object related events
Just cause you hide something does not mean you are not processing it
If you are checking if player is in collision with rock
You are 1st picking all rocks and then you check if player collide with any
If you will hide rocks that are off screen then you are still picking all rocks to check if they are hidden or their opacity is 0
Bottom line hiding objects or changing opacity to 0 will not boost your performance in any way you can notice
As for conditions
There is no dual condition for anything
Always there is only true condition which you can invert
I’m in favor of removing both of them and using only opacity.
If the issue is maintaining backward compatibility, it shouldn’t be difficult to say:
object hide = 0 opacity,
object show = 255 opacity.
With opacity you can create transitions, but you can’t really “lerp” from object hide to object show.
Anyway, that’s just my take on the matter.
You could have opacity for everything.
Opacity=256 is flip on x
Opacity=257 not flip on x
Opacity=258 is flip on y
Opacity=259 not flip on y
Opacity=230 to 233 blendmode
Opacity=234 to 235 is scale on x/10000
Etc