Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
GTween (scale, rotation) — Gideros Forum

GTween (scale, rotation)

MillerszoneMillerszone Member
edited October 2011 in General questions
I've been trying out GTween. I got an image to fade in and out.
Is there some examples to scale an image in and out and rotate an image?
local background = Bitmap.new(Texture.new("background.png"))
sprite:setAlpha(0.0)
stage:addChild(background)
 
-- Fade in and out
GTween.new(background, 2, {alpha = 1.0})
GTween.new(background, 2, {alpha = 0.0}, {delay = 1.0})
Thanks

Comments

  • atilimatilim Maintainer
    edited October 2011
    Hi Mike,

    You can also tween "rotation", "scaleX" and "scaleY" parameters. Here is a simple example:
    local bitmap = Bitmap.new(Texture.new("image.png"))
    bitmap:setAnchorPoint(0.5, 0.5) -- now the origin of the Bitmap is at its center
    bitmap:setPosition(160, 240)
    stage:addChild(bitmap)
     
    GTween.new(bitmap, 2, {rotation = 180, scaleX = 3, scaleY = 3}, {ease = easing.outBack})
    you're welcome

    Likes: Holonist

    +1 -1 (+1 / -0 )Share on Facebook
  • Thanks, that's exactly what I needed to know.

    GTween and Ease is good stuff when you know all the properties.

  • atilimatilim Maintainer
    We're planning to write a whole chapter about animation in Gideros. It's hard to understand the whole capabilities without documentation.
  • marcosmarcos Member
    edited November 2011
    Yes, it's hard! When do you plan to publish animation chapter?

    update: Some usefull information: http://gskinner.com/libraries/gtween/docs_v2_01/
Sign In or Register to comment.