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

Pages: [1] 2
1
NGUI 3 Support / Re: FinalAlpha of UI2DSprite in SoftClip Panel
« on: August 31, 2016, 04:35:51 AM »
Thanks, I finally decided to calculate the relation between widget's transform position and UIPanel's border, and set alpha according to that.

2
NGUI 3 Support / FinalAlpha of UI2DSprite in SoftClip Panel
« on: August 29, 2016, 03:41:23 AM »
Hello,

How can get an UI2DSprite's finalAlpha?
In my case, I add an addon mesh renderer for my GUI element, and want to sync the renderer's material's shader _Color.a with sprite's alpha, while UIPanel can not clip other renderers.

But I can only get finalApha=1, even if the sprite is soft clipped by UIPanel.

So how can I get that sprite's real final alpha?

3
NGUI 3 Support / How to make virtual gamepad-liked event system?
« on: July 01, 2014, 04:49:08 AM »
Think about a virtual four arrows gamepad on iphone, when users use this to control the characters to move.
They do not want to release their fingers, but just scroll on their screens.

But the OnPress or OnDrag event can not suit for this, while they all require users to release fingers to trigger OnPress(false) or OnDragEnd, or other buttons will not receive any event.
I know I can get the position of the touch, and check which button is there, but in such case the NGUI event make no sense.
Is there any way to do this within NGUI event system?

4
NGUI 3 Support / Re: Manually set scrollview restrict area?
« on: April 04, 2014, 12:48:40 AM »
any ideas?

5
NGUI 3 Support / Manually set scrollview restrict area?
« on: April 02, 2014, 02:22:49 AM »
ScrollView can detect its range, that's good. But sometimes we need a constant draggable area.

eg. Sometimes we do not want the scrollview to count some decorate sprites as its drag range, which is tweening scale or position at the side of the scroll view's panel. When player drag this view to the edge, restrict with panel will restrict to different position.This causes strange user experience.

Is there any way to change restrict way, like not restrict within panel, but a constant rectangle, or something like this?

6
NGUI 3 Support / Re: Nicki's Depth Management Tool
« on: March 21, 2014, 01:38:05 AM »
If a sprite is a component of it's UIPanel's gameobject (UIWidget and UIPanel is the same object), NGUITools.GetHierarchy(depths[d][iW].cachedGameObject).Remove will cause an outofindex error. Though it's not good to put UIPanel and UISprite on same object, you can add a length check for this string.

7
NGUI 3 Support / More effective widgets depth adjust tool needed
« on: March 19, 2014, 12:21:44 AM »
Hello, in my usage I really need a more effective depth adjust tool.

Think about a Panel with 20 widgets which range from depth 0-19.
If later on my artist tell me to insert a widget in the middle of them, I need to modify 10 widgets' depth, and then add a new one. Even more widgets need to modified if I have many decorate sprites with the same depth.

I know it's better to set the depth step a bigger number like 10, then 20 widgets range from 0-190, so I can insert the widget at somewhere like 95. But I think this will make the depth value a mess.

So I made a simple editor tool which add 1 depth to the selected widget hierarchy for my use, but its still better to have an official widget tool.
My suggest if to add a widget tool like panel tool, which has the overview of current panel's widgets, and can multi-select to modify them.

8
Yeah I've done that to fix this.

But I think leave the axis size to 0 or -1 to prevent from clipping sounds more reasonable than use a big number.
In previous versions UIPanel always behaves like this, which seems to use the axis's screen size instead.

9
Today I just upgraded to NGUI 3.5.3 from an early version of NGUI3.x, all things works fine except for my clipped panels.

I have many panels which only need to clip in one dimension(x or y), so the other dimension which do not need to be clipped remains zero value.

After upgraded, the widgets in this panel which "cross" the zero point are rendered normally.
But all other widgets which do not "cross" zero point is not rendered, and all interactions in this panel are disabled.

I'm wondering if the new version's panel design forced me to fill the exact clip range even for the dimension which do not clip, or it's just a bug?

10
NGUI 3 Support / Re: UIInput + Mac web player build issue
« on: February 26, 2014, 01:13:23 AM »
Some info here, if you use fullscreen on osxwebplayer, the input seems correct, including backspace, tab and all else except ESC for exit fullscreen mode.
But I even can not receive Input.GetKeyDown if not using fullscreen Mode, really sucks.

11
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: November 20, 2013, 11:40:13 PM »
For me, I would send a feature request for a image-ratio-button. Think about tabcontrol's tab button. In game, we often need a panel which has its tab control switch between different panels. The button in the tab control has five states instead of ImageButton's four, additional a selected state. The selected button will be stay on Selected State, while the ImageButton cannot do things like this.

And one more sliced sprite render option - allow the middle part not only stretch, but also tiled. This can be done by combine sliced sprite for head&tail and a tiled sprite for the middle, but I think it's more convenient to use just one sprite instead.

And about panel alpha - we usually need a function for a whole panel's fade in/out, but the nested child panel will not be affected by its parent UIPanel's alpha. I think child UIPanel's render alpha should be inherited from it's ancestor until the root. (eg. panel with alpha 1, a father panel(alpha 0.5), a grandfather panel(alpha 0.5) should result be rendered with alpha 0.5*0.5*1 = 0.25).

12
NGUI 3 Support / Re: UILabel Dynamic Font Reference in NGUI 3.x
« on: November 20, 2013, 01:44:51 AM »
OK I've figured out by myself. Just need to add an additional check in UILabel.bitmapFont property' SET.
If it's a replacement UIFont, just let this UILabel use it, even if the source is not a bitmap font.

BTW do you think this is an issue? Will this be included in next release? Or give UILabel a new font type selection named "reference"?

  1. if (mFont != value)
  2. {
  3. #if DYNAMIC_FONT
  4.         if (value != null && value.dynamicFont != null && value.replacement == null)
  5.         {
  6.                 trueTypeFont = value.dynamicFont;
  7.                 return;
  8.         }
  9. #endif
  10.         if (trueTypeFont != null) trueTypeFont = null;
  11.         else RemoveFromPanel();
  12.  
  13.         mFont = value;
  14.         MarkAsChanged();
  15. }
  16.  

13
NGUI 3 Support / UILabel Dynamic Font Reference in NGUI 3.x
« on: November 20, 2013, 12:11:37 AM »
Recently we began to make an iOS game which we need multi resolution for retina and normal.

UISprite has no problem with atlas reference. The problem comes down on UIFont.(Version 3.0.5)
I made two Dynamic Font(eg. size 16 and size 32 for retina) prefab, and made a reference UIFont prefab which I control by myself in runtime to switch between 16 size and 32 size UIFont.

But the new schema seems to put ttf file into UILabel's inspector directly while using dynamic font, instead of a UIFont prefab.
And when font type is bitmap, I drag my reference UIFont into inspector and nothing happens.

I know I can add a script for each UILabel component to change its font size at runtime or change them all on scene start.
But is there a way to use dynamic font reference? I think this is the most effective way for font size switch. Thanks!

ps. Thanks for mention me in UIFont.cs, very happy when I saw my ID, lol.

14
One more thing... in looking at the output from my previous screenshot, you'll see the baseline of the font seems off making look a bit like a ransom note. When I used this previously with BMFont (with only using the 'recommended' settings for NGUI) it looked correct. Do you know if there something else I can tweak to make this more even?
Oh I see that, like one pixel clip.
The char uv info is from UnityEngine.Font, there's not much we can done for this.
Font's texture's filter mode is unchangable either.
Only one thing - the font's importing settings has a Rendering Mode option. I tried OS Default, but the result is like shit.

15
some time, i meant this solution:in phone, some of the world cannot be printed.
Maybe When UIFont callback OnFontRebuilt() function,some labels were not be repaint in cellphone android environment.
Can you help me ?
ps:
   font.dynamicFont.textureRebuildCallback += OnFontRebuilt;
Sorry I do not own an android device, this package has not been tested on android.
Someone else can help?

Pages: [1] 2