Author Topic: chagning the pivot of UI button  (Read 4649 times)

sk1989

  • Guest
chagning the pivot of UI button
« on: October 01, 2012, 10:46:11 AM »
I want to know if there is a way to change the pivot of a UIbutton. I saw UIwidget.pivot that does that but from script documentation, it looks like it only works for UILabels and UITextures.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: chagning the pivot of UI button
« Reply #1 on: October 01, 2012, 02:37:24 PM »
If you mean change the pivot of the collider, then no, you can't do that - but you can set the collider position/size entirely yourself, so you can build a system that uses the Widget's sizes like UIAnchor.

MGB

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: changing the pivot of UI button
« Reply #2 on: November 26, 2012, 05:00:35 AM »
So there's no way of changing a button's pivot automatically?  I need to set the label pivot then manually adjust the collider?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: chagning the pivot of UI button
« Reply #3 on: November 26, 2012, 04:10:50 PM »
A button is a collection of scripts -- a background sliced sprite, a label, and possibly a couple of others. If you want to change a pivot of it, simply add a parent game object that's in the position of where you want your pivot to be, and use it instead of the button.