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

Pages: 1 [2] 3 4
16
NGUI 3 Support / Render single sprite or even widget to RenderTexture
« on: November 23, 2015, 10:31:06 AM »
Good day!
How can i render widget with all children to RenderTexture with alpha?
What is the right approach? Icame with this two but i'm not sure which will work:
1) Create second UI camera and temporary change layer for widget (here comes the problem that layer name bouces back to UIpanels' layer name)
2) Move this widget on coordinates x1000000y1000000 and try to render region

17
NGUI 3 Support / Extending NGUI inspectors.
« on: October 27, 2015, 07:26:28 AM »
Good day, sir!
What is the best aproach to writing custom additional editor fields for NGUI widgets?
Our game is very "interfaces-heavy" and it is very hard to maintain styles across the whole project.
We want to create something like styles selector&editor for different NGUI objects. For example text size/color/fx. Sprites size/solor etc.
Like presets.

18
NGUI 3 Support / Re: UIPanel region animation possible bug.
« on: October 16, 2015, 08:36:30 AM »
We found ot that we can not set region of UI panel, because it is private field, NOT property.
So the setter is not called by Animator. Write a small component whith public Vector4 field for rect and set UIPanel properties on update.

19
NGUI 3 Support / UIPanel region animation possible bug.
« on: October 15, 2015, 10:35:49 AM »
If you have a UIPanel with texture/soft clipping — try to animate its region from
State 1: region is small and all panel content is culled/off panel.
to
State 2: region is fullscreen and all panel content is inside.

The result is: when you hit play - the region frame is animated properly (as seen in the editor) BUT all content does not become visible. It stays culled (

20
NGUI 3 Support / Problem with NGUI and standart Unity Animation pipeline
« on: October 15, 2015, 04:18:42 AM »
Hello!
We've noticed that when you create Animation for NGUI sprite there are no width and height property in the list so we ended in animating scale. There was an "aspect ratio" property available but since sprite is set to "free" aspect ratio- changing in does nothing.
So is there any way to animate width and height?

Thanks!

21
NGUI works with square sprites, so if you want something cut at an angle like that your best bet is to create a custom widget. Simply derive from UISprite and write your own custom OnFill function that will make it slanted the way you want.
We don't want to cut sprite with geometry, because we have non uniform tip.
As you see we have a mask there but dont get what is the right strategy.
What if we have this shape?

22
Good day!
Can you tell us the approach to do this type of progress bar? (notice state 0 and 1)


We can not use filled texture, because we want non-square fill tip while progress.
We have one big ui atlas (2k x 2k) with all the elements.
This atlas has a material/shader etc.
We think the right way is to mask progressbar fill somehow but it seems that we can't because all UI sprites is inside single atlas (single mat, single shader). And if we will have shader with mask support for that atlas it will mask all other elements besides progressbar fill.

23
NGUI 3 Support / Scale approach to cover ipad4 + iphone6 + iphone 4s
« on: March 16, 2015, 09:13:30 AM »
Hi guys!
What is the best approach to get best UI scale on iPhone6 (1920x1080 & 401 ppi) and iPhone 4S(960x640 & 326 ppi) + iPad4 (2048×1536 & 264 ppi)?
I want UI to be same physical scale on iPhone4S and iPhone6 BUT twice scale on iPad.
Can i somehow make a scales list and use appropriate on each device without rebuilding binary?

24
Ah! i see.. )

25
Fixed it adding condition to corners logic in UIBasicSprite.cs:


line 946:
  1. (y == 0 && bottomType == AdvancedType.Tiled) || (y == 2 && topType == AdvancedType.Tiled) ||
  2. (x == 0 && leftType == AdvancedType.Tiled) || (x == 2 && rightType == AdvancedType.Tiled))
  3.  

26
Here is the screenshot:


I need sides & center to be tiled, but corners disappear because of wrong geometry.
I've found there was a "fix"
"- FIX: Sliced sprite corners will no longer be drawn if sides were chosen to be hidden."
Somehow corners diappear when sides set to tiled.
Also i thiknk there shouldb a separate option for the corners.

27
NGUI 3 Support / Re: Feature request/suggestion: Auto 9-slice & Pipeline
« on: January 21, 2015, 08:36:27 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.
I dont think so.
First - it's a manual triggered operation, so if user does not want it it will be at the same speed.
Second - GetPixels32/SetPixels32, not ReadPixels should be used. http://docs.unity3d.com/ScriptReference/Texture2D.GetPixels32.html
And it's fast enough even for runtime usage. We've done in-game fingerpainting mechanics using it.

28
NGUI 3 Support / Feature request/suggestion: Auto 9-slice & Pipeline
« on: January 21, 2015, 03:53:52 AM »
Hi Aren!
We have a nice suggestion for NGUI! Here is the workflow that'll save hours of routine for GUI devs:
1) Designer prepares set of UI pngs
2) GUI dev opens NGUI Atlas Maker and adds them.

2.1.1) Atlas Maker checks if current image has android-style 9-patch "special marks" on the top and left (http://developer.android.com/tools/help/draw9patch.html)
2.1.2) If marks were found - Atlas Maker automatically shrinks current sprite to the minimal size before writing to atlas and writes default 9-slice guides positions for this sprite in Atlas metadata (or somewhere else)

2.2.1) If user clicks a button "Prepare for 9-slice" near sprite name in a list of sprites in the Atlas Maker before Atlas update the special window is shown.
2.2.2) In "Prepare for 9-slice" window user makes just one click - the approximate center of sprite. This step is needed because slice center not always is a sprite center (http://service.crazypanda.ru/v/clip2net/0/y/MGN1MRLgp9.png)
2.2.3) Le Auto-Shrink process! Script iterates through columns of pixels of the sprite to left and right from user defined "center" and checks if current column is the same like previous column. If columns are equal Script deletes it.
2.2.4) Same for sprite rows.
2.2.5) Atlas Maker writes default 9-slice guides positions for this sprite in Atlas metadata (or somewhere else)

This feature will save a tremendous amount of time for devs and designers.
The situation is that now we have 3 in-development mobile titles which are very heavy on UI: RPGs and MMO Strategy.
Now the pipeline we use is:
1) Designer draws a window with all possible states.
2) Designer exports all graphics using Adobe Generator to the set of PNGs
3) Designer imports all shrinkable graphics into... Fireworks! lol (this is THE ONLY tool that allows pixel based 9-slice scaling)
4) Designer tries to determine "where this f**n inner glow ends in this corner", draws a red vector lines and sets a 9-slice guides: (http://service.crazypanda.ru/v/clip2net/V/x/EbHhVj2Uab.png)
5) Designer shrinks panel to the minimal size (here comes another surprise! Fireworks can not do this pixel perfect...)
6) Designer saves two versions of sprite: "with red guides" suffixed with underscore (_) and "without red guides"
7) Developer imports panels with red guides to the NGUI Atlas.
8 ) Developer tries 3-4 times to set sprite 9-slice guides along with red line guides.
9) Developer updates sprite in the atlas maker with version with "no red lines"

As you see: this is a real hell :)

29
...you can specify the Alignment on the label explicitly. It's a settable field in inspector.
Forgot to mention by "align - center" i mean UILabel with resize freely should resize to the both sides when text changes. But if you move pivot to the top left the center-aligned text will resize only to the right side. So text alignment will be visible only for multiline textfields i guess

30
I've found another strange behaviour: the UILabel (pivot: top-left, text align: left, ResizeFreely, anchor: advanced-left-top to another UILabel with ResizeFreely) width will be wrong after i set a new text even if a call ProcessText() & ResetAndUpdateAnchors();
The right corners(top & bottom) will stay on prev positions while left corners will update and width will be incorrect.

Here is an example little bit tuned sources:
https://dl.dropbox.com/s/a3xr30fd9ht518j/NGUIAnchorsUILabel_Pack2.rar?dl=0

Found out if set MarkAsChanged(); tan CalculateBounds returns right size but width still remains wrong

Pages: 1 [2] 3 4