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

Pages: [1]
1
NGUI 3 Support / Re: UILabel Max Lines Not working for UIInput
« on: March 23, 2015, 11:21:02 AM »
So I'm just going to assume this feature with NGUI is broken. I created a workaround. Set the Max Lines to 0, attach the script below to the object, and set the UIInput's OnChange event to trigger the OnTextChanged method. This does the trick.

  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class LimitLines : MonoBehaviour
  5. {
  6.     public int TotalLines = 2;
  7.     private UILabel _label;
  8.     private UIInput _input;
  9.  
  10.     void Start()
  11.     {
  12.         _label = this.GetComponent<UILabel>();
  13.         _input = this.GetComponent<UIInput>();
  14.     }
  15.  
  16.     public void OnTextChanged()
  17.     {
  18.         string[] lines = _input.value.Split('\n');
  19.         string output = "";
  20.  
  21.         for (var i = 0; i < lines.Length && i < TotalLines; i++)
  22.         {
  23.             output += i > 0 ? '\n' + lines[i] : lines[i];
  24.         }
  25.  
  26.         _label.text = output;
  27.         _input.value = output;
  28.     }
  29. }
  30.  

2
NGUI 3 Support / Re: UILabel Max Lines Not working for UIInput
« on: March 23, 2015, 11:00:54 AM »
Another issue I am noticing is the window's standalone version will only show a single line unless "max lines" is set to 0. Max lines can be set to 5, the UILabel text field is showing two lines, but the application only renders the first line. It's really weird....

3
NGUI 3 Support / UILabel Max Lines Not working for UIInput
« on: March 23, 2015, 10:44:13 AM »
I have a UILabel and a UIINput script attached to the UILabel object. The "Max Lines" on UILabel is set to 2, but when I go to input text on iOS I can add as many lines as I want. How do I limit input to only two lines?

4
NGUI 3 Support / NGUI Rendered elements to Texture2D?
« on: March 02, 2015, 07:44:18 AM »
Hello everyone!
     I am wanting to save out an image of a panel and all of its elements. Is there an easy way to convert a panel and its children to a simple texture2d I can save out? Thanks for the help!

5
I've encountered this bug multiple times in different projects. Upon updating a large atlas, the entire project gets modified. Where there once was a UITexture, the UITexture gets changed to a UISprite. The worst part about this is no error is typically output. Instead, any script referencing a UITexture with a public variable ends up referencing nothing. I have to then go through the entire project, figure out which sprites use to be a UITexture, recreate the UITexture, and reset the anchors. This waists a lot of time and makes me terrified to update an atlas. The past three projects we have worked on has had this happen without fail at some point during the development cycle...

The simple solution is to not use UITextures at all. Sadly, that's not so simple. Many of our projects are streaming and displaying images at runtime. Anyways, has anyone else encountered this issue? Any workarounds?

6
NGUI 3 Support / Re: Scroll View check if scrolling
« on: December 19, 2014, 02:09:59 PM »
So what I've done is created a script to see if the gameobject is moving or not. This is extremely inefficient but I need make sure the panel is not scrolling before I fire an event. Below is my script. I would appreciate any feedback if someone has a better way on telling if a panel is being scrolled.

<code>
using UnityEngine;
using System.Collections;

public class MovementCheck : MonoBehaviour
{
    public bool IsMoving;
    private float _lastY = 0;

    void Update()
    {
        if (transform.position.y != _lastY)
        {
            IsMoving = true;
            _lastY = transform.position.y;
        }
        else
        {
            IsMoving = false;
        }
    }
}
</code>

7
NGUI 3 Support / Scroll View check if scrolling
« on: December 19, 2014, 11:43:55 AM »
Hello Everyone!
     What is the best way to tell if a scroll panel has finished scrolling? I need to fire an event when the panel is not moving. Thank you for your time!

8
Misc Archive / Re: Building Material Design UI with NGUI
« on: December 15, 2014, 04:18:49 PM »
How close are you to putting something up on the asset store or releasing source? This looks amazing!

9
NGUI 3 Support / Re: (Easy question) Text Top Left Justified?
« on: December 15, 2014, 06:58:11 AM »
Thank you! That did it!

10
NGUI 3 Support / (Easy question) Text Top Left Justified?
« on: December 14, 2014, 09:02:20 PM »
Hello!
     I am pretty new to using NGUI. So far it has been a breeze setting up the UI. The only issue I am having is setting text to start in the upper left of a label. I cannot find an option to make text start at the top left. Am I using the wrong widget? This text area would be used for user input as well. Any help on this would be much appreciated! Thank you!

11
NGUI 3 Support / Scroll View focus issue
« on: July 21, 2014, 11:57:38 AM »
Please keep in mind I am very new to NGUI.
     I have set up a scroll view with a grid as the child. Attached are two child panels. For some reason when I hit play in unity the screen scrolls to the second panel. When I swipe back to the first panel I can see it, but the moment I lift my finger off the screen it scrolls back to the second panel. Any suggestions on how to fix this? I am using NGUI 3.5.6.

Pages: [1]