When I try to use DisplayTranslucentSprite(), everything before the StartSpecialFX() is washed out in black. I want to display the translucent sprite over the top of a few normal sprites, in this case to simulate light...
However, when I use it without Start/StopSpecialFX, it doesn’t wash out the background. My guess is that creating the special effects buffer fills it with blank space, and that all the sprites before this are just covered up by this...but can anyone tell me what I could do to fix this, or what I'm doing wrong? I remember it working before PB4.0, but I could be wrong.
This is basically what I'm doing:
Code: Select all
InitSprite()
UsePNGImageDecoder()
OpenWindow(0,400,400,200, 150, "Test", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)
OpenWindowedScreen(WindowID(0),0,0,200,150,1,0,0)
#LIGHT=1
#PATTERN=2
LoadSprite(#LIGHT,"spr_light.png",#PB_Sprite_Memory)
LoadSprite(#PATTERN,"spr_pattern.png")
Repeat
Delay(33)
EventID.l = WindowEvent() ;; catch window event
ClearScreen(RGB(255,255,255))
DisplaySprite(#PATTERN,12,27)
If direction=0
trans+5
If trans=255 : direction=1 : EndIf
ElseIf direction=1
trans-5
If trans=0 : direction=0 : EndIf
EndIf
StartSpecialFX()
DisplayTranslucentSprite(#LIGHT, 12, 27, trans)
StopSpecialFX()
FlipBuffers()
Until EventID = #PB_Event_CloseWindow