Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Fractalbase

Pages: [1] 2
1
NGUI 3 Documentation / Re: UILabel
« on: July 08, 2014, 07:03:29 AM »
To break lines (make multiple lines), all you have to do is insert a carriage return character : '\n'

2
NGUI 3 Documentation / Re: UIGrid
« on: June 30, 2014, 04:57:53 PM »
I haven't attempted this yet, but is nesting UIGrids possible/advised?

3
I figured out my issue.  Just use "UICamera.selectedObject", and Implement "OnEnabled()".

4
I've had trouble getting my screen with a grid of instantiated buttons to work with the selected item (of UIKeyNavigation).  I've somehow gotten that to work, but am not sure now.

My screens have transitions where to move from current menu to a sub menu:
        subMenu.SetActive(true);
        currentMenu.SetActive(false);

This works well and traverses to the sub menu.

On the menus, there is a back button.  Clicking the back button has an effect like this:
        superMenu.SetActive(true);
        currentMenu.SetActive(false);

The difficulty is, while the first encountering of a menu with a grid of instantiated items has the startSelected set and works, whenever returning to that menu, nothing is selected.

Any ideas why?

thanks,
fb



5
NGUI 3 Documentation / Re: UIKeyNavigation
« on: June 27, 2014, 04:44:02 PM »
Ok.  I have a Panel and Grid in my scene.  Using C#, I dynamically add a number of the same prefab to the Grid.  The prefab is a Sprite with a child Label.  The sprite in the prefab has a box collider, button, and key navigation.  When I instantiate the prefabs into the grid, I mark the first instantiated prefab's key navigation to have the "Start Selected" parameter set to true.

The issue is that none of the prefabs are selected by default.  up and down do nothing.  Once I click on the sprite/button with a mouse, then the up and down keys navigate through my buttons.

Am I missing something?

6
Typically, the main camera is positioned at (0, 0, z).  This draws graphics on the entire screen centered at the center of the screen.  I will like to render game graphics only in a subset of the screen, a rectangle.  Then I want the center of that rectangle to be aligned with the center of the camera.  Is there a simple way to accomplish that?

7
Is it possible to center the game graphics rendered to a particular rectangle in the game window?  For example, in the interior of a sprite?  And then what would be the method to clip game artwork outside of that rectangle (or depending on how the graphics is rendered, I might assume that I have to calculate clipping myself)?  Is there a better way to zoom in and out of the graphics (for a 2D game) then adjusting the z position coordinate of the main camera?

thanks,
fb

8
NGUI 3 Documentation / Re: UIScrollBar
« on: June 23, 2014, 11:12:03 PM »
I'm not able to get my slider to move from a mouse click.

I implemented the slider as such:
I added a sprite as the background.
I added a sprite as the foreground, with the parent being the background.
I added box colliders to both the foreground and the background.
I set the direction of the slider to "top to bottom" (because the scroll bar is vertical).
I updated my game script attached to a different sprite/label to take into account the ScrollBar.value.
Now, when I click play, the text that should be drawn in the sprite/label is drawn.
However, the scroll bar can't be moved.

Any ideas on what I'm missing?

9
NGUI 3 Documentation / Re: UISprite
« on: June 22, 2014, 10:16:52 AM »
Sorry for so many questions.  I've added game objects to my scene, and adjusted the hierarchy.  Now my sprites have position x&y values that are way far away (e.g., -20000).  I can't seem to changes these values.  What would cause that?  How can I fix that?

10
NGUI 3 Documentation / Re: UISprite
« on: June 21, 2014, 04:46:43 PM »
I want to create a UISprite, without the center filled, so that the center has specific dimensions.  What are the dimensions that the sprite should be in order for the center to have dimensions of say 192x192?  Also, is there a way to specify the color of the center (separate from the border)?

11
NGUI 3 Documentation / Re: UILabel
« on: June 21, 2014, 04:43:06 PM »
Regarding vertical alignment, I figured out the issue.  The Anchors of UILabel for "Bottom" and "Top" must be set to "Target's Bottom" and "Target's Top" (respectively) in order for the vertical alignment to work.

12
NGUI 3 Documentation / Re: UILabel
« on: June 21, 2014, 04:25:40 PM »
I've having an issue with the Overflow setting.  The default is shrink content.  I want clamp content.  However, only 1 line of all of the lines in the text are shown.  While the game is running, if I select either of the resize options, the setting goes back to shrink content, but all of the lines of text are properly displayed.  Any ideas?

13
NGUI 3 Documentation / Re: UILabel
« on: June 21, 2014, 06:47:01 AM »
Are you sure regarding changing the pivot?  I've altered the pivot to be top, then bottom, but the text is always aligned at the center (vertically).

14
Thanks, that is helpful!

15
NGUI 3 Documentation / Re: UILabel
« on: June 17, 2014, 06:37:33 PM »
Is there a way to set vertical alignment?  I've implemented a work-around where the text variable has several '\n' characters inserted, but I'd prefer a better solution.

Pages: [1] 2