Quote: "It's just invisible for a moment and then visible"
it's doing what you want it to except it's too fast to see. so, slow it down using a timer
i had whipped this up while LBFN was adding his:
rem grab a red block image
cls rgb(255,0,0)
get image 1,0,0,64,64
sprite 1,40,20,1 `use the red block for sprite 1
alpha = 0 `start with alpha value at 0 (invisible)
set sprite alpha 1,alpha
toggle = -1 `flag used to toggle add/subtract value to current alpha parameter
do
if lastfade + 10 < timer() `if 1/100th of a second has passed, we'll change the alpha value
if alpha = 0 or alpha = 255 `keep alpha value between 0 & 255
toggle = -toggle `toggle between adding or subtracting 1 to current alpha value
endif
alpha = alpha + toggle `step alpha to next value
set sprite alpha 1,alpha `update alpha value for sprite
lastfade = timer() `time-stamp to tell us when to change alpha value again
endif
rem some text to show current alpha setting
text 0,0,"alpha value: " + str$(alpha)
rem and the equivalent transparency percentage
percent$ = str$(int((alpha+1)/2.56)) `convert value to integer, then to a string for use with text command
text 0,16, percent$ + "%"
loop
add: syntax highlighter still unfinished so i took it out.
Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit