screen Width

Get the width in pixels of the screen.

screen width
JavaScript
function scene.screenWidth(): number;
Python
def scene.screen_width(): number

Returns

  • a number that’s the width of the screen on the game device or simulator.

Example

Draw a wide line across the entire screen.

screen width3create image widthheightwideLinewideLinespriteof kindsetshowLinetofillwithsetwideLinetoon start

See also

screen height