Feature request > 2D

ZOOMANIM

(1/2) > >>

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.

erico:
+1 :good:

Hark0:
Currently Im use this:


--- Code: (glbasic) ---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
--- End code ---

Hark0:
This code are better!


--- Code: (glbasic) ---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
--- End code ---

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

Navigation

[0] Message Index

[#] Next page

Go to full version