Fading With Text

This forum is currently in read-only mode.
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hey guys - hate having my first post on a forum being one asking for help, but I've been butting my head against a wall for hours trying to work out why something isn't working.

    What I am attempting to do is have text appear when the player is overlapping with an object and they press the "x" button. The text is supposed to stay there, and once the player no longer overlaps the object, the text should fade out. This action should be repeatable each time the player overlaps the object (ie they leave that area and come back and press "x" again, it should re-appear, and then fade when they no longer overlap).

    Anyway, I can manage to make the text remain when "x" is pressed and they overlap the object, and then using "text>make invisible" I can turn it off when they no longer overlap. But when I change to "text>fade:start", the text immediatley begins fading when "x" is pressed and the player still overlaps the object.

    I'll post my current .cap and hopefully someone can figure out what's going on. The most frustrating thing is that I managed to make the fade work properly with an image in another place, yet it doesn't work this time.

    Oh, to those looking, the "S" box is the item to overlap and press "X" to see the text. Text3 is the text object related to it which I cannot get to fade when not overlapping. "Shift" is the jump button as well.

    Here is the .cap: http://willhostforfood.com/?Action=down ... leid=71924

    The version of Construct I'm using is one of the 0.98.x versions, by the way, but the same thing happens in 0.99.3.

    Thank you all.

  • Mouse is not over object(inverted)

    text set opacity Text.Opacity -1

    Mouse is over object

    text set opacity Text.Opacity +1

  • That's not quite what I want to do there. I can already make the text appear and disappear with a "text>make visible/invisible" event, but what I'm trying to get happening is the fade Behaviour to work when the player isn't overlapping the "S" box, rather than it happening the moment the player overlaps the "S" and presses "x". I mostly want the fade so the rest of the game looks consistant. If what I'm hoping to do can't be done, I guess I'll just have to settle with the visible/invisible events.

    EDIT: Apologies, newt, that does do what I'm wanting it to.

    Is there no way to do it using the Fade Behaviour though? Not that this solution is bad or anything. I'm just very confused as to why the Fade Behavious isn't working how it seems it should (to me, at least). It's practically doing the same thing as the method you posted me there.

    Thank you very much for that.

  • Yeah the fade behavior is a bit hard to get right, thats why I generally use my own.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, seems bizzare anyway. Possible bug maybe, or just a quirky behaviour?

    Anyway, thank you for that, and now I can get myself off to bed now that my mind won't be puzzling over that any more. >_<

  • <preempt Ashley>

    I think you mean Text.Opacity + or - (1*timedelta).


  • <preempt Ashley>

    I think you mean Text.Opacity + or - (1*timedelta).


    Ok, sure if the text is moving.

  • Ok, sure if the text is moving.

    Timedelta isn't just for movement, it's for ensuring that anything you manipulate over time will run at the same speed on different machines. Fading something using timedelta is totally kosher.

    Usually for fading stuff though I just use Every X Milliseconds.

  • Deadeye's right, anything that changes continually over time needs to use timedelta, including acceleration, rotations, opacity, sound effect volumes (eg. if fading out), effect parameters etc. etc. Otherwise, your opacity based fade is tied to the framerate, and the framerate could be anything. The Fade behavior is, of course, framerate independent.

  • I never thought of setting the fade time using TimeDelta, but now it's been mentioned, I see its importance.

    So is there any particular reason why using the Fade Behaviour itself didn't seem to be working how you'd imagine it should, or was I just missing something really obvious in my early morning daze?

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