RectangleGradientShape

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

  • Create a 80x50 rectangle gradient with a light gray vertical gradient, 18-pixel rounded corners and a 2-pixel stroke around it. var gradRect:RectangleGradientShape = new RectangleGradientShape(80, 50, 0xFFFFFF, 0xCCCCCC, 1, 1, 2, 0xAAAAAA, 1, false, Math.PI/2, 18);

Summary

Constructor
  • RectangleGradientShape (w:Number, h:Number, fillColor1:uint = 0x000000, fillColor2:uint = 0xFFFFFF, fillAlpha1:Number = 1, fillAlpha2:Number = 1, strokeThickness:int, strokeColor:uint = 0x000000, strokeAlpha:Number = 1, alignToCenter:Boolean = false, rotation:Number = Math.PI/2, roundedCornerAmount)
Instance methods

Constructor

RectangleGradientShape

function RectangleGradientShape(w:Number, h:Number, fillColor1:uint = 0x000000, fillColor2:uint = 0xFFFFFF, fillAlpha1:Number = 1, fillAlpha2:Number = 1, strokeThickness:int, strokeColor:uint = 0x000000, strokeAlpha:Number = 1, alignToCenter:Boolean = false, rotation:Number = Math.PI/2, roundedCornerAmount)

Instance methods

alignToCenter

function alignToCenter() : void