get height and width /2

Im trying to get the width and height to be saved in a variable after deviding it by 2 so I can put an image in the exact center of my window.


I have yanfly's core engine installed but I cant seem to get the width and height (since his code is too complicated for me)


Get width and height-> devide by 2 -> put it in game variable.


Because having to hardcode the middle isnt very accurate and it wont work if i resize the window...
The width and height of what? You can get the screensize via:


Graphics.width;
Graphics.height;
Graphics.boxWidth;
Graphics.boxHeight;


Honestly, i don't know the exact difference between width/height and boxWidth/boxHeight.
yeah I was talking about screensize, I need to save that in a variable so I can designate the middle.


trying to find out how I can access the game variables in js
Code:
$gameVariables.value(id);			// get value
$gameVariables.setValue(id, value);		// set value
I used Yanfly to set the size to 512 x 384 but when I output the 2 variables I get 0 192... which means the width is 0 xd. 


$gameVariables.setValue(0, Graphics.width / 2);


$gameVariables.setValue(1, Graphics.height / 2);
Variables start at 1 (a bit confusing, since programming languages usually start at 0), so to set variable #1, you would actually use 1, not 0.
yeah ok now it works... I was using 0 base

Original thread: https://forums.rpgmakerweb.com/threads/get-height-and-width-2.57727/