I write through a translator. "Sprite:getRotation" method rotates the sprite relative to the point (0,0). How to rotate a sprite in an arbitrary point?
Parameters: x: (number) The x coordinate of anchor point. Usually between [0, 1]. y: (number) The y coordinate of anchor point. Usually between [0, 1].
hope it help.
TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! - www.tntengine.com
Parameters: x: (number) The x coordinate of anchor point. Usually between [0, 1]. y: (number) The y coordinate of anchor point. Usually between [0, 1].
setAnchorPoint accepts relative coefficient form 0 to 1, where 0 is the left/top side, 0.5 is a center and 1 is the right/bottom side (depending on x or y axis)
setAnchorPoint accepts relative coefficient form 0 to 1, where 0 is the left/top side, 0.5 is a center and 1 is the right/bottom side (depending on x or y axis)
exactly ... ....
TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! - www.tntengine.com
Thanks, guys. I asked a question simpler, but my thoughts were deeper. For example, I have a structure of objects: stage --Sprite ___anylayer --Sprite ______anyBitmap1 --Bitmap ______anyBitmap2 --Bitmap ______anyBitmap3 --Bitmap
I wanted to turn the whole sprite "anylayer" relative to the point, but it is impossible now. Thank you again.
Hmm, usually you can't download file if you are not logged in. Could you check ii when you visit that thread. Does it show that you are logged in, when trying to download file?
About usage: Simply include it in your project init.lua file (create one if you don't have it) and all your Sprite's will have setAnchorPoint methods
Comments
Parameters:
x: (number) The x coordinate of anchor point. Usually between [0, 1].
y: (number) The y coordinate of anchor point. Usually between [0, 1].
hope it help.
www.tntengine.com
is Sprite:setAnchorPoint(x,y) has been implemented officially? I thought only Bitmap:setAnchorPoint(x,y) in the official API right now.
But worry not @jack0088 has made addition for Sprite class for handling anchor point http://giderosmobile.com/forum/discussion/1502/setanchorpoint-for-sprites-shapes-and-all-of-your-classes#Item_1
However if you love the matrix to do hardcore transformation, then try Sprite:setMatrix
http://www.nightspade.com
I have used this solution:
dot = Bitmap.new(Texture.new("OB.PNG")) --32x32
dot:setPosition(-16, -16)
group1 = Sprite.new()
group1:addChild(dot)
stage:addChild(group1)
group1:setRotation(45)--Rotate about centre
dot:setPosition(.5, .5)
www.tntengine.com
....
www.tntengine.com
I asked a question simpler, but my thoughts were deeper.
For example, I have a structure of objects:
stage --Sprite
___anylayer --Sprite
______anyBitmap1 --Bitmap
______anyBitmap2 --Bitmap
______anyBitmap3 --Bitmap
I wanted to turn the whole sprite "anylayer" relative to the point, but it is impossible now. Thank you again.
usually you can't download file if you are not logged in. Could you check ii when you visit that thread. Does it show that you are logged in, when trying to download file?
About usage:
Simply include it in your project init.lua file (create one if you don't have it) and all your Sprite's will have setAnchorPoint methods