Repeated fading object.

This forum is currently in read-only mode.
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I'm sure this is a total noob question, but anyway... If we use the health text in the ghost shooter tutorial as an example, what would be the best way of making that text fade in and out upon receiving damage. I've tried various methods using the fade behaviour, but I can't seem to get the text to come back after the first time it shows.

    I'd also like the text, when it becomes visible, to be located over the main player sprite. I'm sure I could figure out how to do THAT easily enough, but it probably wouldn't be very efficient.

    Thanks for your help.

  • Hi, I haven't seen the ghost hunter tutorial in ages, but my guess is a text appears on screen, indicating you've taken damage, then fades?

    When the damage occurs: System: Create object "fadetext" at (middle of screen)

    fadetext fadeout is finished- destroy fadetext

    that should suffice I suppose (?)

    lol

  • Ah, I just tried it and you can't run a fade again once the fade finishes. That's fixed in the next build - use the 'Start' action in the Fade behavior to run the fade again. Also, make sure 'Destroy afterwards' is unticked in Fade properties! For now, you could do as midnight suggests and create separate objects.

  • Okay, thanks so much to both of you! I'll do my best, and it's great to hear these little updates that can be expected in the next version.

    Edit: Works well enough guys. Thanks again.

  • how would i have 2 blue glowing dots on 2 different image points, fade in and out all the time? can't seem to do it in a proper way.

  • how would i have 2 blue glowing dots on 2 different image points, fade in and out all the time? can't seem to do it in a proper way.

    That can be easily achieved using some simple maths. In an "Always" event, set the opacity of the objects to this:

    50 + sin(timer / 4) * 50

    Changing the 4 changes the speed. A higher number is slower and a lower number is faster. Hope that helps.

    By the way, I suggest adding the ability to change the opacity of an object to the Sine behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > how would i have 2 blue glowing dots on 2 different image points, fade in and out all the time? can't seem to do it in a proper way.

    >

    That can be easily achieved using some simple maths. In an "Always" event, set the opacity of the objects to this:

    50 + sin(timer / 4) * 50

    Changing the 4 changes the speed. A higher number is slower and a lower number is faster. Hope that helps.

    By the way, I suggest adding the ability to change the opacity of an object to the Sine behavior.

    i just realized that a simple "fade" behaviour did the trick. thanks anyway!:)

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