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 - r.pedra

Pages: 1 2 3 [4] 5 6 ... 9
46
NGUI 3 Support / Re: Bitmap Font + Prefab Problem
« on: February 04, 2015, 06:31:43 AM »
Another weird bug. If I close Unity or if I compile, the UIFont is totally fucked up, if I regenerate the font it works, but if I compile or close the editor, UIFont is again fucked up.

47
NGUI 3 Support / Re: Bitmap Font + Prefab Problem
« on: February 04, 2015, 05:55:10 AM »
Hi, we made a funny discover.
We are debugging UILabel.trueTypeFont and UILabel.bitmapFont at Start, and for UILabel already in the scene, trueTypeFont is NULL and bitmapFont is not.
But when we instantiate prefabs containing UILabel, trueTypeFont contains default Arial(that was the first settings of the UILabel, before we switched to bitmapFont), and bitmapFont contains our new bitmapFont.

Is that a normal behaviour?

EDIT:
We tried the following code:
  1. if(label.trueTypeFont != null && label.bitmapFont != null){
  2.                                 label.trueTypeFont = null;
  3.                                 label.SetDirty();
  4.                         }

But UILabel doesn't display anymore, and it says in Inspector that Font is empty even if label.bitmapFont is not empty.
We saw that when you set trueTypeFont to NULL it switches mFont to NULL, so we added label.bitmapFont = label.bitmapFont before SetDirty but it also doesn't work.

EDIT2:
We finally find a workaround.
Executing this on labels:
  1. if(label.trueTypeFont != null && label.bitmapFont != null){
  2.         label.bitmapFont = label.bitmapFont;
  3.         label.SetDirty();
  4. }

And deleting the condition in UILabel line 179

48
NGUI 3 Support / Re: Bitmap Font + Prefab Problem
« on: February 03, 2015, 12:06:42 PM »
I just tried to create a basic repro case but the problem doesn't occurs. But when I use all the prefab that have this problem in my other scene, the problem occurs.
It doesn't occurs if I delete some parts of the prefab. I need to investigate more.

49
NGUI 3 Support / Re: Bitmap Font + Prefab Problem
« on: February 03, 2015, 11:16:04 AM »
Aren, people trying to instantiate fonts really exists? I thought it was a legend  :P

Say I have a prefab structured with different GameObjects and Widgets.
Some of these Widgets are UILabel.
When I'm settings these UILabel, i give them UIFont(so bitmap), created from Font, and i have set their size to 40 in FontMaker.
At this time everything is correct in the UILabel, defaultSize is 40, and fontSize is 21 (because I needed 21 in this case).

I save my prefab.

Then I instantiate it at runtime, and SURPRISE, my label is displayed supersized, so I check the UILabel settings in Inspector and it says this :
fontSize: 21
defaultSize: 21

This is not even coherent with the size of the label displayed in the app.
So I entered a different number in fontSize in the editor, say 22.
The defaultSize changed immediatly to 40 and in the app, the label is displayed normally (not super sized anymore).

Do you understand? I can make screenshots if you want

50
NGUI 3 Support / Bitmap Font + Prefab Problem
« on: February 03, 2015, 10:36:52 AM »
Hi,
We have the last version of NGUI (just downloaded it).
We have created Bitmap Font from Unity font using Font Maker in size 40 (Arial Bold).
We are then using the font in many labels in the app, including in prefabs instantiated at runtime.
When we set the font in UILabel, it prints 21 as fontSize and 40 as defaultSize.
But when we instantiate the prefab, it prints 21 as fontSize and 21 as defaultSize but the font is displayed on screen at size 40.
If I change the fontSize in the editor just by one size during runtime, (say 22), defaultSize goes back to 40 and the label is displayed at the right size(22).

I tried to do a hack by doing label.fontSize = label.fontSize but your setter is checking if the fontSize changed, and I'm affraid of killing perfs if I change this behaviour.

Before we were using dynamic font but Dynamic Font Arial is very buggy on Android, so we changed all the labels using Arial and Dynamic Font by Bitmap but it's now worse than before with this bug.

Can you help us?

51
I know that UIStretch is deprecated but it's possible with it no? With FillKeepingRatio or FillInternalKeepingRatio it should work no?

52
NGUI 3 Support / Re: [Need Quick] Change a Labels Size via Script
« on: January 28, 2015, 07:56:27 AM »
You have property width and height.

53
NGUI 3 Support / Re: Trouble with TweenAlpha Duration Parameter
« on: January 28, 2015, 07:26:52 AM »
If you don't want it you can simply change it in UITweener.cs

54
NGUI 3 Support / Re: Trouble with TweenAlpha Duration Parameter
« on: January 28, 2015, 05:23:56 AM »
I think if you uncheck "Ignore timescale" on the tween object, it won't "jump" to the end.

55
NGUI 3 Support / Re: Render panel over 3d object?
« on: January 27, 2015, 06:43:05 AM »
You could have modified the RenderQueue of the 3D Object with a script to put in between your widget and the yellow rectangle.

For example if your panel have a starting renderqueue of 3000 (you can see it by clicking on the drawcall button on the panel), if your widget have a depth of 1 and the yellow rectangle a depth of 3, if you specify the RenderQueue of the 3D Object to 3002, it should be behind the yellow rectangle. We used it very often in our project to use Particles between widgets layers.

56
NGUI 3 Support / Re: Feature request/suggestion: Auto 9-slice & Pipeline
« on: January 21, 2015, 07:38:25 AM »
It's a good idea but I think it will increase a lot the import process in the atlas because ReadPixel of a texture is very slow.

57
NGUI 3 Support / Re: Custom folding tabs
« on: January 14, 2015, 10:34:45 AM »
Yes this is a script and you just enter Toggle in the search field of Unity

58
A quad is 4 vertices, r.pedra, not 5. That's why it's a "quad". Ie: "four". :P

Outline effect multiplies vertex count by 5. Shadow effect -- by 2. It's quite easy to hit the 65k vertex limit by abusing the outline effect. Also note that UIPanel has a "cull while dragging" option that will cull things that are not visible automatically.

Errrr my bad, I was very tired  :P

59
Each item around 150 labels, not many characters each (2-30chars).
Then around 120 uisprites that uses same atlas.

trying to optimize them but would really love a solution to hide each item when outside camera view.
Tried using this without success

widget.hideIfOffScreen = true;

Ok let's do some maths.
Each characters is a quad. You have around 15 chars on each labels, so 15x5 =75 vertices for each label.
You have for each item, 150 labels, so 150x75 = 11250 vertices on one item.
You have 40 items, so 40x11250= 450 000, it's almost 7 times the limit... (And I didn't take in count the UISprites...)

60
Wow you must have thousands of widgets to have too many vertices in one panel. If you consider a quad is 5 vertices, admitting you have only one widget on each object and the limit is 65000 vertices(I think this uses the same limit as Unity does on Meshes), you would have 13000 widgets. Even if you have 2 widgets for each objects it still 6500 objects in your panel.
What are you doing ? :o
If you need to have so much widgets in one panel, you should consider using UIWrapContent.

Pages: 1 2 3 [4] 5 6 ... 9