Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Jason on May 04, 2012, 05:01:21 PM
-
hi,
I am trying to set up a scrolling panel using the Clipping method.
To try it out, I attached a UIPanel to UIRoot. I then created two standard sized buttons. One is placed at the center of the screen and the other 200 pixels above it. Finally, I applied clipping in the UIPanel inspector.
I was able to show only the centered button by clipping, but only with Center (0, 0) and Size (2,2). If the Size deviation from 2, e.g. 2.01, it distorts and ruins the button. I tried to find the other button by adjusting Center.Y I haven't been able to find it.
Please let me know if I am missing anything. Thank!
Jason
-
Eh? If the other button was clipped, you won't see it visible until it comes into view. Furthermore, the size should remain at (1, 1, 1).
-
Well, i was talking about the parameters for Clipping. I thought it would be the center and width and height of the visible box in pixels. So, it looks like a 2 pixel by 2 pixel box enabled me to show my center button. Anything else fails to do that.
-
You might need to elaborate with pictures for me to understand what you mean. Panel's clipping rectangle is shown as a pink box.
-
ok. I attached three pictures.
Picture one shows that I have a brand new UI with two buttons, one centered and the other moved up by 200 pixels. I have a clipping area centered at (0, 0) and sized (200, 100). The pink box encloses the center button.
Picture two is a screenshot during gameplay at the above settings. The center button is a blur.
Picture three shows what happens when I change the clipping area size to (2,2). The center button is displayed normally.
I am using a Macbook Pro running Unity 3.4.2 and the latest NGUI release.
-
picture 2
-
picture 3
-
Actually you're not using the latest version of NGUI. Youre panel is missing some settings. Something is also wrong with your button to begin with... even in the first screenshot it looks garbled. Is the atlas using the Unlit/Transparent Colored shader?
-
You are right. I should have updated more often, knowing how active NGUI is being developed :)
Now I have the Static option for my panel, but I still have the same problem as before.
I created the buttons using the SciFi Atlas and Fonts.
-
Take a picture of the button settings and throw in here, makes it a lot easier to debug. :)
-
ok, here are the settings for the buttons.
-
And here are the settings for the background sprite.
-
Everything looks fine to me, except one thing...
Your readme states it's version 1.83, which is quite old. Please update to the latest.
-
I was afraid to remove the NGUI/ folder entirely for fear of breaking everything. I always overwrite my files when I updated. The Readme file is funny. Its name stays the same but its content gets changed.
Any way, I just deleted NGUI/ and reinstalled it. I created a new scene, new panel, two buttons, move one up, and apply clipping. Somehow I have to set the clipping size to (2, 2).
Sorry for being a pain in the butt, but here is another screenshot. This time in edit mode. The clipping box is so small you can't even see it.
-
Well, the size of your clipping box is smaller than the size of the soft border, so it's not working right to begin with. The size of your clipping area must be at least double the size of your border, so if you use a 40x40 border (which is quite thick by the way), you need to have at least a 80x80 area. I generally leave the border at 10 pixels.
-
And if I set the clipping size to (200, 100), the box looks right, but the button is a blur.
-
Although you've mentioned that your clipping area was 200x100, which should be fine.
-
The button isn't a blur in that screenshot. Its geometry seems just wrong.
-
Occam's Razor...
Your target is Android. Are you sure you don't have GLES 1.1 emulation enabled?
GLES 1.1 = no shader support, clipping doesn't work.
(it's in the FAQ btw...)
-
My bad! I knew you would figure it out ... ;D