Author Topic: Sprite anchor problem on multiple uiroots  (Read 1793 times)

viqtor

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Sprite anchor problem on multiple uiroots
« on: September 11, 2014, 04:28:00 AM »
When I use in a scene more that one UIRoot, all the anchors from sprites stop working and behave strange. Is it a known bug? What should I do? I use the last version of NGui, and before I didn't had this problem.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sprite anchor problem on multiple uiroots
« Reply #1 on: September 12, 2014, 03:47:37 AM »
More than one UIRoot implies two different UI systems, so you need to place each one on a different layer.

graeme.scott

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Sprite anchor problem on multiple uiroots
« Reply #2 on: October 07, 2014, 02:01:13 AM »
Hi,

I am having the same problem here (or the effect seems the same), and using different layers is not really an option.

What I am trying to do is cross fade two scenes the current and the newly (additive loaded scene)... The type of transition could get more complicated assuming I can find a way around the rendering problem.

I say using layers is not an option since I have potentially a lot of these screens and having a layer per screen would not work...

I get a rendering artefact in my case once I remove the old scene (DestroyObject), what I have found is that once it goes wrong, if I disable/enable (from the inspector) the root then things go back to normal..

In my case I don't need to have these active at the same time (aside from the transitioning), is there some way I can achieve the transition I am after an play nice with nGUI. Maybe force an update after the transition is finished???

Cheers
Graeme

bac9

  • Full Member
  • ***
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 113
    • View Profile
Re: Sprite anchor problem on multiple uiroots
« Reply #3 on: October 07, 2014, 06:42:29 AM »
I assume you are separating parts of UI like windows into separate scenes and separate UIRoots? It's not really necessary, windows can be simply separated using UIPanels, and generally it's worth keeping UI scene independent. I have some situations where I need to pick up some part of UI from a scene, though, and in that case I simply keep track of what I'm adding and parent the found panel to already existing singular UIRoot.