RectangleShape

Kind of class: public class
Package:
Inherits from:
  • Sprite
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.shapes.RectangleShape
File last modified: Saturday, 11 September 2010, 16:38:21
RectangleShape class is used to quickly create Rectangle sprites
Example

  • Create a 50x50 square var square:RectangleShape = new RectangleShape(50); Create a 200x50 rectangle with a 50% transparent black fill, a 3-pixel red stroke that has 18-pixel rounded corners, aligned to center var rect:RectangleShape = new RectangleShape(200, 50, 0x000000, .5, 3, 0xFF0000, 1, true, 18);

Summary

Constructor
  • RectangleShape (w:Number, h:Number, fillColor:uint = 0x000000, fillAlpha:Number = 1, strokeThickness:int, strokeColor:uint = 0x000000, strokeAlpha:Number = 1, alignToCenter:Boolean = false, roundedCornerAmount)
Instance methods

Constructor

RectangleShape

function RectangleShape(w:Number, h:Number, fillColor:uint = 0x000000, fillAlpha:Number = 1, strokeThickness:int, strokeColor:uint = 0x000000, strokeAlpha:Number = 1, alignToCenter:Boolean = false, roundedCornerAmount)

Instance methods

alignToCenter

function alignToCenter() : void