How to make whole scene fade out when I press some button?

How to make the whole scene fade out by clicking one button. I only can make my "Play" button fade out when I click it and I can't find option to fade out whole scene when I click the "Play" button. Also, how to make whole scene fade in when I enter that scene?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    There isn't a built-in way to do this. You can place an actor with an image that is a black rectangle the size of the scene at the top of the top layer and interpolate its self.color.alpha (opacity) to 0 to fade in. To fade out, reverse the process and change its self.color.alpha to 0 and then interpolate it to 1.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @TaricProductions One straightforward way is to place a full screen-size actor over your screen, or better for editing, just a small black actor at the side of the screen, with a Change Attribute self.Color.Alpha set to 0.

    In your Play button, add a boolean change with: Change Attribute FadeGo to true.

    And in the actor at the side of the screen, put in its Rules (I've made the numbers for a landscape iPad format, obviously change accordingly for other devices):

    When Attribute FadeGo is true
    Change Attribute self.Position.X to 512
    Change Attribute self.Position.Y to 384
    Change Attribute self.Size.Width to 1024
    Change Attribute self.Size.Height to 768

    Interpolate self.Color.alpha to 1 Time: 3 seconds
    Timer: After 3 seconds
    Change Scene

    ---

    And in the next scene, the small black actor at the side is black and its Rules are similar

    Change Attribute self.Position.X to 512
    Change Attribute self.Position.Y to 384
    Change Attribute self.Size.Width to 1024
    Change Attribute self.Size.Height to 768

    Interpolate self.Color.alpha to 0 Time: 3 seconds
    Timer: After 3 seconds
    Destroy

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    @tatiang
    @gyroscope

    I know I sound like a stuck record :) but I always think it's worth pointing out the little glitch (or 'pop') on the end of the interpolation behaviour (when used over a short value range) - it means your fades will never be seamless unless you trim it off - which (as I'm sure you already know) you can do by overshooting the interpolation range . . . . .

    . . . so fade from 0 to 1.1 (rather than 0 to 1)

    . . . or fade from 1 to -0.1 (rather than 1 to 0)

    Also have you tried animated pattern fades, they can work really well sometimes and if you are using a small pattern (in the examples below the image sequence is just 8x8 pixels) the are very processor and memory light.


    3 example files: https://www.mediafire.com/?4d98gc1q2lb9rap



    . . . .
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    I know I sound like a stuck record :) but I always think it's worth pointing out the little glitch (or 'pop') on the end of the interpolation behaviour (when used over a short value range) - it means your fades will never be seamless unless you trim it off - which (as I'm sure you already know) you can do by overshooting the interpolation range.
    I agree.
    Also have you tried animated pattern fades, they can work really well sometimes and if you are using a small pattern (in the examples below the image sequence is just 8x8 pixels) the are very processor and memory light.
    @Socks Very clever!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    I know I sound like a stuck record :) but I always think it's worth pointing out the little glitch (or 'pop') on the end of the interpolation behaviour (when used over a short value range) - it means your fades will never be seamless unless you trim it off - which (as I'm sure you already know) you can do by overshooting the interpolation range.
    I agree.
    Also have you tried animated pattern fades, they can work really well sometimes and if you are using a small pattern (in the examples below the image sequence is just 8x8 pixels) the are very processor and memory light.
    @Socks Very clever!
    Ditto!

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • SocksSocks London, UK.Member Posts: 12,822
    @tatiang
    @gyroscope

    You can get some great effects by playing around with the tile size values, even animating them (I'm sure you couldn't animate tile size values before, but you can now), for example with the dots, try changing their tile size from what it is at the moment (8 x 8) to 8 x 300 . . . .
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited February 2014

    Ha! Excellent, @Socks!! B-)

    I kick myself for not trying that combination.... excellent... ah, I've just said that.... :-) Just done a test, and animated patterns are go... excell..... oh, you get the picture... ;-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ArmellineArmelline Member, PRO Posts: 5,371
    @Socks you really should consider pulling together your 50 favourite mini-templates/effects and bundling them together into a "Socks Drawer" collection that you sell.

    You make so many insanely cool things that you give away for free. I don't want to discourage you from doing so but there's room for a paid collection too, I'm sure :D
  • j75j75 Member, PRO Posts: 235
    socks drawer... lol
Sign In or Register to comment.