Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Trouble fading out a sprite using alpha

Author
Message
Walkman1014
9
Years of Service
User Offline
Joined: 12th Mar 2015
Location: United States
Posted: 12th Mar 2019 06:51 Edited at: 12th Mar 2019 07:00
This post has been marked by the post author as the answer.
SOLVED ----I meant to set my fadeSpeed to 1000. Sorry, everyone!

------------------ Original Post Below ----------------------------------
Hello... I am simply trying to fade a sprite out (UIManBlackCover). Can anyone see what I am doing wrong? I am debugging and the alpha goes from 255 down to 253 on the first iteration... but then stays on 253 for infinity.


function UIManFadeOutBlackCover()
fadeSpeed = 10

while (GetSpriteColorAlpha(UIManBlackCover) > 5)
currentAlpha = GetSpriteColorAlpha(UIManBlackCover)
Log(str(currentAlpha))
SetSpriteColorAlpha(UIManBlackCover, currentAlpha - (fadeSpeed * GetFrameTime()))
sync()
endWhile

SetSpriteColorAlpha(UIManBlackCover, 0)
SetSpritePositionByOffset(UIManBlackCover, gloOffScreen, gloOffScreen)
sync()
endFunction

The author of this post has marked a post as an answer.

Go to answer

Login to post a reply

Server time is: 2024-10-01 03:38:49
Your offset time is: 2024-10-01 03:38:49