Transition Effect

0 favourites
  • 5 posts
From the Asset Store
Complete the collection by purchasing Game and Film Logo Transitions Pt.2: Musical Loops
  • I'm trying to create a generic function that will slowly transition the screen from visible to black. The premise is that the "Fade" function will accept two parameters. The first parameter will determine how much the fade will decrease by and the 2nd parameter determines how many times it will cycle through/repeat until it is done.

    When I run this block of code though, the effect is instant and I eventually appear on Layout 2. What I'd hope would happen is that you'd see the screen gradually fade and then you'd emerge on Layout 2.

    Any help on what I've done wrong would be greatly appreciated! I tried adding Wait in the loop various times with no success. I also had originally tried Repeat (Function.Param(1) times as opposed to the for loop but it made no difference.

  • Hey Twinblake,

    i am trying to achive the same, but i am stuck as you are...

    [attachment=0:18sq3bug][/attachment:18sq3bug]

    it seems like the *dt not work within functions. if i leave the function away and just do the script so it fades in and out again smoothly as it should. but as soon as i put the action within the function it stops to work, even if i call the function. however wenn i set a total value of opacity in the function it also works...

    to be hornest i have no idea whats going on there O_o

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey, thanks for the response. I'm glad its not just me, but it seems really strange to me. I'm no expert programmer by any means, but I'd think that functions here work just like Methods in Java not sure why it's failing. I was hoping to teach students how functions can be useful using this easy block of code.

    In debug mode, somehow the fade variable gets set to -809 almost instantly. I have no idea how it could've ever get to -809 using this code.

  • j0schi check out the example CAPX's that come default with the Construct 2 download. They have some transition effect examples that you can tweak, those may help you achieve what you are looking for.

  • Thanks for pointing this out, i will have a look at it

    but it would anyway interest me why the function dont work at this place...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)