x


error with GUI in c sharp

GUI.Box(new Rect(10.0, 10.0, Screen.width * (2.5/6.55), Screen.height * (1.0/6.3)),"Welcome "+ loginArray[1]); it shows error CS1502: The best overloaded method match for `UnityEngine.Rect.Rect(float, float, float, float)' has some invalid arguments

error CS1503: Argument #3' cannot convertdouble' expression to type float' error CS1502: The best overloaded method match forUnityEngine.GUI.Box(UnityEngine.Rect, string)' has some invalid arguments error CS1503: Argument #1' cannot convertobject' expression to type `UnityEngine.Rect'

errors help me sort out this

more ▼

asked Mar 10 '11 at 04:54 PM

ben gravatar image

ben
39 18 21 25

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The problem is you're giving the function doubles instead of floats

Change all the 10.0 etc values to 10.0f and it should work

more ▼

answered Mar 10 '11 at 05:32 PM

Mike 3 gravatar image

Mike 3
30.5k 10 65 252

thanks!!!!!!!!!

Mar 10 '11 at 05:54 PM ben
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4139
x3669
x1938
x16
x14

asked: Mar 10 '11 at 04:54 PM

Seen: 2522 times

Last Updated: Mar 10 '11 at 04:54 PM