Draw a sprite on a sprite

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
SPH
Enthusiast
Enthusiast
Posts: 561
Joined: Tue Jan 04, 2011 6:21 pm

Draw a sprite on a sprite

Post by SPH »

I would like it to be possible to draw a sprite on a sprite.

Code: Select all

CreateSprite(2, zoom,zoom/10);-1003
StartDrawing(SpriteOutput(2))
DisplaySprite(1,0,0)
DrawingMode(1)
DrawingFont(Police)
scor$="Score : "+Str(score)+" - (Best : "+Str(high)+") "
DrawText(zoom/45,zoom/52,scor$, RGB(177,177,77))
StopDrawing()
[21 :52 :11] [ERREUR] DisplaySprite(): Cette fonction ne peut être appelée à l'intérieur d'un bloc StartDrawing()/StopDrawing().
[21 :52 :21] Le programme a été arrêté.

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
Demivec
Addict
Addict
Posts: 4259
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Draw a sprite on a sprite

Post by Demivec »

It has been many versions of PureBasic since that was possible and then it was only possible with the DirectX 7 sub system. I don't think it is a likely possibility.

However, for your demonstrated need you could just pre-make the necessary sprites and display them as needed instead of remaking the needed composed sprite each time.

You would need sprites for the three text sections: 'Score : '; ' - (Best : '; ') '.
You would need a sprite for each numeric digit 0 to 9.
User avatar
SPH
Enthusiast
Enthusiast
Posts: 561
Joined: Tue Jan 04, 2011 6:21 pm

Re: Draw a sprite on a sprite

Post by SPH »

This isn't currently possible.

But I would dream of:

Code: Select all

CreateSprite(2, 100,100)
StartDrawing(SpriteOutput(2))
;;;
DRAWSPRITE(1,5,0) ; ===>  N E W    I N S T R U C T I O N    P B
;;;
DrawingMode(1)
DrawingFont(Police)
DrawText(20,20, a$, RGB(99,99,99))
StopDrawing()
:idea: :idea: :idea: :idea: :idea: :idea:

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
Post Reply