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

Pages: [1]
1
NGUI 3 Support / Re: uwebkit with ngui
« on: September 30, 2014, 05:47:33 PM »
I've kinda fixed the problem with using a render texture on a texture like you would do any other 3d object. it would be nice if we could get it to work without it, but unless the answer is simple it's not worth much time/effort I guess

2
NGUI 3 Support / uwebkit with ngui
« on: September 30, 2014, 04:58:20 PM »
Looking to combine the uwebkit functionality into an existing ngui system. the uwebkit wants to manipulate a Mesh Render component on the game object to display webpages. Is there a way to have a mesh render affect ngui sprites or textures in the same way? or is there some other method that anyone has figured out to get them to combine properly? It feels like there is something basic that I'm missing.

3
NGUI 3 Support / Re: Question about raycasting with ngui interface.
« on: March 11, 2014, 07:11:20 PM »
Okay I have looked at it and I think I have it most of the way worked out. But I might be having a problem with uicamera.notify now. Currently when I have clicked on a ui element with the mouse I can activate it as many times as I want, even though my UICamera.selectedObject is being changed on every raycast.

void Awake()
   {
      UICamera.onCustomInput = NGUIinput;
   }
   
   void NGUIinput()
   {
      if(hintButtonDown)
      {
         print("hit object " + UICamera.selectedObject);
         UICamera.Notify(UICamera.selectedObject, "onKey", KeyCode.Mouse0);
      }
   }

void Update ()
   {
      if(hintButtonDown)
      {

         UICamera.selectedObject = UICamera.Raycast(new Vector3(cursorX, (Screen.height - ursorSystem.Instance.cursorY)), ref cursorHit) ? cursorHit.collider.gameObject : fallThrough;

      
      }
      }

with that trimmed down code and some print statements I can see that i'm accurately raycasting to ngui elements and hitting them, my customInput function won't actually "click" them unless a mouse has clicked them. Thanks in advance.

4
NGUI 3 Support / Question about raycasting with ngui interface.
« on: March 11, 2014, 04:40:52 PM »
We are converting an already existing project that uses mouse and touch controls, for pc and mobile devices, to an environment where we have to use a custom pointer that uses screen coordinates. At a glance, it seems like ngui supports raycasting to simulate hits and touches onto ui elements, but i was wondering if there was a better way besides just setting it for raycasting.

5
NGUI 3 Support / Localize lables in editor
« on: December 05, 2013, 05:32:06 PM »
I might have missed something simple, but is there a way to have the localization that happens at run time happen while i'm in editor? So I could have the localize script on a label and then flip though languages to make sure it all looks right layout wise without having to run the game over and over?

And I guess to not flood the board, is there any support in the base ngui (or any 3rd party addons) for having UILabels go from top right to bottom left for Horizontal Japanese text?

6
NGUI 3 Support / Re: Altering ui lable from a different ui script
« on: November 21, 2013, 02:29:52 PM »
Ah, I see. The serialized property works much better too. Thanks for your help!

7
NGUI 3 Support / Re: Altering ui lable from a different ui script
« on: November 21, 2013, 01:04:08 PM »
Sorry I wasn't specific enough Aren, I was referring to the color field in the inspector of the UILabel under the widget header.

So the problem I have with altering the color variable of the UILabel is that it doesn't effect the actual color of the text, just the color field on the inspector; at least not when I'm attempting to do it from a different editor script. Some example code:

public class TextObject : MonoBehaviour
{
     public UILabel label;
}

[CustomEditor(typeof(TextObject))]
public class TextFieldInspector : Editor
{
   public override void OnInspectorGUI ()
   {
      
      TextObject _target = (TextObject)target;
      _target.label = _target.gameObject.GetComponentInChildren<UILabel>();

      _target.TextColor = EditorGUILayout.ColorField("Text Color", _target.TextColor);
      
      if (GUI.changed)
      {
         _target.label.color = _target.TextColor;
      }
   }
}

Where the UILabel i'm attempting to effect is a child of a panel in the top level object's children. This code reproduces my problem that it will update the color swatch in the inspector of the UILabel, but it doesn't impact the actual color of the text, and when the game is started all the information is reset to it's previous value before the color field in the editor script was altered.

8
NGUI 3 Support / Altering ui lable from a different ui script
« on: November 20, 2013, 01:40:05 PM »
This I'm sure is something easy that I'm missing, but I've been trying to get the color of text in a UILabel to update and change based on the setting of a color field on it's parent object. I've tried to manipulate the color of the UIWidget that is attached to the label, but it never forwards the color to the text itself.

Is there an easy process to have the color choice forwarded from a different editor script?

Pages: [1]