Scratch for Java

Drawing::rectangle()

Draws a filled rectangle centred on (x,y).

Examples

View on GitHub

Syntax

Java

.rectangle(x, y, width, height, color)

Parameters

Name Data Type Description
x double centre x
y double centre y
width double width in pixels
height double height in pixels
color Color fill colour

Return

void

rectangle()

Create Shareable URL

Select Sections