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

Pages: [1] 2
1
NGUI 3 Support / Re: Is NGUI still actively supported?
« on: January 16, 2018, 10:14:31 AM »
Seems that NGUI is dead :(

I loved it, but there was only one minor fix update during the whole 2017.

2
I think that feature should be usefull. Don't know about others, but as we working in pixel art, its a common task for us - show a non-outlined icon in a outlined text field.

3
Developing another game on NGUI we're facing the same problem - we heavily use font effects (such as outline) and heavily use in-font icons. But when you use the outline, it applies to the icons too. Which looks pretty bad in most cases.



You see - all these black outlines on the circle icons.

Previously I had to duplicate the UILabel and make two of them - one with outline (for the text) and the other (overlapped) without the effect - for the icons.
But that feels pretty messy.

Now I'm sharing you the modification to NGUI we've made. It is not very elegant, but works. Maybe NGUI author would  think about including it to NGUI.

So, here we go:

1. Add "SymbolStyle.NoEffect" to the "SymbolStyle" enum
2. In NGUIText.Print() search for the line
  1. (symbolStyle == SymbolStyle.Colored)
and use the following code (it was around line #1507 for me):
  1. if (cols != null)
  2. {
  3.         if (symbolStyle == SymbolStyle.Colored)
  4.         {
  5.                 for (int b = 0; b < 4; ++b) cols.Add(gc);
  6.         }
  7.         else
  8.         {
  9.                 Color col = Color.white;
  10.                 if (symbolStyle == SymbolStyle.NoEffect)
  11.                 {
  12.                         col = new Color(1, 0, 1, 0);
  13.                 }
  14.                 else
  15.                 {
  16.                         col.a = gc.a;
  17.                 }
  18.                 for (int b = 0; b < 4; ++b) cols.Add(col);
  19.         }
  20. }
That puts a color of #FF00FF00 (transparent cyan) in the colors array in places where images are.

Now that fully transparent cyan will be passed to the outline creator that will make the outline color transparent. But at this moment, the color of images itself will became transparent too. So, finally, we need to replace #FF00FF00 to white after applying all shadows/outlines:

3. At UILabel.OnFill(), at the very end of the method, before this:
  1. if (onPostFill != null)
  2.     onPostFill(this, offset, verts, uvs, cols);
you should insert a replacing code (line #1948 for me):
  1. if (NGUIText.symbolStyle == NGUIText.SymbolStyle.NoEffect)
  2. {
  3.         for (int i = 0; i < cols.Count; i++)
  4.         {
  5.                 Color c = cols[i];
  6.                 if ((c.r == 1) && (c.g == 0) && (c.b == 1) && (c.a == 0))
  7.                 {
  8.                         cols[i] = Color.white;
  9.                 }
  10.         }
  11. }

And that's it.

The result will be:


4
NGUI 3 Support / Re: UILabel text wrap + BBCodes
« on: May 16, 2017, 06:36:21 AM »
Thanks!

5
NGUI 3 Support / Re: UILabel text wrap + BBCodes
« on: May 05, 2017, 05:25:20 AM »
Just made a new project and imported the latest version of NGUI.

Created a text field with text:
Quote
Some text goes here not[ff0000]wrappableshouldbe.



The result is:



My wish is that it should not be able to break the line after "not".

PS: I've imported a NGUIText.cs from some version one year old and it works just like I want:

6
NGUI 3 Support / UILabel text wrap + BBCodes
« on: May 04, 2017, 11:48:51 AM »
It seems that something was changed last year.

My problem is that NGUI's text wrapping algoryth now breaks lines in place of [ ]  bb-codes.

I'm using moving [00000000] to make a typewriter effect in a speech bubble, so the text field stays constant size.

Like that:

Quote
Some dialog line is pr[00000000]inting here...

The problem is that this text can be wrapped the following way:
Quote
Some dialog line is pr
inting here...

Which I don't need.

Is there any way to make a word "pr[00000000]inting" unbreakable during wrapping?


PS: I've used the same effect some time ago (a year or more) in the previous version of NGUI and that didn't occur.

7
NGUI 3 Support / NGUI BUG (+FIX): UIGrid + smooth animate
« on: February 21, 2017, 07:10:31 AM »
I've been experiensing some random bugs with UIGrid with "smooth animate" enabled when some items overlapped.

A digging through the NGUI code lead me to the reason.

So, I've found that there was a situation where the Spring component was disabled, but its target was very far from the real point of the object.

Then, I've discovered that somebody changed the spring's target after the initial setup.

And here's the code:

UIGrid.cs:414
  1.                                 SpringPosition sp = t.GetComponent<SpringPosition>();
  2.  
  3.  
  4.                                 if (sp != null)
  5.                                 {
  6.                                         sp.target.x -= fx;
  7.                                         sp.target.y -= fy;
  8.                                 }
  9.  

This piece of code changed the spring's target, but didn't force Spring to be enabled. So, if the Spring component was disabled by this time, nobody enabled it and it didn't move the item to the target point.

So, I needed to add something like:
  1.                                         sp.target.x -= fx;
  2.                                         sp.target.y -= fy;
  3.                                         sp.UpdateTarget();
  4.  

and also add a method to SpringPosition.cs:

  1.         public void UpdateTarget()
  2.         {
  3.                 mThreshold = 0f;
  4.                 enabled = true;
  5.         }
  6.  

Also, seems that UITable.cs : 277 will cause the same issue.

8
NGUI 3 Support / OnTooltip - sometimes doesn't work
« on: December 13, 2015, 04:09:53 PM »
We're making the game with NGUI for a year and updating NGUI for the last year, so that's not version-related.

The problem is that sometimes my tooltips don't appear. I need to mouseout and mouseover again to make them work. That happens vary rare (something like 1 time of 20), but annoying.

Don't know how to find that bug and isolate it. :(

9
NGUI 3 Support / Re: dynamic fonts disappearing in editor NGUI 3.9
« on: June 21, 2015, 08:14:46 AM »
Have the save issue when saving a scene and waiting for a fix, it is impossible to work :(

10
NGUI 3 Support / Re: Disabling DirectX 11 makes picture fuzzy
« on: December 20, 2014, 11:32:41 AM »
Thank you again! I've applied your code and atrefacts seem to be gone.

PS: the source code was UIPanel.cs, btw ;)

11
NGUI 3 Support / Re: Disabling DirectX 11 makes picture fuzzy
« on: December 19, 2014, 09:00:52 AM »
Thank you. I'll try to.

Yes, I want my 1x1 pixel on the art to be exactly 2x2 pixel on the screen. And to have no sprite breaks.

12
NGUI 3 Support / Re: Disabling DirectX 11 makes picture fuzzy
« on: December 18, 2014, 02:57:33 AM »
Then I don't understand  :(

So, I need my GUI to be excactly double-sized pixel-perfect in 1280x720 resolution. How do I make it? What settings should I set? Other resolutions don't matter.

13
NGUI 3 Support / Re: Disabling DirectX 11 makes picture fuzzy
« on: December 17, 2014, 12:13:38 PM »
I just did a test.

1. New scene.
2. ALT+SHIFT+S to create a sprite, set to tiled, overlay the whole screen. This also created the UI that defaulted to flexible style.
3. Double-checked the game window, made sure its using even dimensions (1600x900 in my case). Using odd dimensions that don't divide by two cleanly = problems.
4. Sprite is crisp.
5. Switched to DX11, hit Play to refresh. Sprite is still crisp.

I just did it too.

1. New scene, imported my GFX (in point filter mode) http://gyazo.com/c0028cd07f40de3490bf14d205f39bce
2. ALT+SHIFT+D (Unity 2D Sprite!!), set the sprite, clicked "Snap", no tiling
3. Used my dimension (1600x900 doesn't have a bug): game window 1280x720, flexible max/min height = 360 (exactly divided by 2)
4. Hit play, no problems
5. Switch DX11 off, hit play

problems:

http://gyazo.com/638734e18cc8a86dd4c9312f039f1f27

sprite settings: http://gyazo.com/f9b014f04ffdd2b855f23e7424ef6f29
sprite png itself: http://gyazo.com/0c9dcef2960d656e89e92022163215d5

14
NGUI 3 Support / Re: Disabling DirectX 11 makes picture fuzzy
« on: December 12, 2014, 03:32:54 AM »
Sorry for misunderstanding, but what's the solution?

I've tried to use Flexible or Constrained modes. The result is always the same when the screen resolution is 720 height and my GUI height is exactly 1/2 of it.

I thought I have a simple situation - I've got a GUI drawn in 640x360 and I want it to be exactly double-pixel in 1280x720.

The best solution I have for now is set constrained height mode with height = 18, and camera size = 20. In this mode I've got the minimum amount of artefacts, but still got some.

15
NGUI 3 Support / Re: Disabling DirectX 11 makes picture fuzzy
« on: December 10, 2014, 05:36:01 AM »
Pixel perfect means it corresponds to actual pixels on the screen 1:1. What you are trying to do is not pixel perfect by definition. I'm not sure what solution you are looking for here. As I mentioned, after changing from DX9 to DX11 and vice versa you need to actually hit Play for the changes to take effect properly.
I'm getting fuzzy pictures (as an image in the 1st post shows) in the described situation in DX9 mode. No matter - in editor, in play mode or in compiled .exe

Pages: [1] 2