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

Pages: [1]
1
NGUI 3 Support / Re: Dynamic font always in front
« on: November 30, 2013, 05:23:00 AM »
Which version did you update from? This particular behaviour hasn't changed since 3.0.2 I think. NGUI stuff will appear on top if your shaders don't write to depth. So for example if your wall is drawn using a transparent shader, then NGUI will show up on top of it. What shader are they using?

You mean what shader is the dynamic font using?
The is the default shader if you import a ttf font in unity: GUI/Text Shader

But I can't (or don't know how to) change this shader.... :-\

UPDATE: I've got it working! I used the Dynamic Arial font. Created a new material with the Unlit/Text shader and the texture in the imported ttf font and added the material to the UILabel scripts (one by one).
Now its working the way I want it to work :-)

2
NGUI 3 Support / Re: Dynamic font always in front
« on: November 29, 2013, 02:43:25 PM »
The way NGUI draws things is by placing them on depth of 3000 and higher. So if you happen to draw a transparent object with the UI camera, its placement is going to be undetermined. You shouldn't be drawing non-UI objects with your UI camera. If you do, make sure they are using a shader that's using a higher render queue. Can I ask what you're trying to do with your UI there, and why you have that image drawn without using UITexture to do so?

I don't think I understand. I have a monitor in my scene and I'm using NGUI for the 'screens' on that monitor.
So I added a UICamera script to my main camera (just as you suggested when I bought NGUI a couple of month ago).

This is the structure of the monitor:
- GameObject monitor
   - UIRoot
      - UIPanel
         - Empty GameObject
             - UIButton
                - UISprite
                - UILabel
             - UIButton
                - UISprite
                - UILabel

etc.

The UILabel has a Dynamic font (Arial).
This worked fine until now. I've updated to 3.0.6f6 and now only the dynamic fonts are in front of everything else.
I don't have any transparent objects in front of the monitor in the scene.

But if I understand you correctly I can't do this setup anymore? Or is the Dynamic font the only problem in this setup?


3
NGUI 3 Support / Re: Dynamic font always in front
« on: November 29, 2013, 02:26:34 AM »
Check the shader used by the dynamic font. Did you specify some custom one or did you move the shaders that come with NGUI from their original location in the Resources folder?

I didn't do anything with the shaders. I just imported NGUI and selected Arial as Dynamic font (it was already available).

Update:
To be sure I added the Arial.ttf to Unity to see if this makes any difference, but the result is the same. Also I've tried another font but is didn't matter.
The shader it uses is GUI/Text Shader

4
NGUI 3 Support / Re: Dynamic font always in front
« on: November 28, 2013, 10:23:42 AM »
Camera rendering order?

Check the 'Depth' component on the standard Unity Camera class. Perhaps your UI camera should be set to a lower depth than the camera rendering your 3D world.

I've tried to change that but nothing happened. Also keep in mind that only the dynamic font text is in front. The rest of the NGUI elements are in the right depth (see screenshot of the butten background sprites).

5
NGUI 3 Support / Dynamic font always in front
« on: November 28, 2013, 09:05:25 AM »
Hi,
I don't if it's a bug in the latest version but I use dynamic fonts for labels and it appears always in front.
I've added 2 screenshots to make it clear.

What is going wrong here?

6
NGUI 3 Support / Re: Set UISprite color not working with custom colors
« on: October 31, 2013, 02:44:48 AM »
If I´m not mistaken colors are a floating value between 0 - 1 so 93f gets capped to 1.0

Thanks! That was the problem :)

Tip:
I found out that if you want to use byte codes voor colors you can use Color32. For example:
new Color32(93, 106, 114, 255)

7
NGUI 3 Support / Set UISprite color not working with custom colors
« on: October 31, 2013, 02:24:57 AM »
Hi,

I'm trying to set the background color of a button in script (c#)
When I'm using:
_background.color = Color.black; //(_background is a UISprite instance)
It works fine.

But when I try this:
_background.color = new Color(93f, 106f, 114f); //(_background is a UISprite instance)
Nothing happens....

Is this a bug or do I do something wrong here?

8
NGUI 3 Support / Re: Problem using GUI in 3D
« on: August 26, 2013, 12:28:20 AM »
Thanks, I will look into it.

Update: I think you mean the Depth (z-axis) FAQ's but I don't know that was the problem.
Eventually I recreated the widgets and now it looks like it's working.

9
NGUI 3 Support / Problem using GUI in 3D
« on: August 23, 2013, 09:29:31 AM »
I'm creating a computer screen using NGUI (simulation software).

- I attached UICamera script to the main camera
- on my screen plane I created an empty gameobject (as a child) and added UIRoot script 
- and as a child of the UIRoot I added a Panel with widgets etc. (see: structuur.png)

Everything works fine till I tilt the camera up a bit (almost perpendicular to the screen).
See: 1.jpg and 2.jpg attachements.
Then the GUI disappears!

When I keep the camera in the same angle but move it back from the computer screen a bit.
The GUI reappears. (see: 3.jpg)

Does someone has a clue on how to fix this?

Pages: [1]