Note that #PB_Sprite_Alpha and #PB_Sprite_Alphablending serve two completely different purposes.
Demivec wrote:
CreateSprite(... #PB_Sprite_AlphaBlending) seems to be working fine in PB 4.61b2.
Yes you're right it works; however it's not good for much because of a bug in drawing the alpha layer to a sprite.
This code is tested here working under Directx7 and fails under Directx9 and OpenGL:
Code:
InitSprite():InitSprite3D()
OpenWindow(0,0,0,320,240,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,128,128,0,0,0)
CreateSprite(0,128,128,#PB_Sprite_Texture|#PB_Sprite_AlphaBlending)
CreateImage(0,128,128,32|#PB_Image_Transparent)
StartDrawing(ImageOutput(0))
DrawingMode(#PB_2DDrawing_AllChannels)
Circle(64,64,40,RGBA(0,0,200,255))
StopDrawing()
StartDrawing(SpriteOutput(0))
DrawAlphaImage(ImageID(0),0,0)
StopDrawing()
CreateSprite3D(0,0)
ImageGadget(0,128,0,128,128,ImageID(0))
quit=0
Repeat
Repeat
EventID = WindowEvent()
If EventID = #PB_Event_CloseWindow
quit=1
Break
EndIf
Until EventID = 0
ClearScreen(GetSysColor_(#COLOR_3DFACE))
Start3D()
DisplaySprite3D(0,0,0)
Stop3D()
FlipBuffers()
Until quit
Until it gets fixed the only good way to get an alpha layer onto a sprite is via LoadSprite or CatchSprite as drawing to it is currently bugged.