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

Pages: [1] 2
1
NGUI 3 Support / Mouse cursor resetting to center screen on move?
« on: March 07, 2016, 01:39:07 AM »
I am implementing WASD movement across my 2D tile maps using the built in Horizontal and Vertical axes in Unity.  When I start pressing those keys though the mouse cursor jumps back to the center of the screen, if I try to move the mouse cursor around while using WASD the cursor just keeps resetting to the center of the screen every few frames.  I know this is caused by NGUI because if I disable the UIRoot object in my scene it stops doing it.  Traversing the map works fine, it is just annoying that the cursor jumps to the center of the screen, and will be problematic later given the way I intend to design my game.

Is there a setting somewhere to change this behavior?

2
NGUI 3 Support / Re: Font Creation Issues
« on: February 10, 2016, 06:11:51 PM »
Oh...I thought that was the best option, but it was such a PITA!  Had I known there was a better alternative I would have taken it, thank you!

3
NGUI 3 Support / Font Creation Issues
« on: February 10, 2016, 02:01:56 AM »
I am trying to add a custom font using BMFont, I have followed this tutorial: https://www.youtube.com/watch?v=ni7TfMPWq5M

When I import the font, go to NGUI > Open > Font Maker, and create an imported font using the .fnt & .tga files, the created font has a warning:

"The sprite used by this font has been trimmed and is not suitable for modification.  Try re-adding this sprite with 'Trim Alpha' disabled.  I am not sure what that means, I have never heard of 'trim alpha' in Unity.  Please help!

Screenshot: http://puu.sh/n2uXD/d6969ac631.png

4
NGUI 3 Support / Re: NGUI Drawing Issue?
« on: January 10, 2016, 04:28:38 PM »
I checked the widgets, they are set to update as normal.  And they had only one widget.  I did manage to fix it however by delete the arrows that weren't working, duplicating the arrows that were working (in this case left and up) and positioning them appropriately.  I did that and everything worked just fine afterwards, not quite sure what was going on but it is fixed now!

5
NGUI 3 Support / NGUI Drawing Issue?
« on: January 08, 2016, 10:59:16 AM »
I really felt the best way to convey this was visually with a short video (18 seconds), you can find it here:  https://dl.dropboxusercontent.com/u/78881962/NGUIIssue.mp4

Essentially I have 2 buttons attached to each my horizontal & vertical scrollbars.  Left & Right arrow, Up and Down arrow, like you would have on any scrollbar.  The problem is that when my scene first loads...the Right arrow button and the Down arrow buttons are missing.  But if I pause and unpause, they mysteriously appear.

At first I thought...well maybe they are being drawn under my map, so then I disabled the map so that the interface was the only thing there and those buttons could not possibly be drawn under anything.  No go, even with the map disabled, those buttons are still missing until I pause and unpause.

I cannot make heads or tails of this issue, so any help is appreciated!


6
NGUI 3 Support / Re: Attach label to standard game object?
« on: October 31, 2015, 05:00:41 AM »
Hmm but the second I do that it creates a new UI Root and moves the game object in there, including the parent which is a spaceship flying in space lol.  Causes a big problem since I already have a UI Root and it is creating a new one by default it would seem.  Is there another option besides the HUDText package?

7
NGUI 3 Support / Attach label to standard game object?
« on: October 30, 2015, 01:03:00 PM »
I am currently creating a 2D side scrolling sci-fi shmup and designing the missions for it.  In some of these missions, there are friendly units that I want to designate with a label above them in green text [FRIENDLY], because if the player kills them they suffer a score penalty at the end of the round.  What would be the best way to accomplish this?

8
NGUI 3 Support / Re: ToolTip Display Issue
« on: October 11, 2015, 11:23:30 AM »
Ah, in that case my UI is 2D as it is set to orthographic.  So it would seem that is not the problem.  Could it be because the item being hovered is in a scrollview and grid? I can't see how that would matter but, I have double and triple checked that I am not changing the position in way other that my code I originally posted.  Here is the code that spawns the tooltip from the item icon (pink square):

  1. private void OnTooltip(bool show)
  2. {
  3.             if (show)
  4.             {
  5.                 if (m_CurrentToolTip == null)
  6.                 {
  7.                     GameObject go = NGUITools.AddChild(m_CurrentRoot, ItemToolTipPrefab);
  8.                     m_CurrentToolTip = go.GetComponent<UIItemToolTip>();
  9.                     m_CurrentToolTip.SetData(DisplayedItem);
  10.                 }
  11.                 else
  12.                 {
  13.                     m_CurrentToolTip.SetData(DisplayedItem);
  14.                     m_CurrentToolTip.Show();
  15.                 }
  16.             }
  17.             else
  18.             {
  19.                 if (m_CurrentToolTip != null)
  20.                     m_CurrentToolTip.Hide();
  21.             }        
  22. }

The tooltip then has this code in the Awake & Show methods:

  1. Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
  2. transform.OverlayPosition(mousePosition, Camera.main, UICamera.mainCamera);

9
NGUI 3 Support / Re: ToolTip Display Issue
« on: October 10, 2015, 12:04:54 PM »
It should be 2D, I think NGUI auto generated it when I started placing components.  But I have been placing 3D colliders on objects and the UICamera event type says 3D, so maybe not.  How can I be sure it is a 2D UI?  When I set event type to 2D and change all the colliders to 2D colliders, it still pops up in the bottom left of the screen.

10
NGUI 3 Support / ToolTip Display Issue
« on: October 05, 2015, 03:20:43 PM »
I have a weird issue going on right now with my tool tips.  Basically I have an item picker window, that fills a scrollview-grid system with the items matching a filter from my inventory, but it only displays the item icon.  When I hover my mouse cursor over the icon, I want a tool tip to display the extended details of that item.  The code I am using to position the tool tip is here:

  1. Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
  2. transform.OverlayPosition(mousePosition, Camera.main, UICamera.mainCamera);

That code is located on a script attached to the tooltip.  If I hover my mouse over the center of the item icon the tool tip upper left corner should display at my mouse cursor point.  But instead it is doing this:



You can see the tooltip is off in the bottom left corner, even though my mouse position is in the center of the pink square.  So what am I doing wrong?

11
NGUI 3 Support / Re: Blurry UI Images?
« on: September 27, 2015, 11:56:55 AM »
Ugh so simple /facepalm!  Perfect, thanks!

12
NGUI 3 Support / Blurry UI Images?
« on: September 24, 2015, 12:43:46 PM »
Hey all, I have a weird issue that I am curious about.  See picture below.  Basically I imported a single emoticon here, the import details can be seen in the Inspector.  I added the emoticon to an atlas through NGUI.  When I go to the menu: NGUI > Create > Sprite and set the emoticon, I noticed it looked slightly blurry.  So then I went on the menu to: NGUI > Create > Unity 2D Sprite and added the emoticon to that and put them side by side.  The Unity 2D Sprite is on the right.  I do alot of work with pixel art, so accuracy is important in that respect.  Why is NGUI blurring the emoticon that I added to my atlas through NGUI?


13
NGUI 3 Support / NGUITools.AddChild Broken?
« on: August 19, 2015, 03:30:37 PM »
Searched around a bit but I could not find anything for this issue.  I am using NGUITools.AddChild to instantiate a child UI game object in my current root.  But the instantiated game object is just an empty game object, also I noticed all the layers for my UI objects are empty for some reason?  First screenshot is of the empty game object that is being created, with an empty layer (also showing current existing layers), second screenshot is of the prefab that is supposed to be created, and lastly the code that is being used to instantiate:




  1. private void AddNavigation()
  2. {
  3.     NGUITools.AddChild(gameObject, NavigationPrefab);
  4. }

I have double checked the prefab assignment as well and it is correct so I am a bit confused about what is going on.  Any help is appreciated!

14
NGUI 3 Support / Re: Drag & Drop Issues
« on: June 07, 2015, 11:01:35 AM »
Shameful bump, nobody has the answer?

15
NGUI 3 Support / Re: Drag & Drop Issues
« on: June 04, 2015, 10:47:07 AM »
Bump, anybody?

Pages: [1] 2