- Home /
How to get Rect from scene Button ?
Hi,
I need to get the Rect of a scene Button, i explain. I've a button on my scene, i give it to my script:
public Button myButton;
void Start(){
Rect myButtonRect = myButton.getRect; ????
}
It's mean that i need the x, y, width and height value of my Button which is already in my scene.
Hope you understand my question :)
Thank you for any answer.
Comment
Best Answer
Answer by Denvery · Mar 17, 2015 at 09:24 PM
Hello!
Please use myButton.GetComponent().rect
Your answer
Follow this Question
Related Questions
making and integrating Visual novel element in 3d game? 2 Answers
load level with gui button nested in a toggled window!!! 0 Answers
Change to scene based on current scene 1 Answer
SerializedObject target has been destroyed. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) 9 Answers
Clicking Trigger 1 Answer