1.01 : DisplayTransparentSprite() bug ?

Just starting out? Need help? Post your questions and find answers here.
Comtois
Posts: 40
Joined: Mon Feb 24, 2014 11:07 pm

1.01 : DisplayTransparentSprite() bug ?

Post 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())
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: 1.01 : DisplayTransparentSprite() bug ?

Post by Fred »

SpiderBasic only support real Alpha component, that's why you see the black box. I will change the doc to reflect this.
mahan
Posts: 19
Joined: Sun Nov 15, 2015 9:44 pm

Re: 1.01 : DisplayTransparentSprite() bug ?

Post 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)
Post Reply