It looks like you're new here. If you want to get involved, click one of these buttons!
local x=0.2 local frame={} local img2=Bitmap.new(Texture.new("title.png")) for i = 1,9 do --x = 0.1 print(x) img2:setScale(4.5,4.5,0) img2:setAlpha(x) x = x + 0.1 --img2:setAnchorPoint(0.5,0.5) frame[#frame+1] = img2 end local animatie = MovieClip.new{ {1,5,frame[1]}, {6,10,frame[2]}, {11,15,frame[3]}, {16,20,frame[4]}, {21,25,frame[5]}, {26,30,frame[6]}, {31,35,frame[7]}, {36,40,frame[8]}, {41,45,frame[9]} } animatie:setGotoAction(45,1) animatie:gotoAndPlay(1) animatie:setPosition(0,0) stage:addChild(animatie) |
Comments
http://giderosmobile.com/tools/gtween
Likes: misterhup
http://docs.giderosmobile.com/reference/gideros/MovieClip#MovieClip
Likes: misterhup
Fragmenter - animated loop machine and IKONOMIKON - the memory game
In some edge cases where you need to tween something that isn't a Sprite, such as kinematic bodies in Box2D, you have to use GTween. In most cases you should be able to use MovieClip though.
I use GTween a lot, but usually with only a couple of sprites on screen, for point & click type games
Using Tweening is a really good way to save on Atlas space, especially if your game has lots of graphics/animation. It's awesome when combined with frame by frame animation, for things like rotations, bopping movements, left and right movements etc.
I understand that using it for action style games, you might notice some performance drawbacks, but for point and click style adventure games and puzzles, I wouldn't go without it.
As an example, I have an animated slash screen in my games that uses a few images, but the rest is done with Tweening. This splash screen animation, takes up most of the screen, and if I was going to use frame by frame animation, it would be absolutely huge and most likely crash the device it's running on. With tweening tho, I get the animation I want without any hassle and the fps is good too.