Author Topic: NGUI put the furniture randomly in the room  (Read 2009 times)

sunstar

  • Guest
NGUI put the furniture randomly in the room
« on: April 01, 2013, 01:56:36 AM »
I have used NGUI for about 8 months, I know that I can't put one altas's sprite between two sprites of another altas.

Now I have a problem.
I want to put the furniture randomly in the room, in order to put them randomly, I have to draw every sprite in a UIPanel?
this will add many drawcalls, It will be the same without using the altas ...

What should I do? Thanks for any solutions.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI put the furniture randomly in the room
« Reply #1 on: April 01, 2013, 03:55:44 PM »


If each piece of furniture is a sprite, you can put them all in there. If some are in "chairs atlas" while other are in "table atlas", then you can't have them ordered so a table is under a chair which is under another table.

You don't have to make a UIPanel for each sprite, but if you define some layers you can have a UIPanel for each layer - let's say for instance

* Background layer
* Furniture layer
* Overlay layer

I'm just doing guesswork as to what your problem is really though. How are you furniture-sprites put together? How many atlases do you use etc.