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

Pages: 1 [2] 3
16
Hi,
I have a slider component and I would like to create a rectangle sprite on top of the slider's background image. I want this sprite to cover a certain area of the slider, let's say from 50% to 70%. How to I get the positioning and sizing to do that?
I know that the thumb image when positioned at those percentages will give me that position but how can that be calculated with code? I tried to get the slider's background widget width but the value is somehow much longer that on screen. How can I get the total width of my slider?

Thanks


17
NGUI 3 Documentation / Re: UIScrollBar
« on: April 08, 2014, 04:28:35 AM »
I have a question about how to get my onScrollbarMoved method called when the scrollbar value has changed. If I run on Start:

scrollbar.onChange += onScrollbarMoved;

I get in the following error in the console:

Operator `+=' cannot be applied to operands of type `System.Collections.Generic.List<EventDelegate>' and `method group'

I noticed that if I use a reference of the scrollview to which the scrollbar is attached and listen for scrollview.OnDragFinished += onScrollviewMoved then it works fine but I was wondering why.

18
NGUI 3 Support / Re: Dynamic fonts issue with Unity 4.3
« on: January 30, 2014, 07:31:34 AM »
what is strange also is that if I use ttf files from my Mac they work fine, but if I use a ttf downloaded from dafont.com then it doesn't work anymore. All my labels have weird cut characters for some reason. All except that one font I was using before (the Batman Forever font, that one still works fine in the editor). Strange :(

19
NGUI 3 Support / Re: Dynamic fonts issue with Unity 4.3
« on: January 29, 2014, 04:50:00 AM »
I'm having a different problem...I don't have missing characters or misaligned characters. My characters display correctly at the right position, the problem is that on device they don't display with the font I use but with the default (Arial I guess) font.
This means that in the editor when I run the game my labels use my font, while when deployed on device (both iOS and Android) my font is not used and the default Arial font is used instead for some reason.

Any idea why? It started after Unity updated to 4.3, before that it worked fine.

20
NGUI 3 Support / Re: Dynamic font height
« on: January 29, 2014, 04:45:47 AM »
oh...I think I misread the post...my font problem is f a different kind actually. I'll open a new topic, sorry for the confusion.

21
NGUI 3 Support / Re: Dynamic font height
« on: January 28, 2014, 07:40:56 AM »
Hi there,
for me this issue is still present. Any news about it? It was supposed to be fixed with the release f8 I think. Thanks for letting me know.


22
NGUI 3 Support / Re: Dynamic fonts issue with Unity 4.3
« on: January 27, 2014, 05:42:22 AM »
Hi, I'm still having the issue with the dynamic fonts not being shown correctly only when deployed on device (I sent you also an e-mail). The issue was supposed to be fixed in one of the latest releases of NGUI but for me the problem is still there.

23
works great! Thanks a lot ;)

24
I'm trying to create a pointer using a NGUI sprite. What I want to achieve is to have a sprite that points towards the direction of an object  by moving along the screen borders (the object it points is outside the screen on a 3d plane).

The problem I have is that I don't know how to convert the intersection points on screen with my NGUI camera viewport position. I have 2 cameras, one looking down a 3D world and one used for NGUI. I can calculate the point along the screen borders for the main camera, but I don't know how to convert the world position to the NGUI UICamera where all my GUI stuff is (including my pointer sprite).

Here is an example of how I calculate the intersection point between the left border of the screen and the line from the middle of the screen and the target position (I then check if there's an intersection with other borders of the screen if none is found with the left border):

Quote
                      Vector2 intersection = new Vector2();
         
         Vector2 topLeft = new Vector2(MainController.instance.visibleArea.TOP_LEFT.x, MainController.instance.visibleArea.TOP_LEFT.z);
         Vector2 bottomLeft = new Vector2(MainController.instance.visibleArea.BOTTOM_LEFT.x, MainController.instance.visibleArea.BOTTOM_LEFT.z);
         Vector2 topRight = new Vector2(MainController.instance.visibleArea.TOP_RIGHT.x, MainController.instance.visibleArea.TOP_RIGHT.z);
         Vector2 bottomRight = new Vector2(MainController.instance.visibleArea.BOTTOM_RIGHT.x, MainController.instance.visibleArea.BOTTOM_RIGHT.z);
         Vector2 targetPos = new Vector2(target.x, target.z);
   
         Vector2 screenCenter = MainController.instance.screenCenter;
   
   
         //Debug.LogWarning("SCREEN CENTER: "+screenCenter.x+", "+screenCenter.y);
   
         //left border
         if(Utils.LineIntersection(topLeft, bottomLeft, targetPos, screenCenter, ref intersection)){

                              //TODO: convert intersection point to NGUI camera screen position



Thanks

25
NGUI 3 Support / Re: Dynamic font height
« on: December 11, 2013, 09:27:21 AM »
Hey...yeah I have the same problem since weeks! I sent a bug report to Unity but they answered me back that the issue is with NGUI. You're the first one I found having the same problem...I was using a font that was working before Unity 4.3 bit after updating I had your same issue. I hope somebody can point out a solution for this.

26
NGUI 3 Support / Re: Dynamic fonts issue with Unity 4.3
« on: December 02, 2013, 03:52:41 AM »
Oh, yes I didn't import the Shaders folder by mistake, thanks.

The issue with the fonts is still there though...but again it happened when I updated Unity to 4.3 and 4.3.1 made the fonts work in the editor but not on device. Maybe I'll try to create fonts with NGUI instead of using the imported dynamic font directly.

27
NGUI 3 Support / Dynamic fonts issue with Unity 4.3
« on: November 29, 2013, 03:45:30 AM »
After I updated to Unity 4.3 (and yesterday update to 4.3.1 didn't solve the things) I have an issue with my fonts. Basically instead of taking my font (which was working before) now the font is Arial. The weird thing is that I was seeing Arial fonts also in the Editor until yesterday. When I updated to Unity 4.3.1 and that allowed the Editor to render the correct font I'm using. But if I deploy to iOS or Android the font is again Arial.

For the dynamic font I have simply imported a .ttf file in Unity and used that without creating a Font with NGUI.

I don't know if this is related but after updating NGUI to the latest version (3.0.6) I also get these error message in the console,

Unlit/Text doesn't have a clipped shader version for SoftClip
UnityEngine.Debug:LogError(Object)
Debug:LogError(Object) (at Assets/Scripts/Debug.cs:58)
UIDrawCall:CreateMaterial() (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:303)
UIDrawCall:RebuildMaterial() (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:324)
UIDrawCall:UpdateMaterials() (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:347)
UIDrawCall:Set(BetterList`1, BetterList`1, BetterList`1, BetterList`1, BetterList`1) (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:453)
UIPanel:SubmitDrawCall(UIDrawCall) (at Assets/NGUI/Scripts/UI/UIPanel.cs:1049)
UIPanel:Fill() (at Assets/NGUI/Scripts/UI/UIPanel.cs:1004)

Anybody has this problem as well? Thanks.

28
NGUI 3 Support / Re: version 3.0.6 conflicts with SpriteManager
« on: November 29, 2013, 03:37:47 AM »
Thanks it worked fine. I had to add UnityEngine.Sprite also in the NGUI settings file but it worked.

29
NGUI 3 Support / version 3.0.6 conflicts with SpriteManager
« on: November 28, 2013, 11:02:05 AM »
Hi,
I updated to 3.0.6 (I opened a new scene, deleted the NGUI folder and downloaded it again from the Assets Store). Unfortunately it doesn't compile because it says that Sprite has no definition of textureSize. I think the problem is that I have among my plugins SpriteManager which already includes a Sprite class and I'm not sure if NGUI tries to get that one instead of the Unity new Sprite class by mistake.

Is there a way to solve this without renaming the Sprite class of SpriteManager?

Thanks

30
I have a scrollview with some images in it and I want to show a button under the images when one is pressed. I created a button object and when one of the images is clicked I anchor the button to the bottom of the image. This works fine except that if I scroll my view the clipping area doesn't affect my button because it's not "inside" the grid.

I tried to parent the object to the clicked image and then anchor it but I got a weird behaviour: the button's Y position keeps diminishing over time (thus going outside the screen) after doing that for some reason. I tried to parent the button and then call Reposition() on the grid but it didn't work, same behaviour.

So what's the correct way to parent a button object to a scrollview element dynamically?

Thanks

Pages: 1 [2] 3