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

Pages: [1]
1
NGUI 3 Support / Element position in World
« on: August 28, 2016, 03:25:06 PM »
Hello. I have tried searching for a solution for quite some time now, but people seem to want to place ngui elements over gameobjects instead of the opposite.
I want to on a click generate a GameObject and move it towards a sprite (or a label), but i cant seem to be able to get world position of an ngui element

I have tried Camera.main.ViewportToWorldPoint(gui.transform.position); which seems to point me in the right direction atleast (it overpasses the target tho depending on the screen width) Also have attempted some stuff like UIRootCamera.ViewportToWorldPoint, havent had much luck
ScreenToWorldPoint gives me a point in the lower right corner of the screen and i have also tried some other variants that end up pointing at about (1.5,0.5,100) which is actually gui.transform.position? (gui is the label im trying to target)

This is all very confusing to me and i am definitely doing something wrong so how do i get world point of and ngui element? Or maybe on other terms place a gameobject over (under) a ui element.

2
NGUI 3 Support / UIGrid.Reposition() overlaping elements
« on: July 21, 2016, 01:26:23 AM »
I have a small vertical grid with 3 buttons. Depending on certain occasions i disable some of them and then call UIGrid.Reposition(). UIGrid settings are: Arrangement vertical, cell width/height 100, pivot center, sorting none, smooth true, hide inactive true. The object holding the uigrid also has tween transform (if that might affect anything)
So for some reason once i disable second two buttons, and then later enable them they overlap each other
something like this
1:x=100
2:x=0
3:x=-100
#later
1:x=0
2:disabled
3:disabled
#later            or   #
1:x=0                  1:x=0
2:x=-50               2:x=0
3:disabled            3:x=-100

I tried:
Calling .Reposition() in update
Calling .Reposition() after enabling/disabling
Calling .repositionNow to true in both cases
Setting button.transform.position   -> it moves the z: to about  -42000 (or some other large number)

Do you have any solution that might fall on your mind? I have tried searching at various places. havent really found a good solution

3
NGUI 3 Support / Re: Ngui tiled sprite extremely blurry (3.9.6d)
« on: April 30, 2016, 02:02:06 PM »
yes the border is defined, but if you look closer at the sprite ingame you will see that it is stretched because the sprite is 512x512 and the window is 800x100 i think.

4
NGUI 3 Support / Re: Ngui tiled sprite extremely blurry (3.9.6d)
« on: April 29, 2016, 01:53:11 PM »
I managed to mitigate the effect by changing the atlas texture import setting to Sprite (2D and UI). I got the problems with stretching though. Could you help? Sorry if it is a bother, i would probably find it but my day is a bit filled.

5
NGUI 3 Support / Ngui tiled sprite extremely blurry (3.9.6d)
« on: April 29, 2016, 06:11:14 AM »
Hey! I am working on an android project, and i have a problem with UI Sprite. The sprite is extremely blurry although it is imported as 512x sprite. It looks totally fine on unity sprite, and its totally fine in the atlas texture but on the object it is barely recognizable. In the attachment you can see it (the background is in the question, disregard the blue icon). And also the original texture.

Pages: [1]