Author Topic: Is there a way to use anchors to rotate an object?  (Read 1265 times)

bac9

  • Full Member
  • ***
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 113
    • View Profile
Is there a way to use anchors to rotate an object?
« on: March 26, 2014, 05:18:40 AM »
I'm wondering if it's possible to use NGUI anchor system not just for horizontal/vertical alignment of elements but also to rotate something. Let's say I have a rectangle-based line with 4px Y size (height) and variable X size (length) that I want to always have attached to a corner of one object and stretched to a corner of another object, even if those corners are not horizontally aligned.

I would guess it's not possible using only the anchors and I'm better off just writing a bit of custom code doing the rotation and X scaling? Something similar to widespread "look at" implementations, with me leaving anchors to handle just the origin point of that line and nothing else, I guess?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is there a way to use anchors to rotate an object?
« Reply #1 on: March 26, 2014, 07:28:03 PM »
No, the anchor system is not designed with that in mind. Custom code is the way to go here.