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

Pages: [1] 2 3
1
Solved it! In case it would help anyone, this is the culprit line

  1. Color[] pix = src_tex2d.GetPixels(data.x, sourceAtlas.texture.height - data.y - data.height, data.width, data.height);
  2.                

But - why!? ArenMook, any comments?

2
Update. I have tried with the following code. But the result is the same: the sprites are mysteriously shifted by different Y value! And I have checked the data.x and data.y properties using debug, they're just fine. :(  >:(

  1. Texture2D src_tex2d = Instantiate(sourceTex) as Texture2D;//(sourceAtlas.texture as Texture2D);
  2. Color32[] srcTexture = src_tex2d.GetPixels32();
  3.  
  4. for (int i=0; i<spriteList.Count; i++) {
  5.            
  6.             UISpriteData data = spriteList[i];;
  7.        
  8.             Color32[] newPixels = new Color32[data.width * data.height];
  9.            
  10.             for (int y = 0; y < data.height; ++y)
  11.             {
  12.                 for (int x = 0; x < data.width; ++x)
  13.                 {
  14.                     int newIndex = y * data.width + x;
  15.                     int oldIndex = (data.y + y) * src_tex2d.width + (data.x + x);
  16.                     newPixels[newIndex] = srcTexture[oldIndex];
  17.                 }
  18.             }
  19.            
  20.             spriteTextures[i] = new Texture2D(data.width, data.height);
  21.    spriteTextures[i].SetPixels32(newPixels);
  22.             spriteTextures[i].Apply();
  23.  
  24. }
  25.    

3
Hi,

I have a bunch of textures within a UIAtlas. I need to "extract" those textures from the atlas (in runtime) and have each one applied to a UITexture for a specific purpose. Textures are RGBA32.

However when I do the copying, the resulting textures are strangely offset by some non-constant Y value (around 512 in some cases). It's clear that something goes wrong around the GetPixels phase.

This is how I do it:
  1.  
  2. List<UISpriteData> spriteList = sourceAtlas.spriteList;
  3. spriteTextures = new Texture2D[spriteList.Count];
  4.        
  5. Texture2D src_tex2d = Instantiate(sourceTex) as Texture2D;
  6.  
  7.                 for (int i=0; i<spriteList.Count; i++) {
  8.                        
  9.                         UISpriteData data = spriteList[i];
  10.                        
  11.                         Color[] pix = src_tex2d.GetPixels(data.x, data.y, data.width, data.height);
  12.                         spriteTextures[i] = new Texture2D(data.width, data.height);
  13.                        
  14.                         spriteTextures[i].SetPixels(pix);
  15.                         spriteTextures[i].Apply();
  16. }
  17.  
  18.  


Please help!!

4
NGUI 3 Support / UIButton.onClick GC / Performance issue
« on: August 17, 2016, 02:56:21 PM »
I'm experiencing abnormally high GC amount upon UIButton.onClick. The stuff is strange. It's clear that there is some logging activity going on (!?) Any ideas on how to disable it and what kind of logs could be those? Hoping to see a constructive reply! Thanks!


5
NGUI 3 Support / Re: Embed UISprite into UILabel as bbcode
« on: August 09, 2016, 03:53:50 AM »
Well thank you so much for another "blabla" reply. My question was exactly HOW TO ADD THE SPRITE FROM ANOTHER ATLAS. For gods sake I understand that there is no way to do it as of now. The question was, how to implement this.

In fact I just posted here to see how you are going to avoid the question again. The support for your product is non-existent. NGUI is not developing. No features are added despite hundreds of users requests. You do not seem to be a nice person at all. I never received a helpful reply on ANY question that I had.



6
NGUI 3 Support / Embed UISprite into UILabel as bbcode
« on: August 07, 2016, 12:57:58 PM »
Hi,

I need to embed a sprite from an existing atlas, into an UILabel string of characters (using atlased fonts), basically replacing one of the letters with a scaled sprite from other atlas (not the text one). These are not emoticons but in-game item images.

How could this be done?

7
NGUI 3 Support / UIButton EventDelegate list is empty
« on: May 15, 2016, 11:37:28 AM »
When I save a working UIButton into a prefab and then instantiate it during runtime in my game, the EventDelegate list (onClick) it was carrying goes empty and thus button doesn't do any actions.

Can you please share a bit of code for the recreation of the EventDelegate list with code after I instantiate it? For example, I need to execute SomeFunction() with SomeParameter that belongs to SomeScript on SomeGameObject.

Or maybe there is some other way to tackle this issue. Thank you!

8
Hi,

I'm still struggling with it.

In UIButton.cs, if I change "OnClick()" function with "OnPress()", it works but it sends out two events: one on touch down, and a second one on touch up.

I don't want anything to happen on touch up, just the touch down! How do I do it?

Also, is there an easy way to implement the long tap support into UIButton?

Thanks!


9
NGUI 3 Support / Re: UIProgressBar mip-map problem
« on: April 29, 2016, 01:55:39 AM »
I could make a circle in this specific case but I need to use long and beautiful progress bars in other cases, and I hate software limitations.

Finally you gave a good idea about that custom sprite renderer. However my qualification is far from being able to create such a class. Do you know where I can find a working example of a similar activity?

10
NGUI 3 Support / Re: UIProgressBar mip-map problem
« on: April 27, 2016, 08:59:36 AM »
No ArenMook, you're wrong. Your current implementation of UIProgressBar is conceptually incorrect, and useless in case of non-circular sprites.

When I use a "fill sprite" with fill direction=horizontal, it cuts off the unnecessary pixels without any artifacts you're referring to.

This is the method which should be used for a progress bar. You only need to add the end cap (specified as an extra sprite) to the inner part of the sprite that was cut. The end cap could be resized on really small slider values.

11
NGUI 3 Support / Re: UIProgressBar mip-map problem
« on: April 22, 2016, 06:25:38 AM »
I don't see a solution. What should I do to get rid of this obvious problem if I don't want to make a circular sprite? I followed your UIProgress tutorial precisely and this happens. I've checked the filtering, the problem happens both on Bilinear and Trilinear, any Aniso level, with no changes. I've seen the same bug more than a year ago on previous versions of NGUI and it is still here.

12
NGUI 3 Support / Re: UIProgressBar mip-map problem
« on: April 19, 2016, 04:26:18 PM »
I did define a border in the UIAtlas. The part between the "caps" gradually becomes blurred (with several iterations) as the slider value gets closer to zero.

Check out this GIF:

13
NGUI 3 Support / UIProgressBar mip-map problem
« on: April 19, 2016, 12:12:32 PM »
Hi all,

I'm using a Sliced sprite with UIProgressBar. Everything is pretty obvious but I see a major detail decrease (stepping) upon decreasing the values of the slider. I think it's corellated with mip levels but I'm not sure where and how to adjust them. I tried adjusting the atlas texture the progressbar sprite comes from, but nothing changes. It seems that it creates a new (?) texture for the sliced sprite and I need to adjust the mip/aniso (?) parameters of that new texture.

Thanks!

14
NGUI 3 Support / Re: Create Temporary UITexture Instead Of UISprite
« on: March 11, 2016, 02:31:34 PM »

Otherwise, your option is to use Texture2D's SetPixels and GetPixels and create a new texture from a "cutout" of the atlas. It will just be costly.

Are there any other options apart from Get/SetPixels?

Can you share some code that would accomplish the task this way? I understand it's costly, but I need to test this before trying out any other possibilities.

15
NGUI 3 Support / Re: Create Temporary UITexture Instead Of UISprite
« on: March 08, 2016, 03:43:30 PM »
I would really aprecciate some reply!

Pages: [1] 2 3