Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Rotate around free anchor
Started by andreaszdw Jan 15 2019 06:42 AM

4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

andreaszdw

[GLOBAL: userInfoPane.html]
andreaszdw
  • Observer

  • 6 posts
  • Corona SDK

Hello,

 

I have an rect and I want rotate it around a point. The rect is for example 1000x1000 pixel, now I want to rotate it around point 800, 350, how to set the anchor point?



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,508 posts
  • Corona SDK

That is a math thing, not a anchor thing.

You can use code from SSK2 to do this:

https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/misc/#rotateabout



[TOPIC: post.html]
#3

ldurniat

[GLOBAL: userInfoPane.html]
ldurniat
  • Contributor

  • 389 posts
  • Corona SDK

Hi @andreaszdw,

 

Try use Extended Anchor Points

 

 

Have a nice day:)

 

ldurniat


  • roaminggamer likes this

[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,508 posts
  • Corona SDK

That is right.  You could use extended anchors and simple rotation too.  Nice catch @ldurniat!

 

The only trick will be converting from anchor space to pixel space, but that isn't too bad.



[TOPIC: post.html]
#5

andreaszdw

[GLOBAL: userInfoPane.html]
andreaszdw
  • Observer

  • 6 posts
  • Corona SDK

Thanks a lot, that helps much.




[topic_controls]
[/topic_controls]