Zwiebelchen
Hosted Project GR
- Joined
- Sep 17, 2009
- Messages
- 7,234
I'm totally puzzled on this.
The images just won't crossfade properly.
The first image will just instantly vanish, no matter what. I'm not even sure if images actually allow transparency at this point...
Note that I'm using them as TGA, not BLP. But I don't think this should make a difference, right? They display correctly after all, they just won't crossfade.
The images just won't crossfade properly.
JASS:
private function FadeImageCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local player p = LoadPlayerHandle(TimerHash, GetHandleId(t), 0)
local image which = LoadImageHandle(TimerHash, GetHandleId(t), 1)
local image into = LoadImageHandle(TimerHash, GetHandleId(t), 2)
local integer count = LoadInteger(TimerHash, GetHandleId(t), 3)
if count < 9 then
set count = count + 1
call SetImageColor(which, 255, 255, 255, 255-count*25)
if into != null then
call SetImageColor(into, 255, 255, 255, count*25)
endif
call SaveInteger(TimerHash, GetHandleId(t), 3, count)
else
call SetImageColor(which, 255, 255, 255, 0)
if into != null then
call SetImageColor(into, 255, 255, 255, 255)
endif
call FlushChildHashtable(TimerHash, GetHandleId(t))
call DestroyTimer(t)
endif
set which = null
set into = null
set p = null
set t = null
endfunction
private function FadeImage takes player p, image which, image into returns nothing
local timer t = CreateTimer()
call SavePlayerHandle(TimerHash, GetHandleId(t), 0, p)
call SaveImageHandle(TimerHash, GetHandleId(t), 1, which)
call SaveImageHandle(TimerHash, GetHandleId(t), 2, into)
call SaveInteger(TimerHash, GetHandleId(t), 3, 0)
call TimerStart(t, 0.2, true, function FadeImageCallback)
set t = null
endfunction
The first image will just instantly vanish, no matter what. I'm not even sure if images actually allow transparency at this point...
Note that I'm using them as TGA, not BLP. But I don't think this should make a difference, right? They display correctly after all, they just won't crossfade.
Last edited by a moderator: