GUI error calculating

so, i create a gui like this…

#pragma strict
var bg : Texture;
var bg_w : float = Screen.width*0.75;
var bg_h : float = Screen.height*0.9;
var posbg_w : float= Screen.width*0.1;
var posbg_h : float= Screen.height*0.05;
var b_width:float= 420;
var b_height:float=100;

//konfigurasi button_perkalian
var button_perkalian: GUIStyle;
var pos_b1w: float = posbg_w+(bg_w*0.1);
var pos_b1h: float = posbg_h+(bg_h*0.05);
//konfigurasi button_luas
var button_luas: GUIStyle;
var pos_b2h: float = pos_b1h+100;

//konfigurasi button_satuan
var button_satuan: GUIStyle;
var pos_b3h: float = pos_b2h+100;
function Start () {

function OnGUI (){
	GUI.Button(Rect(pos_b1w,pos_b1h,b_width,b_height)," ",button_perkalian);
	GUI.Button(Rect(pos_b1w,pos_b2h,b_width,b_height)," ",button_luas);
	GUI.Button(Rect(pos_b1w,pos_b3h,b_width,b_height)," ",button_satuan);

i know this code must work… but why it’s have a different value on Inspector? i print the screen.width and says it was 726… if i times it with 0.75 it will become 554, but in the inspector, it says 175.5 ! i don’t know why this is happening, anyone could explain me?


the values that aren’t in the start or in the onGUI functions are pre-compiled. when you run the game, the values stay the same no matter what the Screen bounds are.
get all the values in the Start function.

function Start()
   bg_w = Screen.width*0.75;

During Initialization it probably takes the screenwidth of the game view. Try Maximizing while play if you need this to be the whole screen.