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

Pages: [1]
1
NGUI 3 Support / Re: How to get the dimensions of UIWidget
« on: January 07, 2014, 03:13:26 AM »
Size... what do you mean by size (pixels or scale)?

If your "container" is a UIWidget, you can just call the container and look for height and width property:

Script on container:
  1. float height = this.GetComponent<UIWidget>().height;
  2. float width = this.GetComponent<UIWidget>().width;
  3.  

However, the widget is not going to change it's dimensions because you created a sprite as it's child.

If your "container" is just an empty GameObject then there is no size except scale, which is found by looking in the property this.transform.scale

Thanks!!!You are so nice!

2
NGUI 3 Support / How to get the dimensions of UIWidget
« on: January 06, 2014, 01:12:43 AM »
I use a container and creat sprite as its child.
I want to get the size of the container in my script.....

Pages: [1]