It looks like you're new here. If you want to get involved, click one of these buttons!
local frames = {} frames[1] = Bitmap.new(pack1:getTextureRegion("lightbulbAnim0001.png", true)) frames[2] = Bitmap.new(pack1:getTextureRegion("lightbulbAnim0002.png", true)) frames[3] = Bitmap.new(pack1:getTextureRegion("lightbulbAnim0003.png", true)) frames[1]:setAnchorPoint(0.5, 0) frames[2]:setAnchorPoint(0.5, 0) frames[3]:setAnchorPoint(0.5, 0) |
Comments
However in giderosCodingEasy there is a Sprite:setAnchorPoint() method that should enable this feature on MC too
myMc:setAnchorPosition(myMc:getWidth()/2,myMc:getHeight()/2)
does it?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Thanks for the reply!
I think I am using giderosCodingEasy (its in my project folder), because I can set a anchor points for sprites.
It however doesn't seem to work with mc.
Ahh, that world make sense, since myMc is kind of like a container for all the frames.
Thanks for the tips!
I've tried ...
myMc:setAnchorPosition(myMc:getWidth()/2,myMc:getHeight()/2)
and also
myMc:setAnchorPoint(myMc:getWidth()/2,myMc:getHeight()/2)
but neither one works.
myMc:setAnchorPosition(myMc:getWidth()/2,myMc:getHeight()/2)
before calling any setscale etc things.
and if you want to have "frames[1]:setAnchorPoint(0.5, 0)" effect then of course do
myMc:setAnchorPosition(myMc:getWidth()/2,0)
but all in all
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Using the for loop, will be the easiest in my case