Author Topic: Disabling Anchors on all components after initial update  (Read 2853 times)

hhappak

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Disabling Anchors on all components after initial update
« on: February 16, 2014, 07:33:19 AM »
Hi all,

I am developing an app for mobile devices. I however run into all sort of trouble when I am trying to animate panels that have Anchors on them. Since the app is only for mobile devices, I want a way to disable anchors once the app initially adjusted to the device's screen size. Is that possible?

If not, is there a way to disable anchors through script for specific objects?

I found UIWidget.setAnchor(), However when I try it, it tells me that no such method is in UIWidget. Is the documentation outdated there?
« Last Edit: February 16, 2014, 08:30:30 AM by hhappak »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disabling Anchors on all components after initial update
« Reply #1 on: February 17, 2014, 10:43:24 AM »
UIRect has the SetAnchor methods, which is a base class used by both widget and panel.

widget.SetAnchor((Transform)null); will effectively clear the anchoring.