Canvas 3D - Rectangle Tag

From CDOT Wiki
Revision as of 09:59, 13 April 2007 by RealMarkP (talk | contribs) (Cube Tag Reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Rectangle Tag Reference

Back To XML 3D Main Page

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.