Reference   Language | Libraries | Comparison | Changes

ArduinoGraphics : ArduinoGraphics class

rect()

Description

Stroke and fill a rectangle, uses the stroke color set in stroke() and the fill color set in fill().

Syntax

YourScreen.rect(x, y, width, height)

Parameters

  • x: x position of the rectangle
  • y: y position of the rectangle
  • width: width of the rectangle
  • height: height of the rectangle

Returns

Nothing

Example


YourScreen.beginDraw();
YourScreen.clear();
YourScreen.noStroke();
YourScreen.fill(255, 255, 0);
YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height());
YourScreen.endDraw();

See Also



Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.