Difference between 0 Opacity and Invisable?

Discussion and feedback on Construct 2

Post » Sat Apr 28, 2012 1:27 pm

Does anybody know the performance difference between 0 opacity and Invisable?rfisher2012-04-28 13:52:16
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Sat Apr 28, 2012 5:50 pm

0 opacity still draws the object, which has an effect on performance, but nothing visually appears.

Invisible skips drawing the object at all which is faster. So instead of setting 0 opacity, set the object invisible.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Apr 28, 2012 11:27 pm

thank you
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Sat Apr 28, 2012 11:30 pm

@Ashley, would it be technically impossible to code objects as 0 opacity to be invisible?
That just makes sense to me...
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Apr 29, 2012 4:27 am

if object opacity = 0 : object set invisible
else : object set visible

That's probably how you could do it
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Sun Apr 29, 2012 4:43 am

It's based off how Classic did it. Since it's possible to write a shader that changed opacity 0 to something else (making the object visible), it should still be drawn so you can see the effect of the shader. However I'm not sure if there are any shaders which can actually do that. So it's kind of a philosophical point. If you mean "don't draw the object at all", make it invisible. Opacity 0 means "draw the object in such a way that (by default) it is not visible".
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sun Apr 29, 2012 5:19 am

So, what are the performance differences between invisible objects and destroyed objects?
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Sun Apr 29, 2012 3:03 pm

Invisible objects still take up logic performance, but a destroyed object does not.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Apr 30, 2012 3:05 pm

[QUOTE=sqiddster] Invisible objects still take up logic performance, but a destroyed object does not. [/QUOTE]

If I have layers (such as menus or options) set to invisible, and basically inactive are the objects still using up resources?

Say for example, the whole logic involving the objects on an invisible layer needs to be toggled by a boolean, would the fact that the objects are held ready to be set visible be using up resources?

I am considering destroying all menus etc and programatically recreating them if needed, but don't want to do this unless necessary.
B
29
S
8
G
4
Posts: 61
Reputation: 6,205

Post » Mon Apr 30, 2012 3:13 pm

In addition, if I go to a new layout, but don't destroy all the objects, or make them invisible will they still be held in memory?
B
29
S
8
G
4
Posts: 61
Reputation: 6,205

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests