News:

*NEW* Current Version on STEAM16.793

Webchat:
Visit the chat



ZOOMANIM

Previous topic - Next topic

Hark0

Hi Gernot!

Due to bug... http://www.glbasic.com/forum/index.php?topic=9400.0

I think this function are very easy to add with you... ;)

ZOOMANIM (the name says all ;))


Thanks!

Greetings from Cornella de Llobregat, Barcelona.
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

erico


Hark0

Currently Im use this:

Code (glbasic) Select
FUNCTION ZOOMANIM: Anim,Sprite,PosX,PosY,Zoom

LOCAL Tile=20
LOCAL Escala=Zoom*Tile
LOCAL Origen=Sprite*Tile

STARTPOLY Anim
POLYVECTOR PosX+0, PosY+0 ,0+Origen ,0
POLYVECTOR PosX+0, PosY+Escala ,0+Origen ,Tile
POLYVECTOR PosX+Escala, PosY+Escala ,Tile+Origen ,Tile
POLYVECTOR PosX+Escala, PosY+0 ,Tile+Origen ,0
ENDPOLY

ENDFUNCTION
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Hark0

#3
This code are better!

Code (glbasic) Select
FUNCTION ZOOMANIM: Anim,Sprite,PosX,PosY,Zoom
LOCAL Tile=30
LOCAL Escala=Zoom*Tile
LOCAL sx,sy,cols,tx,ty

GETSPRITESIZE Anim, sx, sy
cols = INTEGER(sx / Tile)
    tx = MOD(Sprite, cols) * Tile
    ty = INTEGER(Sprite/cols) * Tile

STARTPOLY Anim
POLYVECTOR PosX+0, PosY+0 ,tx ,ty
POLYVECTOR PosX+0, PosY+Escala ,tx ,ty+Tile
POLYVECTOR PosX+Escala, PosY+Escala ,tx+Tile ,ty+Tile
POLYVECTOR PosX+Escala, PosY+0 ,tx+Tile ,ty
ENDPOLY

ENDFUNCTION
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

mentalthink

 :good: :good: :booze: :-* Thanks

MrTAToad

Now you just need it to be able to handle rotation, although I think there is code somewhere that will do that...