Skip to content
Calvin Day edited this page Jul 6, 2021 · 1 revision

The Size data structure is used to store two integers as an width, height pair.

Constructors

Size()

Size Screen = new Size();
Results in a Size with the value of 0, 0

Size(int width, int height)

Size Screen = new Size(1920, 1080);
Results in a Size with the value of 1920, 1080

Methods

setWidth(int width)

Screen.setWidth(7788)
Sets the value of width to 7788

setHeight(int height)

Screen.setHeight(326);
Sets the value of height to 326

getWidth()

Screen.getWidth();
Returns the value of width

getHeight()

Screen.getHeight();
Returns the value of height
Clone this wiki locally