Page 1 of 1

GrabSprite and #PB_Sprite_AlphaBlending flag.

Posted: Fri Nov 21, 2025 9:22 pm
by SPH
Hi,

I'm creating sprites using the GrabSprite instruction.

Code: Select all

For u=1 To 8
  GrabSprite(u,74,4+(u-1)*taille_y,taille_x,taille_y)
Next
But PB6.30 requires me to use the #PB_Sprite_AlphaBlending flag.
[21 :09 :33] [ERREUR] DisplayTransparentSprite(): A sprite should be created with the flag #PB_Sprite_AlphaBlending to use this command.
How do I use it with a grab?

I use that but it,s not ok :

Re: GrabSprite and #PB_Sprite_AlphaBlending flag.

Posted: Fri Nov 21, 2025 9:33 pm
by STARGÅTE

Code: Select all

GrabSprite(u,74,4+(u-1)*taille_y,taille_x,taille_y, #PB_Sprite_AlphaBlending)

Re: GrabSprite and #PB_Sprite_AlphaBlending flag.

Posted: Fri Nov 21, 2025 9:36 pm
by miso
The screen has no transparency channel to grab though. Drawing an image then grabbing it to sprite can be replaced. You can draw the image part to a newly created sprite directly (instead of the screen), or just load the whole as a single sprite atlas, and use clipsprite to get your individual sprite from it.

Re: GrabSprite and #PB_Sprite_AlphaBlending flag.

Posted: Fri Nov 21, 2025 9:59 pm
by SPH
STARGÅTE wrote: Fri Nov 21, 2025 9:33 pm

Code: Select all

GrabSprite(u,74,4+(u-1)*taille_y,taille_x,taille_y, #PB_Sprite_AlphaBlending)
Thank you... but the sprite is invisible (transparent?)