Author Topic: ZOOMANIM  (Read 3073 times)

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
ZOOMANIM
« 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.
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4149
    • View Profile
    • Portfolio
Re: ZOOMANIM
« Reply #1 on: 2013-Aug-18 »
+1 :good:

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
Re: ZOOMANIM
« Reply #2 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
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
Re: ZOOMANIM
« Reply #3 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
« Last Edit: 2013-Sep-07 by Hark0 »
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3341
  • Integrated Brain
    • View Profile
Re: ZOOMANIM
« Reply #4 on: 2013-Sep-06 »
 :good: :good: :booze: :-* Thanks

MrTAToad

  • Guest
Re: ZOOMANIM
« Reply #5 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...