Which process of hiding an actor is less processor intensive? When to use which?

TWEAmazingAppsTWEAmazingApps Member Posts: 219
edited May 2012 in Working with GS (Mac)
Hi gamesalad community! I was wondering if someone can help me, I wanted to know which process of hiding an actor is more efficient (Better for high frame rate)? Changing an actor's alpha channel to 0 or turning the visible attribute to false (under graphics)? Also is there any tips on when i should use one and not the other? Thanks!

Best Answers

  • jckmcgrawjckmcgraw Posts: 647
    Accepted Answer
    @TWEAmazingApps

    I always use self.color.alpha and I haven't had any problems with it. This way, if you want to change the alpha to 0.5, the visible will be on no matter what. You can also use interpolate to have it fade out (which you can't do with self.graphics.visible).

    Hope this helps,
    Jack McGraw
  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    Accepted Answer
    Well changing its visible attribute off is better, but you cant change that in game. So you'll have to use alpha
  • JGary321JGary321 Posts: 1,246
    Accepted Answer
    Like @jckmcgraw said you cannot change self.graphics.visible with rules.

    If it's something that EVER needs to be visible, but you just want it invisible for the time being than use self.color.alpha.

    If it's something that NEVER needs to be visible, use self.graphics.visible.

    I don't think changing alpha really helps with performance, while changing the self.graphics.visible does help. (performance-wise)

    JG
  • mynameisacemynameisace Hull, UKPosts: 2,484
    edited May 2012 Accepted Answer
    Yeah, it'll still fire. Just click the plus and have when touch is pressed AND self.color.alpha is 1 then DO

    Ace

Answers

  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    Thanks alot guys!! That cleared things up alot!!
  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    No if i have a picture behind a picture and the top picture i turn it's alpha to 0, if i touch that picture will it still fire off it's touch events? If so, how can i disable that from happening, because that is the whole purpose why i want to hide elements so that one picture (or page) becomes inactive and the next one under it becomes active. Thanks!
  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    Ahh ok thanks!!
  • insideappsinsideapps Member Posts: 6
    Yeah, it'll still fire. Just click the plus and have when touch is pressed AND self.color.alpha is 1 then DO

    Ace
    Thanks for this! Been looking for a solution for that.

Sign In or Register to comment.