Hi, I am trying to tween a anchor point along with rotation using gtween. I am using the GiderosCodingEasy Library
here is my code.
-- start code
local angle = 15;
local star = Bitmap.new(Texture.new("star.png"))
star:setPosition(500, 280)
star:setAnchorPoint(0.5, 0.5) -- start with center of the image.
star:setRotation(angle)
stage:addChild(star)
local animate = {};
animate.rotation = 360 + angle
local properties = {};
properties.delay = 1;
properties.dispatchEvents = false
-- tried this doesn't work
-- animate._anchorX = 2.0
-- animate._anchorY = 2.0
animate.anchorX = 2.0
animate.anchorY = 2.0
local properties = {};
properties.delay = 0;
properties.dispatchEvents = false
local gtweener = GTween.new(star, 5, animate, properties)
-- end code.
The error i am getting is
GiderosCodingEasy/GiderosCodingEasy.lua:347: Parameter 'param' must be one of the accepted values.
stack traceback:
GiderosCodingEasy/GiderosCodingEasy.lua:347: in function 'get'
GiderosCodingEasy/gtween.lua:385: in function 'init2'
GiderosCodingEasy/gtween.lua:212: in function 'setPosition'
GiderosCodingEasy/gtween.lua:81: in function
Any ideas what i am doing wrong ?
-Uncleking
Comments
And for some reason, no one ever requested it in GiderosCodingEasy
But is should be quite easy to fix.
pushed new version, fixing it to github
now you can tween anchorX and anchorY properties
Likes: uncleking
(side note ! i did almost same changes you did )
-UncleKing
Likes: ar2rsawseen