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

Pages: [1]
1
So I have to add spaces to my font, correct?

I added the space to the font and it now works. Thanks for the help.

2
NGUI 3 Support / UILabel: Shrink content with a font with no spaces
« on: June 01, 2015, 08:39:43 AM »
Hi,

I have a UILabel with a custom font with only 2 "characters" (2 type of stars) that are mapped to a and b. I have no spaces in my font.
I use the UILabel Shrink Content so that it always fits a certain width. The shrinking works, but it does not use multiple lines, it shrinks so it fits on one line.
Is there a way to make it split? I tried to just add spaces between the a's and b's but that does not work.

Font:
info face="StarFont" size=22 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=0,0
common lineHeight=128 base=22 scaleW=256 scaleH=128 pages=1 packed=0
page id=0
chars count=2

char id=97 x=0 y=0 width=128 height=128 xoffset=0 yoffset=0 xadvance=128 page=0 chnl=0
char id=98 x=128 y=0 width=128 height=128 xoffset=0 yoffset=0 xadvance=128 page=0 chnl=0

Screens:
http://gyazo.com/c203050083819d178dc7e1fc45dbc2fa
http://gyazo.com/4797bbf121fd62d86e2a99cc6fffc950
http://gyazo.com/18c43a6b79e7db3b9e1a917727c6479d

3
NGUI 3 Support / Re: Calculate text width for a label
« on: October 14, 2014, 02:23:19 AM »
My label was on resize freely prior the call to UpdateNGUIText.

I used the code you supplied in your last post, works like a charm.
Thanks for your help.

4
NGUI 3 Support / Re: Calculate text width for a label
« on: October 09, 2014, 05:56:52 AM »
When I put it on freely resize it says it is 270 wide, while it clearly is way more then 650.

5
NGUI 3 Support / Re: Calculate text width for a label
« on: October 08, 2014, 07:03:23 AM »
It does some weird things on my end.

My label has a width of 650 and has shrinkContent when I have a string which is clearly larger than the label can contain without resizing, it gives me a x value of 642.
If I put my label on clamp it does the same, and when I put it on resize freely it says it is 270.

Am I missing something?

6
NGUI 3 Support / Calculate text width for a label
« on: October 07, 2014, 08:46:03 AM »
Hi,

Is there a way to know what a length will be of a string (based on settings of a label)?

I want to know before I assign text to a label if it will fit inside the label (with a max width).
Something like:

   if(myLabel.TextWidth(myText) > myLabel.width) do something with myText;

7
NGUI 3 Support / Re: Filled tiled sprite
« on: April 28, 2014, 07:07:42 AM »
Advanced only has Invisible, Tiled or Sliced. But not filled.

Nevermind, just had to use a slider.
But thanks for the reply :)

8
NGUI 3 Support / Filled tiled sprite
« on: April 25, 2014, 09:14:53 AM »
Is there a way to make a filled sprite with a tiled image? I watched the video of making a sliced tiled sprite, but cannot think of a way to use a similar method for creating a filled tiled sprite.
At this moment I just change the dimensions accordingly but since this is an int it is not smoothly animated like the filled sprite's float value.

9
NGUI 3 Support / Re: UITween bug after update to 3.0.8
« on: January 10, 2014, 11:27:12 AM »
The tween script is disabled at start and only gets enabled through code. The object is a prefab and is added to a UIGrid through code. And when clicked on the sprite it is faded in.

Did not test it yet in a fresh scene (have had no time yet). Will test it in a new scene once I got the time.

10
NGUI 3 Support / UITween bug after update to 3.0.8
« on: January 07, 2014, 02:24:43 PM »
I have a UISprite which has an initial alpha value of 0. And on that sprite I have a Alpha Tween from 0 to 1. After I updated to 3.0.8 it stopped working. If I manually set the alpha while running it works. But if i play the tween in reverse so that the alpha becomes 0 again, and then play the tween forward again it does not work anymore.

Calling MarkAsChanged, MarkParentAsChanged or Refresh (on the panel) does not work either. Is this a bug from the performance update? Or do I have to do something extra?

11
NGUI 3 Support / UIDraggablePanel Disable Drag If Fits not working
« on: March 27, 2013, 09:36:20 AM »
I have a typical scroll view layout. I populate the grid dynamically at runtime.
On my draggable panel I have Disable Drag If Fits turned on.
When I fill my grid and it does fit then I cannot scroll just like I want. And when I fill my grid with more item then it can show, I can drag my panel.
But when I first load a lot of items scroll through the list and then repopulate the grid with a few items so that it fits in the panel I can still drag until I release my first drag.

This is what happens on populate:
  1.     //Clear current items.
  2.     ClearGrid();
  3.                
  4.     yield return new WaitForEndOfFrame();
  5.                
  6.     foreach (UserLevelInfo levelInfo in _userLevelItems.Where(predicate))
  7.     {
  8.         GameObject go = Instantiate(UserLevelItemPrefab) as GameObject;
  9.  
  10.         Transform itemTrans = item.transform;
  11.         itemTrans.parent = _gridTransform;
  12.         itemTrans.localScale = Vector3.one;
  13.         itemTrans.localPosition = Vector3.zero;
  14.     }
  15.  
  16.     //Reposition the grid elements.
  17.     GridList.Reposition();
  18.                
  19.     yield return new WaitForEndOfFrame();
  20.  
  21.     //Recalculate clipping.
  22.     _dragPanel.ResetPosition();
  23.  

I have tried to mess with SetDragAmount, but didn't help.
The problem only happens when I have scrolled before I repopulate the grid to fewer items.

Does anyone have a suggestion?

Pages: [1]