Page 1 of 1

1.01 : DisplayTransparentSprite() bug ?

Posted: Fri May 08, 2015 12:54 pm
by Comtois
What i'm doing wrong ? Doc say default transparent color is 0, so why i can see black box ? I just want red circle.

Code: Select all

ExamineDesktops()
OpenScreen(DesktopWidth(0), DesktopHeight(0), DesktopDepth(0), "Test")

Procedure RenderFrame()

  ClearScreen(RGB(0, 130, 150))
      
  DisplayTransparentSprite(0, 50, 50)
  FlipBuffers() ; continue the rendering
EndProcedure

CreateSprite(0, 64, 64, #PB_Sprite_AlphaBlending)
If StartDrawing(SpriteOutput(0))
  Circle(32, 32, 25, RGBA(255, 0, 0, 0))
  StopDrawing()
EndIf

FlipBuffers() ; start the rendering
BindEvent(#PB_Event_RenderFrame, @RenderFrame())

Re: 1.01 : DisplayTransparentSprite() bug ?

Posted: Fri May 08, 2015 2:04 pm
by Fred
SpiderBasic only support real Alpha component, that's why you see the black box. I will change the doc to reflect this.

Re: 1.01 : DisplayTransparentSprite() bug ?

Posted: Thu Dec 31, 2015 4:15 pm
by mahan
Sorry for necro, but I'd really like if someone could expand on this:

How do i programmatically create a sprite that 1) Is fully transparent (no black background) 2) I can draw shapes/text/images on?

What I want to do is to be able to create any "drawable overlay" in my game: Like rendered Game-GUI and design-time grid etc. I want it to work with "screen".

NOTE: I've managed to work around the issue, by creating a large png-picture file, fullt transparent, load it as a sprite, and then do draw operations on this sprite, but this is not very convenient. (And for some reason CopySprite() does not work, so I have to reload the image every time(!) I want to redraw something on the sprite)