Author Topic: UIAnchor for relative positioned widgets in a 3D UI  (Read 6279 times)

franktinsley

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 17
    • View Profile
UIAnchor for relative positioned widgets in a 3D UI
« on: October 08, 2012, 03:41:28 PM »
I have a 3D UI setup so I can use slick 3D animations and everything was working great until I tried to get some relative positioning working. I can make it work no problem on a 2D UI but when I try to add it to a 3D UI I get a lot of weird results. Is there an example or tutorial somewhere showing both relative UI placement (i.e. buttons that stay near the corners of a screen when it changes aspect ration) AND a 3D UI? I can't seem to find how this is supposed to be setup.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAnchor for relative positioned widgets in a 3D UI
« Reply #1 on: October 08, 2012, 04:44:47 PM »
Why are you using anchors here to begin with? Just position your objects yourself like you would any other game object -- by moving them in the scene view.

franktinsley

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 17
    • View Profile
Re: UIAnchor for relative positioned widgets in a 3D UI
« Reply #2 on: October 08, 2012, 05:20:59 PM »
Well, as I understood it, UIAnchors were used to position objects relative to the screen or other things. Maybe they don't make sense in the context of a 3D UI?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAnchor for relative positioned widgets in a 3D UI
« Reply #3 on: October 09, 2012, 05:49:07 PM »
Don't use them on individual components. It's more for anchoring groups of wigets (think: parent game object).

franktinsley

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 17
    • View Profile
Re: UIAnchor for relative positioned widgets in a 3D UI
« Reply #4 on: October 10, 2012, 07:17:19 PM »
I figured out what I was doing wrong. I had anchors as children of panels. This appears to not be how they're intended to be used. Once I started animating my widgets differently to make them move together without keeping them in a single panel it all started to work. I've got 3D UI AND relative positioning! Yay!

mdeletrain

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 71
    • View Profile
Re: UIAnchor for relative positioned widgets in a 3D UI
« Reply #5 on: October 11, 2012, 04:48:05 AM »
Yes but you also got more draw calls...