Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

stage object: can't set anchor point
Started by ingemar Aug 09 2013 12:47 AM

2 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

Issue 1)

The stage object anchor defaults to (0.5, 0.5) however it seems to be hardcoded to (0,0) while rotating the stage.

 

Forcing it with stage.anchorX, stage,anchorY = 0.5, 0.5 doesn't help either.

 

Issue 2)

Trying to set the anchor to something else like stage.anchorX, stage,anchorY = 1, 1 doesn't retain the new values. print(stage.anchorX, stage.anchorY) will display (0.5, 0.5) no matter what you try to set the anchor to.

 

I need to set the anchor to (0.5, 0.5) so that the stage rotates around the centerpoint.



[TOPIC: post.html]
#2

Tom

[GLOBAL: userInfoPane.html]
Tom
  • Moderator

  • 1,480 posts
  • Corona Staff

Groups don't have anchor points. They will report back an anchor point but you can't set it. You need to use containers (a subclass of groups) instead.



[TOPIC: post.html]
#3

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

@Tom

In Graphics 2.0, how can we then handle proper animated autorotation around the center when device orientation changes, if it's not possible to set the anchor of the stage?

It would mean we all of a sudden need to create our own "fake" stage as a top level container for all our objects.

 

Please consider making the Corona stage object a container in Graphics 2.0.

 

...or are there any other ways of doing this that escape me?

 

 

EDIT:

I've created a new topic for the Autorotation issue since it strays from the topic of this thread.

http://forums.coronalabs.com/topic/38169-animated-autorotation-in-graphics-20-not-possible/


Edited by ingemar, 10 August 2013 - 07:38 AM.



[topic_controls]
[/topic_controls]