API Documentation for: 0.2.8
Show:

pixiflash.Graphics Class

Extends PIXI.Graphics
Defined in: pixiflash.Graphics:11
Module: Pixi Flash

The class to emulate createjs.Graphics

Constructor

pixiflash.Graphics

()

Item Index

Properties

Methods

a

(
  • x
  • y
  • radius
  • startAngle
  • endAngle
  • anticlockwise
)
Graphics protected chainable

Defined in a:170

Shortcut to arc.

Parameters:

Returns:

Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

alphaFromColor

(
  • color
)
private

Defined in alphaFromColor:521

Get the alpha color from color string

Parameters:

at

(
  • x1
  • y1
  • x2
  • y2
  • radius
)
Graphics protected chainable

Defined in at:188

Shortcut to arcTo.

Parameters:

Returns:

Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

bf

() pixiflash.Graphics

Defined in bf:322

Placeholder method for a beginBitmapFill. Pixi does not support bitmap fills.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

bs

() pixiflash.Graphics

Defined in bs:350

Placeholder method for a beginBitmapStroke. Pixi does not support bitmap strokes.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

bt

(
  • cp1x
  • cp1y
  • cp2x
  • cp2y
  • x
  • y
)
pixiflash.Graphics

Defined in bt:80

Draws a bezier curve from the current drawing point to (x, y) using the control points (cp1x, cp1y) and (cp2x, cp2y). For detailed information, read the whatwg spec. A tiny API method "bt" also exists.

Parameters:

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

cp

() pixiflash.Graphics

Defined in cp:235

Closes the current path, effectively drawing a line from the current drawing point to the first drawing point specified since the fill or stroke was last set. A tiny API method "cp" also exists.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

dc

(
  • x
  • y
  • radius
)
Graphics protected chainable

Defined in dc:158

Shortcut to drawCircle.

Parameters:

  • x Number

    x coordinate center point of circle.

  • y Number

    y coordinate center point of circle.

  • radius Number

    Radius of circle.

Returns:

Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

de

(
  • x
  • y
  • width
  • height
)

Defined in de:205

Override the draw ellipse method

Parameters:

dr

(
  • x
  • y
  • w
  • h
)
Graphics protected chainable

Defined in dr:99

Shortcut to drawRect.

Parameters:

Returns:

Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

f

(
  • color
)
pixiflash.Graphics

Defined in f:268

Begins a fill with the specified color. This ends the current sub-path. A tiny API method "f" also exists.

Parameters:

  • color String

    A CSS compatible color value (ex. "red", "#FF0000", or "rgba(255,0,0,0.5)"). Setting to null will result in no fill.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

lf

(
  • colorArray
)
pixiflash.Graphics

Defined in lf:290

Placeholder method for a linear fill. Pixi does not support linear fills, so we just pick the first color in colorArray

Parameters:

  • colorArray Array

    An array of CSS compatible color values @see f

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

ls

() pixiflash.Graphics

Defined in ls:364

Placeholder method for a beginLinearGradientStroke. Pixi does not support gradient strokes.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

lt

(
  • x
  • y
)
pixiflash.Graphics

Defined in lt:63

Draws a line from the current drawing point to the specified position, which become the new current drawing point. A tiny API method "lt" also exists.

For detailed information, read the whatwg spec.

Parameters:

  • x Number

    The x coordinate the drawing point should draw to.

  • y Number

    The y coordinate the drawing point should draw to.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

mt

(
  • x
  • y
)
pixiflash.Graphics

Defined in mt:54

Moves the drawing point to the specified position. A tiny API method "mt" also exists.

Parameters:

  • x Number

    The x coordinate the drawing point should move to.

  • y Number

    The y coordinate the drawing point should move to.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls).

op

() pixiflash.Graphics private

Defined in op:251

Open path method for drawing, ensure that the draw shape is not closed

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

p

(
  • str
)
pixiflash.Graphics

Defined in p:436

Decodes a compact encoded path string into a series of draw instructions. This format is not intended to be human readable, and is meant for use by authoring tools. The format uses a base64 character set, with each character representing 6 bits, to define a series of draw commands.

Each command is comprised of a single "header" character followed by a variable number of alternating x and y position values. Reading the header bits from left to right (most to least significant): bits 1 to 3 specify the type of operation (0-moveTo, 1-lineTo, 2-quadraticCurveTo, 3-bezierCurveTo, 4-closePath, 5-7 unused). Bit 4 indicates whether position values use 12 bits (2 characters) or 18 bits (3 characters), with a one indicating the latter. Bits 5 and 6 are currently unused.

Following the header is a series of 0 (closePath), 2 (moveTo, lineTo), 4 (quadraticCurveTo), or 6 (bezierCurveTo) parameters. These parameters are alternating x/y positions represented by 2 or 3 characters (as indicated by the 4th bit in the command char). These characters consist of a 1 bit sign (1 is negative, 0 is positive), followed by an 11 (2 char) or 17 (3 char) bit integer value. All position values are in tenths of a pixel. Except in the case of move operations which are absolute, this value is a delta from the previous x or y position (as appropriate).

For example, the string "A3cAAMAu4AAA" represents a line starting at -150,0 and ending at 150,0.
A - bits 000000. First 3 bits (000) indicate a moveTo operation. 4th bit (0) indicates 2 chars per parameter.
n0 - 110111011100. Absolute x position of -150.0px. First bit indicates a negative value, remaining bits indicate 1500 tenths of a pixel.
AA - 000000000000. Absolute y position of 0.
I - 001100. First 3 bits (001) indicate a lineTo operation. 4th bit (1) indicates 3 chars per parameter.
Au4 - 000000101110111000. An x delta of 300.0px, which is added to the previous x value of -150.0px to provide an absolute position of +150.0px.
AAA - 000000000000000000. A y delta value of 0.

A tiny API method "p" also exists.

Parameters:

  • str String

    The path string to decode.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

qt

(
  • cpx
  • cpy
  • x
  • y
)
pixiflash.Graphics

Defined in qt:219

Draws a quadratic curve from the current drawing point to (x, y) using the control point (cpx, cpy). For detailed information, read the whatwg spec. A tiny API method "qt" also exists.

Parameters:

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

r

(
  • x
  • y
  • w
  • h
)
Graphics protected chainable

Defined in r:110

Shortcut to drawRect.

Parameters:

Returns:

Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

rc

(
  • x
  • y
  • w
  • h
  • radius
)
Graphics protected chainable

Defined in rc:137

Shortcut to drawRoundRectComplex. Not supported by pixiflash

Parameters:

Returns:

Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

rf

(
  • colorArray
)
pixiflash.Graphics

Defined in rf:306

Placeholder method for a radial fill. Pixi does not support radial fills, so we just pick the first color in colorArray

Parameters:

  • colorArray Array

    An array of CSS compatible color values @see f

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

rr

(
  • x
  • y
  • w
  • h
  • radius
)
Graphics protected chainable

Defined in rr:123

Shortcut to drawRoundedRect.

Parameters:

Returns:

Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

rs

() pixiflash.Graphics

Defined in rs:378

Placeholder method for a beginRadialGradientStroke. Pixi does not support gradient strokes.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

s

(
  • color
)
pixiflash.Graphics

Defined in s:419

Begins a stroke with the specified color. This ends the current sub-path. A tiny API method "s" also exists.

Parameters:

  • color String

    A CSS compatible color value (ex. "#FF0000", "red", or "rgba(255,0,0,0.5)"). Setting to null will result in no stroke.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

sd

() pixiflash.Graphics

Defined in sd:336

Placeholder method for a setStrokeDash. Pixi does not support dashed strokes.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

ss

(
  • thickness
  • [caps=0]
  • [joints=0]
  • [miterLimit=10]
  • [ignoreScale=false]
)
pixiflash.Graphics

Defined in ss:392

Sets the stroke style. Like all drawing methods, this can be chained, so you can define the stroke style and color in a single line of code like so:

myGraphics.setStrokeStyle(8,"round").beginStroke("#F00");
                    

A tiny API method "ss" also exists.

Parameters:

  • thickness Number

    The width of the stroke.

  • [caps=0] String | Number optional

    Indicates the type of caps to use at the end of lines. One of butt, round, or square. Defaults to "butt". Also accepts the values 0 (butt), 1 (round), and 2 (square) for use with the tiny API.

  • [joints=0] String | Number optional

    Specifies the type of joints that should be used where two lines meet. One of bevel, round, or miter. Defaults to "miter". Also accepts the values 0 (miter), 1 (round), and 2 (bevel) for use with the tiny API.

  • [miterLimit=10] Number optional

    If joints is set to "miter", then you can specify a miter limit ratio which controls at what point a mitered joint will be clipped.

  • [ignoreScale=false] Boolean optional

    If true, the stroke will be drawn at the specified thickness regardless of active transformations.

Returns:

pixiflash.Graphics:

The Graphics instance the method is called on (useful for chaining calls.)

Properties

BASE_64

Object private final static

Defined in BASE_64:36

Map of Base64 characters to values. Used by Graphics/decodePath.