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

Pages: [1]
1
NGUI 3 Support / Adding, and calling ability buttons
« on: January 20, 2014, 01:03:33 PM »
Hello,

I have a few different characters to choose from, and when i select one from the character selection screen, I have 4 abilities i want to load, from a characters ability script, the character will provide.

The buttons should call the characters abilities, and work as toggles. also, load the texture from the script.

I have everything done already for the characterabilities, and know how to call it in a regular GUI Button, and have it working this way. However, I want to call it using NGUI instead.

so

NGUI Button 1 >> character ability 1

2
NGUI 3 Support / Adding an Anchor to a new GameObject.
« on: December 20, 2013, 06:33:27 PM »
Im trying to add new progressbars to each new instantiated gameObject (soldiers).

These soldiers have a vitality script, and I have this bit into the vitality script.

  1. public GameObject pbar; //my instantiated health bar.
  2. public void Awake()
  3. {
  4.                 pbar = NGUITools.AddChild(GameObject.FindGameObjectWithTag("Panel"), pbar);
  5.  
  6.                 pbar.AddComponent<UIAnchor>();
  7.                 pbar.GetComponent<UIAnchor>().container = this.gameObject;
  8. }

However, it instantiates it the bars at 0,0,0.

Before, I only had addchild, and "pbar.transform.position = this.transform.position;" in Update Script, but I figured their was a better way to do it with Anchors.

any ideas on how to anchor the instantiated GameObject properly?

3
NGUI 3 Support / parent healthbar to gameobject.
« on: December 13, 2013, 02:04:21 AM »
Hi, I just had a simple question. is their a better way I can parent a UISlider to the gameobject?

my current solution is to do gameobject.transform.position = this.transform.position;
in Update, but I feel theirs a better way. I think its in Anchor, but when i search for the function, it just gives me a boolean. is their a better way, or a built in NGUI call for this?

4
NGUI 3 Support / creating healthbars above units
« on: December 08, 2013, 06:50:00 PM »
Hello,

fairly new to NGUI, so sorry if this question sounds noobish. I went through some of the tutorials from both here, and Burgzerg. I have a progress bar added, and can easily adjust it. however, I want the health bar to display above the units, such as the example image below. However, when I try to parent the progress bar to the unit, it drags everything into the camera. is their a way around this, or an alternative?

http://i1.ytimg.com/vi/MV2rRcskn4Y/maxresdefault.jpg

Thank you,
Alex Moreno

Pages: [1]