I started playing around UI in my game and X alightment of windows became a problem. I think this might be due to the fact of me not understanding what's "isRightInputMode" and what it does, and what calculations before and after the colon do.
For example:
I want to add a little bit of space at the left of the command window in the menu (about x pixels), and here's what I have so far:
For example:
I want to add a little bit of space at the left of the command window in the menu (about x pixels), and here's what I have so far:
JavaScript:
const rows = 6;
const width = this.mainCommandWidth();
const height = this.calcWindowHeight(rows, true);
const x = this.isRightInputMode() ? Graphics.boxWidth - width: 0;
const y = Graphics.boxHeight / 2 - height / 2;
return new Rectangle(x, y, width, height);