Author Topic: HowTo add GameObjects and have them scaled automatically to fit UI  (Read 2452 times)

TiggersDaMan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
For the life of me, this seems like it should be simple, but I haven't been able to find the answer.

I am using NGUI extensively with many features, with one of them being a custom inventory system.

I want to instantiate, or add a child to the UI a 3D prefab of the inventory item and spin it, and just need way to have the items scaled automatically to fit the UI space. For example there's a huge size difference between a staff and a potion, so scaling is required. I prefer not to make yet another prefab of every inventory item just to fit in the UI.
Does anybody know a way this can be done?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: HowTo add GameObjects and have them scaled automatically to fit UI
« Reply #1 on: December 05, 2014, 12:59:58 AM »
You can adjusts the transform of any widget just like any other game object.