Canvas 3D - Rectangle Tag
Rectangle Tag Reference
Introduction
The Rectangle is one of the basic 2D primitives that can be created within canvas. The Rectangle Tag encompasses the various attributes that are associated with a Rectangle, such as position, width, height, and drawing styles.
Tag Attributes
- position
- Usage: <rectangle position="35, 53" />.
- The position attribute is optional. If omitted, the position defaults to the Origin location at {0, 0}.
- The position attribute holds a set of two numbers separated by commas that are associated with the distance away from the Origin Point of (0, 0).
- width
- Usage: <rectangle width="10" />.
- The width attribute defines the width of the rectangle.
- This attribute cannot be omitted.
- height
- Usage: <rectangle height="30" />.
- The height attribute defines the height of the rectangle.
- This attribute cannot be omitted.
- fillcolor
- Usage: <rectangle fillcolor="#00FF00" />.
- The fillcolor attribute sets a specific color that will be painted inside the rectangle.
- This value, if omitted, will default to black (#000000).
- bordercolor
- Usage: <rectangle bordercolor="#FF00FF" />.
- The bordercolor attribute sets a specific color of the border.
- If omitted, the square will be drawn borderless.
Syntax
<canvas> <rectangle position="80, 80" width="44" height="85" fillcolor="#49a" bordercolor="#F00" /> </canvas>
References
- None.