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

Pages: [1] 2 3 ... 5
I updated from a pretty old version of nGUI and I'm still finding a few strange quirks, one of which is UIButton no longer detects middle/right clicks? It looks like it has code to explicitly ignore this... Why was this changed?

I assume the suggested course of action is to use an eventTrigger's OnClick since that doesn't have such a limitation, but I'm not clear on why UIButton blocks it but eventTrigger doesn't; I don't want to switch all of these to use eventTrigger's just for that one to be changed as well in some later version to match?

I don't think I'm quite getting the implementation.
I see my atlas is using unlit/transparent colored. My Line is using a material I made called LineMat which has a sprite and is using the same shader, but is not clipped. I tried swapping the shader for Unlit- transparent colored 1, but then the line just disappears entirely. I even tried using the Atlas itself as a material to no effect.
I can get clipping to work for things like the Unity 2DSprite by changing the shader, but not the LineRenderer.

NGUI 3 Support / Re: I wanna display emoticon in NGUI
« on: July 05, 2017, 02:44:59 PM »
I don't believe it's officially supported, still, but there may be some material in this thread you can work with!

Heya! I recently discovered Unity's wonderful LineRenderer, but obviously this doesn't always play nice with nGUI.
I was wondering what everyone else/ArenMook use for drawing lines in nGUI?

I was previously using a very hacky collection of "I" and "L" sliced sprites and flipping them around, using some complex handlers to join their ends together... it mostly worked but it was painful and prone to breaking.

As the LineRenderers aren't part of nGUI, the main problems I'm finding are depth related and not being clipped by panels. I might be able to finagle/fake the depth management but no clue where to start with the clipping if it's even possible.

thank you for your time!

NGUI 3 Documentation / Re: UIGrid
« on: July 04, 2017, 12:51:11 PM »
What is the purpose of UIGrid.ConstrainWithinPanel()?

If the UIGrid only repositions objects, then I don't know how it'd also constrain to a panel, and though I see the code I can't figure out what it's actually supposed to do.
I thought this would change the grid size or limits to fit it in the dimensions of the parent panel, or ideally work with Cell Snap to fit all the elements within the panel, but it seems to have no effect whether it's on or off.

NGUI 3 Support / Re: Difficulty converting 2D UI to 3D
« on: July 04, 2017, 11:06:06 AM »
Did some experimenting and this seems directly related to switchign my camera to "perspective". If I leave it as Ortho, it runs like normal, no new UIRoots are generated, but if I switch it to perspective it breaks the cam and spams new UIRoots as mentioned above.

NGUI 3 Support / Re: Difficulty converting 2D UI to 3D
« on: July 01, 2017, 11:31:47 AM »
showing the main UIRoot and Camera, and the ton of UI Roots that are added when it starts or when I try to addChild.

NGUI 3 Support / Difficulty converting 2D UI to 3D
« on: July 01, 2017, 11:23:49 AM »
Heya! I'm returning to work on a game I hadn't touched in years (I think it was ngui 3.3.x or such?), and after updating Unity and my Libraries and getting everything sorted, I'm trying to convert my ui to 3D. It mostly seems in place except for a strange behaviour where when I start my game, it generates a TON of additional UIRoots with Cameras, and renders the scene in Ortho again.
The main camera that existed before running has it's culling changed from Everything to mixed (all but UI) so it doesnt render the 3D ui, and if I delete all the new UIRoots the ortho gui disappears, and resetting the main camera's culling back to everything renders it correctly in 3d.
I can interact with basic elements (scrolling, hovering, clicking things that just play tweens), but when I try to open a new menu it spawns a whole new batch of UIRoots and does the same culling change, ortho view, etc.
The code that seems to trigger it is NGUITools.AddChild:
  1. CorporationMenu menu = NGUITools.AddChild(this.CenterView, this.CorporationMenu.gameObject).GetComponent<CorporationMenu>();

Does this sound like something you recognize? Let me know if you need additional information.

NGUI 3 Support / Advice for adding OpenOn.Hover to UIPopUpList?
« on: January 27, 2015, 03:13:37 PM »
I've got the start of it easily enough, adding to the enum and:
  1. void OnHover(bool isOver)
  2.         {
  3.                 if (openOn == OpenOn.Hover && isOver)
  4.                         Show();
  5.                 else if (openOn == OpenOn.Hover && !isOver)
  6.                         Close();
  7.         }
But the problem is once you try to go over the options it closes... so how would I make it detect being over the popup options as well, and only closing if the mouse is off both the original button and the dropdown's background? I imagine it involves adding a collider to the background sprite and some other reference to see if it's hovered over as well, but I'm not sure how that'd work since I don't think it'd call the UIPopUp.cs OnHover method?

NGUI 3 Support / Re: How to work around [00] alpha encoding in labels?
« on: January 27, 2015, 11:43:22 AM »
Ah, thank you! That should work well! But I would recommend adding the "[[" escape character, it seems to be typical usage in other similar situations, would resolve this kinda problem in a simpler more expected manner :)

NGUI 3 Support / How to work around [00] alpha encoding in labels?
« on: January 26, 2015, 05:12:18 PM »
I use encoding to change colours of the text in a string, but I also need to include [10] and etc in the label, which turns the thing transparent. I can't even escape the encoding with a [[10], and I can't disable encoding because I use it for colour.
Is there an escape character so prevent the label from taking any [##] string and changing it to an alpha? the [any6characters] limitation was mildly obnoxious, but not being able to put 2 characters in brackets is causing problems all throughout my game, not even just this label.

Is there not an escape character for when we actually just want to type a bracket without invoking the encoding?

NGUI 3 Support / Re: TweenPosition misaligning sprites at random?
« on: March 07, 2014, 12:53:04 PM »
yeah, but as I said I didn't see anything between 5.0-5.3 that affected this sort of thing. I'll update anyway, then.

Updated: The only change is now alt-tabbing away and back no longer corrects the gui. As soon as I move the scroll bars it corrects, still... but it comes in broken as shown in the above post.

NGUI 3 Support / Re: TweenPosition misaligning sprites at random?
« on: March 06, 2014, 11:21:57 PM »
Heya, so I'm using 3.5.0 and I don't see anything since that affects panels/tweens/etc, and I'm still having this problem. I can't tween anything with a scrollview child in there somewhere without the gui breaking down. forcing constant repositioning sometimes fixes *parts* of the visual glitch but not always, and this effectively disables the scrolling anyway.

As it stand I can't tween any of my menus without anything in a scrollview glitching out, with what gui elements show up doing so seemingly at random.
Frustratingly, alt tabbing out then back in seems to make the GUI draw properly.

This particular menu doesn't seem to have the misaligning problem the other ones do (this one slides down ~100 px, the first post example had them sliding in from the side), but has the "random elements disappear" issue.

NGUI 3 Support / Re: My Big List of Anchor Complaints
« on: February 15, 2014, 03:05:21 PM »
your response to @MakeShiftWings: thanks for clarifying about the game/scene view thing! I had my gave and scene view on top of each other, didn't realize having them both open keeps scene view from jerking about.

I'm running 3.4.9, though I don't see anything in 3.5.0 that would change this.

So I made a sprite and label, and as soon as I  anchor it the first "Dimensions" input grays out (pic1), so I need to disable anchoring, resize the sprite, and re-enable it to get the position, or as OP states, set the right anchor to the same target and add the offsets together for the offset amount.  It's not too terrible an inconvenience, really, but just seems like an oversight.

Also a small strange thing, are anchors supposed to take multiple "refreshes" to resize correctly? I put a sprite behind the label anchored to it, and changed the contents of the label. I have to grab the side of the scene view and "shake" it (resizing the scene view), and the elements (sprite anchored to label, label's anchor to the left sprite) will sort of shimmy back into place. It ends up correctly so this isn't really a problem, but might explain why getting the dimensions of anchored sprites sometimes returns unexpected values (that is, grabbing the value before the anchors have finished moving back into place).

For clarity: those label# pictures were taken with the Snipping Tool, and by taking a picture, clicking on unity to cause another "refresh" that moves the anchors a bit, then taking another picture, etc.
I also tried this with just the left sprite and label and it's the same thing, it takes a few refreshes for the label to slide back in place.

NGUI 3 Support / Re: Only one tweenPosition plays at a time
« on: February 15, 2014, 02:32:14 PM »
I switched to begin and it... sort of works? Begin always overwrites everything that's not in the parameters (overwrites animation curve, for example), so I switched the code to this (below) and while all the tweens work here, clicking on the gameobject throws some errors to do with changing the animation curve (probably from changing the method during the tween, since there's no way to do it before using the Begin method).

It looks like it works without error if instead of setting steepercurves and method I set the animation curve directly, but I'm not sure how to set it up so it has the "steeper curves" effect on the curve.

Why do they not work when PlayForward is called individually? That seems like the expected behaviour should be for them to all play as they would normally.

  1.         void AddActiveHeadline(Headline headline)
  2.         {
  3. //              Same stuff. make button, put in place, get positions, etc.
  4. //              int width = uipLine.Background.width;//get width for positioning, tweens//TODO returns INCORRECT WIDTH, not yet resized according to anchors, so I have to do the hardcoded solution below
  5.                 int width = 40 + 6 + uipLine.Label.width + 10;//icon+spacing+label+spacing
  6.                 //slide headlines
  7.                 for (int i = ActiveHeadlines.Count-1; i>=0; i--)
  8.                 {
  9.                         UIPHeadlineButton hdln = ActiveHeadlines [i];
  10.                         if (hdln.transform.localPosition.x > this.TickerBarRightSide)//remove offscreens
  11.                                 RemoveActiveHeadline(hdln);//takes headlines that roll off the screen away
  12.                         else //the tweens
  13.                         {
  14.                                 //get "to" pos
  15.                                 Vector3 pos = hdln.transform.localPosition;
  16.                                 pos.x += width;
  17.                        = pos;
  18.                                 //play
  19.                                 TweenPosition tween = TweenPosition.Begin(hdln.gameObject, 1, pos);                            
  20.                                 //manually resetting the nulled values
  21. //                              tween.steeperCurves = true;
  22. //                              tween.method = UITweener.Method.EaseInOut;//using these two lines throws an error when the tween is viewed in the inspector
  23.                                 tween.animationCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);//not "steeper"
  24.                                 tween.eventReceiver = this.gameObject;
  25.                                 tween.callWhenFinished = "TweenPosComplete";
  26.                         }
  27.                 }
  28.         }

Pages: [1] 2 3 ... 5