Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

anchorX/Y clamped to -1..1, why?
Started by davebollinger Apr 17 2014 05:38 AM

No replies to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Corona Geek

  • 1,373 posts
  • Corona SDK

As a suggestion for engineering to consider...
Just wondering why they're clamped, and can't be set to 2.0 or -3.5 or etc?

Here's a scenario: let's say I have a "decal" -type small image (or several) that is intended to be "grouped" with a larger image upon which it can be "stuck" at various locations. For coding simplicity and other conveniences, it would be nice to assign everything the common center x/y of the larger image, and simply offset the decals via their anchors.

However, if the usable area of the larger image is significantly greater than that of the smaller images, then offsetting the anchor of the smaller image by half its width/height won't be adequate.

Another use case would be to simplify certain types of large offset rotations that currently require creating a large group around the object to get an anchor where you need it. (or, just expose pushMatrix() rotate() translate() popMatrix() ... yeh right! :D)

I realize it might seem conceptually "weird" to imagine an "anchor" being located outside the bounds, but mathematically isn't it just an arbitrary "zero" from where the transform is applied? So, isn't this clamping an unnecessary restriction?

[edit: title should read "0..1", same question remains, thx]