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.


Topics - Lautaro

Pages: [1]
1
NGUI 3 Support / Using sprite from atlas for spriteRenderer
« on: February 13, 2014, 07:46:30 AM »
The NGUI sprite atlas i use for the gui has a sprite i need for the game world. Can i use it with a normal unity SpriteRenderar through code? How?

2
NGUI 3 Support / Keeping Clicking NGUI widget from going through
« on: February 12, 2014, 09:00:53 PM »
Hi!

Do NGUI has a solution to prevent gui clicks to go through and trigger other scripts? My droid goes where i click and when i click an NGUI button the droid moves to that position. :P

3
NGUI 3 Support / **Solved** Prefab script not working when instanciated
« on: December 05, 2013, 06:28:28 AM »
Im instantiating a prefab like this:

   
  1.         public GameObject inventorySlotPrefab;
  2.  
  3.                 void Start ()
  4.                 {
  5.                                 var inventorySlot = NGUITools.AddChild (gameObject, inventorySlotPrefab);
  6.  
  7.                 }

The object appears on the screen. But the script doesnt work. I have this to try the script. ( i know it works cause i get the debug log when an instance of the prefab is dragged in on the screen in the editor)

   
  1. void OnClick ()
  2.                 {
  3.  
  4.                                 Component[] allComponents;
  5.                                 allComponents = gameObject.GetComponents<Component> ();
  6.                                 foreach (var component in allComponents) {
  7.  
  8.                                                 Debug.Log (component.name);
  9.  
  10.                                 }

Also, i see that some posts are marked *solved*. Do you want us to rename the posts when solved?

4
NGUI 3 Support / localPosition to MousePosition
« on: December 04, 2013, 03:07:11 PM »
I have this on a widgets OnPress

  1. var slotPosition = transform.localPosition.ToString ();
  2.                                 var mousePosition = Input.mousePosition.ToString ();
  3.                                 Debug.Log ("Mouse: " + mousePosition);
  4.                                 Debug.Log ("Slot: " + slotPosition);

The output is:
Quote
Mouse: (235.0, 636.0, 0.0)
Slot: (0.1, 0.7, 0.0)

I dont understand the difference between the vectors. How can i position the localPosition of the widget to where mouse is?

And even more, where can i read up on how Ngui/Unity is arranged so i better can understand?


5
NGUI 3 Support / Ngui as 2d game.
« on: December 04, 2013, 12:33:05 PM »
When creating 2D game is it wise to add the game itself on the same panel as the gui? Could in fact the whole game be made with NGUI components and tools?

Would that illiminate the need to convert between screen space and world space?

6
NGUI 3 Support / Moving NGUI positions.
« on: December 03, 2013, 02:13:26 PM »
How do i move NGUI elements around? I try using transform.position and just add 5 to X and Y but the end upp far far away.

7
NGUI 3 Support / Toggle object and its children.
« on: November 30, 2013, 12:00:45 PM »
I am trying to toggle a object with several children. One of them is a sprite. It doesnt work the object i a have dragged to the ToggledObjects array is not being toggled. But if i instead drag the objects child sprite to the toggle array it toggles that sprite, but not that sprites child!

So what can be toggled with the toggled objects and can the children be toggled as well?

8
NGUI 3 Support / Inventory slots generated from code
« on: November 30, 2013, 08:10:42 AM »
I cannot find any exameples on how to add NGUI objects from code! All i find is tutorials on how to use the editor tools.

What i want to do i is a inventory system. I have a window which is toggled from a inventory button. I want the window to be dynamically populated from code with X inventory slots that should be draggable and clickable. Could you point me in the right direction?

9
NGUI 3 Support / Perspective menu
« on: November 29, 2013, 03:49:08 PM »
How would i go about to tilt the camera so that the whole gui would be tilted in perspective?

Pages: [1]