Author Topic: Instantiate panel in free space on screen  (Read 1990 times)

ozil

  • Guest
Instantiate panel in free space on screen
« on: July 20, 2013, 06:12:24 AM »
Hi guys,

I have a panel which i want to instantiate on screen. On default first panel should spawn on center of the screen and every next one on avaliable free space.
I dont have idea how to do it. Maybe some help?
« Last Edit: July 20, 2013, 06:29:45 AM by ozil »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Instantiate panel in free space on screen
« Reply #1 on: July 21, 2013, 02:54:42 AM »
This is sort of a hard question to help you with as it's more of a general programming problem. You have to set up some parameters by which you determine the position and size of your panel and spawn it there.

Your problem specification is too vague to give you any specifics on - do be aware that what NGUI calls UIPanel is not a "panel" in the sense that it's a window, like in windows. It's only a meta-object that draws Widgets (sprites, labels). A collection of sprites can make up a window, and you know the sizes of your sprites, so that way you can determine where you want to put your given windows.

Does that help you?