TitledAnd copy
- Yea.
- These are fun
Yes, you set it on the UIInput instead.
Overflow handling lets you determine what happens when the label's text exceeds the allowed space.Under what conditions? I've got a bunch of widgets here which seem to partially apply the setting when I select "Resize Height" but then snap back to ShrinkContent.
Intentional. Widget's color tint affects everything. Do something like this instead now:
label.text = "[000000]Black [ff0000]Red";
Has this changed recently? I've used it quite a bit in 2.7 (etc), but can't get it to work in the latest version. The tag just gets ignored and the text remains white.
This hasn't changed since early 3.0.X. Tint color is multiplied with the embedded color, but if the tint color is white like you mentioned, then tags should work as expected with or without the terminator ([-]).
Assuming the label has "BBCode" enabled.
Chat input script purposely strips the color tags. Line 44 of ChatInput.cs.
Yes, ChatInput: http://www.tasharen.com/ngui/docs/class_chat_input.html
That's what the chat window uses to submit text.
Steps to repro?
@stevej: I am not seeing any issues:
1. New Scene.
2. ALT+SHIFT+L
3. Chose "Arimo20" font.
4. Entered "New [99ff00]Label" as text. "New" is white, "Label" is green.
Check the shader used by your atlas. It needs to be Unlit/Transparent Colored.
UILabel.ambigiousFont = yourFont;
NGUIText.PrintCharacterPositions can be used to determine the positions of all characters. You can use it to position your sprite. Just don't forget to call label.UpdateNGUIText() prior to calling that function.
BBcode style:
[b]bold[/b]
[i]italic[/i]
[u]underline[/u][s]strikethrough[/s]
...etc. Look inside NGUIText.ParseSymbol.
The dimensions of the window need to be dividable by two. Meaning if your window is something like 479x500, then the width part of is is not dividable by 2, resulting in a blurred UI.
And yes, the crisp option is only for dynamic fonts.
TTF is TrueType Font. TTF and OTF files are both imported by Unity as Fonts, and yes you can use them as dynamic fonts for labels. Just keep in mind there are a lot of issues with dynamic fonts, and I don't advise using them. Stick to bitmap fonts by creating one via the NGUI's Font Maker.
if (dynamicFont.GetCharacterInfo ((char) ch, out mTempChar, Mathf.RoundToInt (finalSize * screenMultiplier), fontStyle))
float pd = fontScale * pixelDensity / screenMultiplier;
float y0 = mTempChar.vert.yMax;
float y1 = mTempChar.vert.yMin;
baseline = Mathf.Round (y0 + (finalSize - y0 + y1) * 0.5f * screenMultiplier);
glyph.v0.y = (mTempChar.vert.yMax - baseline) * screenMultiplier;
glyph.v0.y = (mTempChar.vert.yMax - baseline) * screenMultiplier;
glyph.v1.y = (glyph.v0.y - mTempChar.vert.height) / screenMultiplier;
if (rt != null) NGUIText.pixelDensity = (rt != null) ? 1f / screenMultiplier : 1f;
I would love to have a bbcode-like tag like so:
label.text = "I'm a text with [size=+10] big parts[/size] and [size=-10] small parts[/size] and a [size=14]absolute sized part[/size]"
To generate a single label with multiple sizes
I'm a text with big parts and small parts and an absolute sized part.
Since designers tend to want that and right now I have to create multiple UILabels and align them and all sorts of shenanigans to fill out each individual label with data.
I second this. Designers sure can get sad when you deny them this... :)