[Gambas-devel] Virtual class in gambas
Laurent Carlier
lordheavy at ...141...
Thu Aug 11 15:08:59 CEST 2005
Benoit Minisini a écrit :
>
> No... This is an internal "hack" made for speeding up C/C++ components.
>
> Sprites in Gambas ? And speed ? :-) And I hate this 'blit' name everywhere - I
> prefer 'Draw' ;-)
>
> Regards,
>
Sprites are all "precalculated" in an internal surface, so i need only
an index to "draw" the good sprite (index * spriteWidth) :)
---------
DIM mySprite as new Sprite
mySprite.Load("thesprite", width, height, first, count)
' or mySprite.FromSurface(Surface, width, height, first, count)
mySprite.Animation = Sprite.PlayLoop
mySprite.Delay = 0.5 ' 500 ms between two sprites
startRefreshLoop
.....
mySprite.Play(x,y)
.....
endRefreshLoop
surface = mySprite[0] ' returns the sprite 0 as a surface
--------
etc.....
Yes, draws seem to be better :) (blit remember me my old amiga computer)
--
Laurent Carlier
jabber : LordHeavy at ...298...
More information about the Devel
mailing list