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 - genesys

Pages: [1]
1
I just upgraded our project from NGUI 3.5.4 to 3.5.8 through the asset store and now all of our menu screens are broken. They get anchored to UIRoot through code right after instanciating them with NGUITools, so they assume the size of the screen (minus some small, constant border). This worked well on 3.5.4 but now for some reason now the windows do not update when the UIRoot and Anchor values are set through code. If I change one of the Anchor values throug the editor while the game is running, the Widgets immediately pop to their correct size.

Is it necessary to call something now after setting Anchor parameters through code?

here's a screenshot of the inspector of the window, after it got instanciated. For some reasons it's only 2x2pixels in size (after changing one of the anchor values through code, the size changes to the expected size):

//edit: calling _widget.UpdateAnchors(); after setting the anchors through code does not solve the problem

2
NGUI 3 Support / Feature Request: Label overflow into other label
« on: March 19, 2014, 06:18:25 PM »
First, things first, thanks a lot for this great tool! It's a lot of fun to work with NGUI!

There is one issue I encountered now a few times - it's a bit difficult to layout dynamic text freely. It would be great if Labels would offer an overflow mode where text does not get clamped or shrinked, but the overflow can be directed into another Label - that way it'd be possible to design text areas which are not square.

Thanks for consideration!

3
NGUI 3 Support / How to subscribe method to UIButton notify?
« on: March 18, 2014, 07:52:55 PM »
How can I subscribe a callback method to the notification event of a UIButton, but not through the Editor but via scripting?

4
I have a Scrollview which is anchored to it's window, so it changes it's size. Inside the scrollview there is a grid which arranges the items that get (vertically) scrolled.

How can I make the individual items anchor to the left and the right of the scrollview, such that if the scrollview size changes, the width of the items changes too? If I enable anchor I must also select top and bottom anchors, but then the Grid functionality of arranging the items does not work anymore.

What's the correct way to do this?

5
NGUI 3 Support / how to have anchored sprite keep aspect ratio?
« on: March 16, 2014, 05:36:18 AM »
How can I achieve the following setup:


- Parent sprite that can get resized freely
   - child sprite that is located in the left side of it's parent, anchored to left border, top border and bottom border, but the right side of the sprite shall rescale such that the sprite always stays square
   - second child sprite that is to the right of the first child sprite, this one is anchored to right border, top border and bottom border of the parent, but it's left border shall scale such that it keeps the same distance from the first child

I hope the description is understandable, otherwise i'll create a graphic


6
If I create a sliced sprite, then it's corners/bordes will be always the same size in pixels and the center will stretch. But how can I have both, scale the corners/borders and still have the behaviour of a sliced sprite?

I am deploying my project for different mobile devices with various screen sizes and screen resolutions. Let's say I have a box with rounded corners which I want to fill the screen. If the rounded corners of my sprite graphic have a corner radius of 50, then the corner radius on screen will be also 50 if I use sliced sprite, independently whether that's a retina tablet or a very low res mobile phone. The result is that the size of the corners/borders in relation to screensize will be very small on the retina tablet and very big on the low res mobile phone.

What I want is to have a sliced sprite (so that it can properly adjust to different aspect ratios) but with a corner radius that is, let's say, 5% of vertical screen resolution.

How can I achieve this?

Pages: [1]