Found an issue in SpiderBasic ? Please report it here !
poshu
 
Posts: 96
Joined: Mon Feb 24, 2014 11:46 pm

2.21 : DisplayTransparentSprite() Color argument ignored

by poshu Sat Jun 08, 2019 1:07 pm

Code: Select all
InitSprite()
OpenScreen(40,40 ,0,"")

Procedure Handler_Redraw()
   ClearScreen(RGB(255,0,0))
   
   DisplayTransparentSprite(0,20,20,255,RGB(0,255,0))
   FlipBuffers()
EndProcedure

Procedure Handler_Loading(Type, Filename$, ObjectId)
   FlipBuffers()
EndProcedure

BindEvent(#PB_Event_RenderFrame,@Handler_Redraw())
BindEvent(#PB_Event_Loading,@Handler_Loading())

LoadSprite(0,"sprite.png",#PB_Sprite_AlphaBlending)
Fred
Site Admin
 
Posts: 1298
Joined: Mon Feb 24, 2014 10:51 am

Re: 2.21 : DisplayTransparentSprite() Color argument ignored

by Fred Mon Apr 20, 2020 8:31 am

You're right, it doesn't work as intendent. It just modify the 'tint' for now, so the sprite has to have the color in it for the effect to show.

Code: Select all
InitSprite()
OpenScreen(40,40 ,0,"")


CreateSprite(0,32,32, #PB_Sprite_AlphaBlending)

StartDrawing(SpriteOutput(0))
Box(0, 0, 32, 32, RGB(255,255,0))
StopDrawing()

Procedure Handler_Redraw()
   ClearScreen(RGB(255,0,0))
   
   DisplayTransparentSprite(0,0,0,255, 255)
   FlipBuffers()
EndProcedure

BindEvent(#PB_Event_RenderFrame,@Handler_Redraw())

FlipBuffers()


Will try to change this.
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 3 guests