Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Darkness on August 27, 2013, 07:28:45 PM
-
I'm not sure if I've set up my system properly, but I figured I'd see if I was at least on the right track and get some feedback on how to get what I need done.
I setup a draggable panel for my UI that I don't really want to be dragged. What I was mainly interested in was some kind of clipped plane that I could manually slide nested windows on and off. How can I manually move the plane with a keyboard (Tap a key and the next window slides in)? I'd also like to have a menu at the top of the screen with the names of the windows and clicking on the name will slide in the correct clipped plane.
I haven't found any tutorials about this, so I'm asking on the forum to see if I can get some information to get me in the right direction.
-
I assume by the lack of a response that this isn't possible? If that's the case, then what would be the best way to change the panel inside a window?
-
Just like you would move any other object. In your key handling function, TweenPosition of your windows.
-
Even if the windows are inside the grid? I guess the part I'm not sure about is if I want picture #2 of 5, how do I get it to be within the display box?
-
Grid repositions children when the script gets activated (or you ask it to reposition). After that's done you are free to move objects as you see fit. I am not sure what you mean by 2 of 5 and within the display box.
-
Well, in the grid there are 7 "blocks". Like in your example with the pieces of gear. Let's say you want piece of gear #4 to be displayed in the center. How would I display only that one? Or is it as simple and throwing a TweenPosition script on the main panel and just moving that around as I want? I tried that, but the contents of the panel kept being moved all over the world instead of in the bounding box. So I assume there's more to it.
-
Scroll Panels work by setting the localposition to X and the cliprange to -X, thus offsetting the clip view to be the same place on the screen. If you tween the panel somewhere, remember to counter tween the clip range.
When you have a grid, it's trivial to calculate the sizes, since the grid even exposes this (.gridSize or cellSize I don't remember the name).
Picture 2 of 5 means that your target position is cellsize*2 (onx or y depending on your active axis).
Nothin more to it.