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 - Sigh@iCreate

Pages: [1]
1
NGUI 3 Support / Re: UICenter on Child... odd jump/snap?
« on: November 13, 2013, 05:11:09 AM »
Hi Aren

Just checked, I was using an older version, but I have updated to 3.0.5.
The problem still persists, though I have yet to make any other changes. I will look into it, thanks for suggesting that line of code. I will look into it and report any findings.

Thanks again.

Sigh

2
NGUI 3 Support / Re: UICenter on Child... odd jump/snap?
« on: November 12, 2013, 05:27:20 AM »
Hey thanks for getting back to me.

I will look into what you suggest.

I also look forward to the changes. Thanks again for your time.

Sigh


Edit: Hey if you get more time to look at this id appreciate it. If not, thanks for your time anyway.

I am a little unsure how to explain the issue in more detail. But ill give it a shot.

Essentially think of the scroll-view example on a much larger scale I guess, where the individual items are almost full screen pages. Therefore the grid cell width is a full screen width.

From the testing I just did in a new scene, the problem is not apparent at lower grid cell widths and becomes progressively worse the higher the cell width... For example on cell widths less than 400 its unnoticeable, but beyond...

The problem effectively is that the new child to center on, moves towards the center of the panel smoothly, but once it hits a certain point (which is near the center, but not quite), it just jumps to the center, creating a jerk like effect at the end.
Thanks, if nothing comes to mind dont worry. I am also aware that this is perhaps not designed for this kind of use, most examples I see, seem to be for the use in 'shops' and item selection etc.
I just felt this seemed like an easy way to have sliding screens. 

3
NGUI 3 Support / Re: UICenter on Child... odd jump/snap?
« on: November 11, 2013, 05:59:16 AM »
I am still having problems with this, I have looked at the NGUI example, which doesnt appear to have the same problem, I changed my settings to match (in the sense that the strength and such were the same) but I still have that odd jump.
Thanks again for any time given. 

4
NGUI 3 Support / UICenter on Child... odd jump/snap?
« on: November 07, 2013, 07:23:42 AM »
Hi Guys

I am a little stuck over an issue im having with the UICenter on child feature.

Here is what I have:
- Panel with Draggable Panel
    - Grid (has grid script and centre on child)
       - Information Pages (contain textures and buttons, and draggable contents script) x4

Now the problem im having is that when I drag a new information page in (think of dragging a full screen across on an ipad), it comes in smoothly, and then when the image gets fully into the scene (the image is a little smaller than fullscreen), it jumps to the center of the screen.

The amount it jumps/snaps seems to be the equivalent of the gap that is around my texture on the x axis? So for example my screen resolution is 1024x768 and my texture is 940x700.

so to clarify once my image is fully in the scene (the back edge of the image is flush with the edge of the screen), it snaps to the center so that the gap around the edge is visible.

I cant seem to get my head around why this is, but I have a feeling it is to do with the size of my panels?

Thanks for any help anyone can provide.

Also let me know if more information would help?

Thanks

Sigh

Thought some images may help to clarify even more.
here is the first, the image is coming in from the left, and it travels smoothly until it reaches this point:


Then what it looks like after it snaps:



5
NGUI 3 Support / Re: Sprite.inner /.outer replacement?
« on: October 22, 2013, 03:16:52 AM »
Hey ArenMook, thank you very much for getting back to me so quick.

I looked through your code and saw the changes which you mentioned, but having never used pixel coordinates for textures up until now, so that is mainly what I was asking about. (edit at bottom of my post).

I have converted the texcoords returned by packtextures to pixelcoords and I have it working now.

Thanks again for your help and time!

6
NGUI 3 Support / Sprite.inner /.outer replacement?
« on: October 21, 2013, 09:30:36 AM »
Hi guys, dont know if I can get much help on this, but I am a little stuck and I cant figure this out.

I got code quite similar to this a while back from these forums and it is used to create a new atlas for use on ngui buttons.

Prior to updating, the code below worked fine, but since updating I am getting errors.
I have pasted the code and the error areas are commented.

  1. private void CreateAtlas()
  2.         {
  3.                 atlasTexture = new Texture2D(1, 1);
  4.                 spriteCoordInfo = atlasTexture.PackTextures(textureArray, 0);
  5.                
  6.                 atlasMat = new Material(Shader.Find("Unlit/Transparent Colored"));
  7.                 atlasMat.SetTexture("_MainTex", atlasTexture);         
  8.                
  9.                 myAtlas.GetComponent<UIAtlas>();
  10.                 myAtlas.spriteMaterial = atlasMat;
  11.                 myAtlas.coordinates = UIAtlas.Coordinates.TexCoords;      <--- Error 1
  12.                
  13.                 myAtlas.spriteList.Clear();
  14.                
  15.                 for(int i  = 0; i < spriteCoordInfo.Length; i++)
  16.                 {
  17.                         Rect coordinate = spriteCoordInfo[i];
  18.                         UIAtlas.Sprite sprite = new UIAtlas.Sprite();   ****           
  19.                         sprite.name = names[i];
  20.                         sprite.inner = coordinate;              <---- error 2
  21.                         sprite.outer = coordinate;             <---- error 3
  22.                         sprite.paddingBottom = 0;
  23.                         sprite.paddingTop = 0;
  24.                         sprite.paddingLeft = 0;
  25.                         sprite.paddingRight = 0;
  26.                         myAtlas.spriteList.Add(sprite);                
  27.                 }
  28. }

I can remove the lines listed, and then change this line
  1.  UIAtlas.Sprite sprite = new UIAtlas.Sprite();  ****   
and replace it with
  1. UISpriteData sprite = new UISpriteData();
   but when I then assign the new sprites to my buttons I am getting new errors which are:
aabb.IsValid()
!IsFinite(outDistanceForSort)
UnityEditor.DockArea:OnGUI()
!IsFinite(outDistanceAlongView)
UnityEditor.DockArea:OnGUI()
!IsFinite(outDistanceForSort)
!IsFinite(outDistanceAlongView)
These errors just repeat themselves over and over.

I am fairly new to Unity and NGUI, so I apologise if this wastes anyones time, I will continue to try and fix this myself too!

Thanks in advance for any time and advice given.

Sigh

edit: I should note, that I believe the errors to be caused by the fact that the sprites are being added without their inner/outer coordinates? as a result, when rendering the sprite, the coordinates are (id imagine) 0, 0, 0, 0 ?

I did find a SetRect within spritedata, but that takes 4 int values? is this the replacement? if so, does this mean I need to get pixel coordinates from my packtextures line? rather than texcoords? Thanks again

Pages: [1]