What is the difference between the two methods Bitmap:setAnchorPoint or Sprite:setAnchorPosition? The former seems to offset the texture and the latter seems to offsets the origin of the sprite. What are the differences and more importantly what are the usages of those methods?
I kind of think both could be used to displace the origin of a sprite to make it rotate and scale around it but I don't see very well when to use one or the other.
Comments
Sprite:setAnchorPosition = in pixels
Likes: SinisterSoft, totebo
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Recently there was discussion of KnifeHit game mechanics, there is good example of using setAnchorPosition(in pixels), by @antix
http://giderosmobile.com/forum/discussion/7355/knife-hit-mechanics-how-to
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
@Apollo14 Thanks for your link but it's too high level for mine. I don't understand the discussion. I'm a beginner after all.
Likes: antix
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
setAnchorPointX(0.5)
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Even if I have an anchor of 0 and again putting 0 - the sprite updates its position, and I don't need it! -I need the sprite - did not change position.
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
As a particular case, you can do it with Bitmap, since it has a getAnchorPoint call.
Likes: oleg
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Likes: Apollo14, pie
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!