| Package | graphics.display.patterns |
| Class | public class StandardPatterns |
| Inheritance | StandardPatterns Object |
Example :
package examples.patterns
{
import graphics.colors.RGBA;
import graphics.display.Pattern;
import graphics.display.patterns.StandardPatterns;
import graphics.drawing.RectanglePen;
import graphics.FillBitmapStyle;
import system.data.Iterator;
import system.data.iterators.ArrayIterator;
import flash.display.Shape;
import flash.display.Sprite;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
[SWF(width="190", height="190", frameRate="24", backgroundColor="#EEEEEE")]
public class ExampleStandardPatterns extends Sprite
{
public function ExampleStandardPatterns()
{
///////////
stage.scaleMode = StageScaleMode.NO_SCALE ;
stage.addEventListener( MouseEvent.MOUSE_DOWN , next ) ;
///////////
var shape:Shape = new Shape() ;
shape.x = 10 ;
shape.y = 10 ;
addChild(shape) ;
///////////
var pattern:Pattern = StandardPatterns.slantedLineA(0xFFFF0000) ;
pen = new RectanglePen(shape) ;
pen.fill = new FillBitmapStyle(pattern, null, true) ;
pen.draw(0, 0, 170, 170) ;
///////////
iterator = new ArrayIterator( patterns ) ;
}
public var iterator:Iterator ;
public var patterns:Array =
[
StandardPatterns.lattice ( 0xFF000000 ) ,
StandardPatterns.latticeWide ( 0xFF000000 ) ,
StandardPatterns.lozenge ( 0xFF000000 ) ,
StandardPatterns.slantedLineA ( new RGBA( 255, 0, 0, 1) ) ,
StandardPatterns.slantedLineB ( new RGBA( 0, 255, 0, 1) ) ,
StandardPatterns.solidBar ( 0xFF000000 ) ,
StandardPatterns.solidBold ( 0xFF000000 ) ,
StandardPatterns.solidHorizonal ( 0xFF000000 ) ,
StandardPatterns.spot ( 0xFF000000 ) ,
StandardPatterns.x ( 0xFF000000 )
];
public var pen:RectanglePen ;
protected function next( e:Event ):void
{
if ( ! iterator.hasNext() )
{
iterator.reset() ;
}
(pen.fill as FillBitmapStyle).bitmap = iterator.next() as Pattern;
pen.draw() ;
}
}
}
| Method | Defined By | ||
|---|---|---|---|
[static]
The lattice pattern. | StandardPatterns | ||
latticeWide(rgba:* = 0xFF000000):Pattern [static]
The lattice wide pattern. | StandardPatterns | ||
[static]
The lozenge pattern. | StandardPatterns | ||
slantedLineA(rgba:* = 0xFF000000):Pattern [static]
The slanted line(A) pattern. | StandardPatterns | ||
slantedLineB(rgba:* = 0xFF000000):Pattern [static]
The slanted line(B) pattern. | StandardPatterns | ||
[static]
The solid bar pattern. | StandardPatterns | ||
[static]
The solid bold pattern. | StandardPatterns | ||
solidHorizonal(rgba:* = 0xFF000000):Pattern [static]
The solid horizontal pattern. | StandardPatterns | ||
[static]
The spot pattern. | StandardPatterns | ||
[static]
The X pattern. | StandardPatterns | ||
| lattice | () | method |
public static function lattice(rgba:* = 0xFF000000):PatternThe lattice pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| latticeWide | () | method |
public static function latticeWide(rgba:* = 0xFF000000):PatternThe lattice wide pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| lozenge | () | method |
public static function lozenge(rgba:* = 0xFF000000):PatternThe lozenge pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| slantedLineA | () | method |
public static function slantedLineA(rgba:* = 0xFF000000):PatternThe slanted line(A) pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| slantedLineB | () | method |
public static function slantedLineB(rgba:* = 0xFF000000):PatternThe slanted line(B) pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| solidBar | () | method |
public static function solidBar(rgba:* = 0xFF000000):PatternThe solid bar pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| solidBold | () | method |
public static function solidBold(rgba:* = 0xFF000000):PatternThe solid bold pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| solidHorizonal | () | method |
public static function solidHorizonal(rgba:* = 0xFF000000):PatternThe solid horizontal pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| spot | () | method |
public static function spot(rgba:* = 0xFF000000):PatternThe spot pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |
| x | () | method |
public static function x(rgba:* = 0xFF000000):PatternThe X pattern.
Parameters
rgba:* (default = 0xFF000000) — The RGBA or rgba Number value (default 0xFF000000)
|
Pattern |