GLBasic forum

Feature request => 2D => Topic started by: Hark0 on 2013-Aug-13

Title: ZOOMANIM
Post by: Hark0 on 2013-Aug-13
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.
Title: Re: ZOOMANIM
Post by: erico on 2013-Aug-18
+1 :good:
Title: Re: ZOOMANIM
Post by: Hark0 on 2013-Aug-19
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
Title: Re: ZOOMANIM
Post by: Hark0 on 2013-Sep-06
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
Title: Re: ZOOMANIM
Post by: mentalthink on 2013-Sep-06
 :good: :good: :booze: :-* Thanks
Title: Re: ZOOMANIM
Post by: MrTAToad on 2013-Sep-08
Now you just need it to be able to handle rotation, although I think there is code somewhere that will do that...