Options
Menu

Class Graphics

Graphics is a collection of Shapes, each of which contain the actual geometrical data such as vertices, normals, uvs, etc. It also contains a reference to an animation class, which defines how the geometry moves. A Graphics object is assigned to a Sprite, a scene graph occurence of the geometry, which in turn assigns the SubGeometries to its respective TriangleGraphic objects.

class

Graphics

Hierarchy

  • AssetBase

Implements

  • IAsset
  • IAssetAdapter

Index

Constructors

constructor

  • Creates a new Graphics object.

    Parameters

    • Default value entity: IEntity = null

    Returns Graphics

Properties

_adapter

_adapter: IAssetAdapter

adaptee

adaptee: AssetBase

adapter

adapter: IAssetAdapter

adapter is used to provide MovieClip to scripts taken from different platforms setter typically managed by factory. getter defaults to AwayJS class

assetFullPath

assetFullPath: Array<string>

assetNamespace

assetNamespace: string

id

id: number

A unique id for the asset, used to identify assets in an associative array

minSlice9Height

minSlice9Height: number

minSlice9Width

minSlice9Width: number

name

name: string

numParticles

numParticles: number

originalName

originalName: string

The original name used for this asset in the resource (e.g. file) in which it was found. This may not be the same as name, which may have changed due to of a name conflict.

originalSlice9Size

originalSlice9Size: Rectangle

particles

particles: Array<ParticleData>

scaleStrokes

scaleStrokes: boolean

slice9Rectangle

slice9Rectangle: Rectangle

Static DEFAULT_NAMESPACE

DEFAULT_NAMESPACE: string

Static ID_COUNT

ID_COUNT: number

Static assetType

assetType: string

Accessors

animator

  • Defines the animator of the graphics object. Default value is null.

    Returns IAnimator

  • Defines the animator of the graphics object. Default value is null.

    Parameters

    Returns void

assetType

  • get (): string
  • Returns string

count

  • get (): number
  • Returns number

material

  • The material with which to render the Graphics.

    Returns IMaterial

  • The material with which to render the Graphics.

    Parameters

    Returns void

queued_fill_pathes

  • Returns Array<GraphicsPath>

  • Parameters

    Returns void

queued_stroke_pathes

  • Returns Array<GraphicsPath>

  • Parameters

    Returns void

style

  • Returns Style

  • Parameters

    Returns void

Methods

_hitTestPointInternal

  • _hitTestPointInternal(x: number, y: number): boolean
  • Parameters

    • x: number
    • y: number

    Returns boolean

acceptTraverser

  • Parameters

    Returns void

addEventListener

  • addEventListener(type: string, listener: function): void
  • Add an event listener

    method

    addEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

addShape

  • Adds a GraphicBase wrapping a Elements.

    Parameters

    Returns Shape

applyTransformation

  • applyTransformation(transform: Matrix3D): void
  • Parameters

    • transform: Matrix3D

    Returns void

assetPathEquals

  • assetPathEquals(name: string, ns: string): boolean
  • Parameters

    • name: string
    • ns: string

    Returns boolean

beginBitmapFill

  • beginBitmapFill(bitmap: BitmapImage2D, matrix?: Matrix, repeat?: boolean, smooth?: boolean): void
  • Fills a drawing area with a bitmap image. The bitmap can be repeated or tiled to fill the area. The fill remains in effect until you call the beginFill(), beginBitmapFill(), beginGradientFill(), or beginShaderFill() method. Calling the clear() method clears the fill.

    The application renders the fill whenever three or more points are drawn, or when the endFill() method is called.

    Parameters

    • bitmap: BitmapImage2D

      A transparent or opaque bitmap image that contains the bits to be displayed.

    • Default value matrix: Matrix = null

      A matrix object(of the flash.geom.Matrix class), which you can use to define transformations on the bitmap. For example, you can use the following matrix to rotate a bitmap by 45 degrees(pi/4 radians):

    • Default value repeat: boolean = true

      If true, the bitmap image repeats in a tiled pattern. If false, the bitmap image does not repeat, and the edges of the bitmap are used for any fill area that extends beyond the bitmap.

                <p>For example, consider the following bitmap(a 20 x
                20-pixel checkerboard pattern):</p>
      
                <p>When <code>repeat</code> is set to <code>true</code>(as
                in the following example), the bitmap fill repeats the
                bitmap:</p>
      
                <p>When <code>repeat</code> is set to <code>false</code>,
                the bitmap fill uses the edge pixels for the fill area
                outside the bitmap:</p>
      
    • Default value smooth: boolean = false

      If false, upscaled bitmap images are rendered by using a nearest-neighbor algorithm and look pixelated. If true, upscaled bitmap images are rendered by using a bilinear algorithm. Rendering by using the nearest neighbor algorithm is faster.

    Returns void

beginFill

  • beginFill(color: number, alpha?: number): void
  • Specifies a simple one-color fill that subsequent calls to other Graphics methods(such as lineTo() or drawCircle()) use when drawing. The fill remains in effect until you call the beginFill(), beginBitmapFill(), beginGradientFill(), or beginShaderFill() method. Calling the clear() method clears the fill.

    The application renders the fill whenever three or more points are drawn, or when the endFill() method is called.

    Parameters

    • color: number

      The color of the fill(0xRRGGBB).

    • Default value alpha: number = 1

      The alpha value of the fill(0.0 to 1.0).

    Returns void

beginGradientFill

  • beginGradientFill(type: string, colors: number[], alphas: number[], ratios: number[], matrix?: Matrix, spreadMethod?: string, interpolationMethod?: string, focalPointRatio?: number): void
  • Specifies a gradient fill used by subsequent calls to other Graphics methods(such as lineTo() or drawCircle()) for the object. The fill remains in effect until you call the beginFill(), beginBitmapFill(), beginGradientFill(), or beginShaderFill() method. Calling the clear() method clears the fill.

    The application renders the fill whenever three or more points are drawn, or when the endFill() method is called.

    throws

    ArgumentError If the type parameter is not valid.

    Parameters

    • type: string

      A value from the GradientType class that specifies which gradient type to use: GradientType.LINEAR or GradientType.RADIAL.

    • colors: number[]

      An array of RGB hexadecimal color values used in the gradient; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, specify a corresponding value in the alphas and ratios parameters.

    • alphas: number[]

      An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1. If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.

    • ratios: number[]

      An array of color distribution ratios; valid values are 0-255. This value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left position in the gradient box, and 255 represents the right position in the gradient box.

    • Default value matrix: Matrix = null

      A transformation matrix as defined by the flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method.

    • Default value spreadMethod: string = "pad"

      A value from the SpreadMethod class that specifies which spread method to use, either: SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPEAT.

                             <p>For example, consider a simple linear
                             gradient between two colors:</p>
      
                             <p>This example uses
                             <code>SpreadMethod.PAD</code> for the spread
                             method, and the gradient fill looks like the
                             following:</p>
      
                             <p>If you use <code>SpreadMethod.REFLECT</code>
                             for the spread method, the gradient fill looks
                             like the following:</p>
      
                             <p>If you use <code>SpreadMethod.REPEAT</code>
                             for the spread method, the gradient fill looks
                             like the following:</p>
      
    • Default value interpolationMethod: string = "rgb"

      A value from the InterpolationMethod class that specifies which value to use: InterpolationMethod.LINEAR_RGB or InterpolationMethod.RGB

                             <p>For example, consider a simple linear
                             gradient between two colors(with the
                             <code>spreadMethod</code> parameter set to
                             <code>SpreadMethod.REFLECT</code>). The
                             different interpolation methods affect the
                             appearance as follows: </p>
      
    • Default value focalPointRatio: number = 0

      A number that controls the location of the focal point of the gradient. 0 means that the focal point is in the center. 1 means that the focal point is at one border of the gradient circle. -1 means that the focal point is at the other border of the gradient circle. A value less than -1 or greater than 1 is rounded to -1 or 1. For example, the following example shows a focalPointRatio set to 0.75:

    Returns void

clear

  • clear(): void
  • Returns void

clearInternal

  • clearInternal(): void
  • Returns void

copyFrom

  • copyFrom(sourceGraphics: Graphics): void
  • Copies all of drawing commands from the source Graphics object into the calling Graphics object.

    Parameters

    • sourceGraphics: Graphics

      The Graphics object from which to copy the drawing commands.

    Returns void

copyTo

  • copyTo(graphics: Graphics, cloneShapes?: boolean): void
  • Parameters

    • graphics: Graphics
    • Default value cloneShapes: boolean = false

    Returns void

cubicCurveTo

  • cubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void
  • Draws a cubic Bezier curve from the current drawing position to the specified anchor point. Cubic Bezier curves consist of two anchor points and two control points. The curve interpolates the two anchor points and curves toward the two control points.

    The four points you use to draw a cubic Bezier curve with the cubicCurveTo() method are as follows:

    • The current drawing position is the first anchor point.
    • The anchorX and anchorY parameters specify the second anchor point.
    • The controlX1 and controlY1 parameters specify the first control point.
    • The controlX2 and controlY2 parameters specify the second control point.

    If you call the cubicCurveTo() method before calling the moveTo() method, your curve starts at position (0, 0).

    If the cubicCurveTo() method succeeds, the Flash runtime sets the current drawing position to (anchorX, anchorY). If the cubicCurveTo() method fails, the current drawing position remains unchanged.

    If your movie clip contains content created with the Flash drawing tools, the results of calls to the cubicCurveTo() method are drawn underneath that content.

    Parameters

    • controlX1: number

      Specifies the horizontal position of the first control point relative to the registration point of the parent display object.

    • controlY1: number

      Specifies the vertical position of the first control point relative to the registration point of the parent display object.

    • controlX2: number

      Specifies the horizontal position of the second control point relative to the registration point of the parent display object.

    • controlY2: number

      Specifies the vertical position of the second control point relative to the registration point of the parent display object.

    • anchorX: number

      Specifies the horizontal position of the anchor point relative to the registration point of the parent display object.

    • anchorY: number

      Specifies the vertical position of the anchor point relative to the registration point of the parent display object.

    Returns void

curveTo

  • curveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void
  • Draws a curve using the current line style from the current drawing position to(anchorX, anchorY) and using the control point that (controlX, controlY) specifies. The current drawing position is then set to(anchorX, anchorY). If the movie clip in which you are drawing contains content created with the Flash drawing tools, calls to the curveTo() method are drawn underneath this content. If you call the curveTo() method before any calls to the moveTo() method, the default of the current drawing position is(0, 0). If any of the parameters are missing, this method fails and the current drawing position is not changed.

    The curve drawn is a quadratic Bezier curve. Quadratic Bezier curves consist of two anchor points and one control point. The curve interpolates the two anchor points and curves toward the control point.

    Parameters

    • controlX: number

      A number that specifies the horizontal position of the control point relative to the registration point of the parent display object.

    • controlY: number

      A number that specifies the vertical position of the control point relative to the registration point of the parent display object.

    • anchorX: number

      A number that specifies the horizontal position of the next anchor point relative to the registration point of the parent display object.

    • anchorY: number

      A number that specifies the vertical position of the next anchor point relative to the registration point of the parent display object.

    Returns void

dispatchEvent

  • dispatchEvent(event: EventBase): void
  • Dispatch an event

    method

    dispatchEvent

    Parameters

    • event: EventBase

    Returns void

dispose

  • dispose(): void
  • Clears all resources used by the Graphics object, including SubGeometries.

    Returns void

drawCircle

  • drawCircle(x: number, y: number, radius: number): void
  • Draws a circle. Set the line style, fill, or both before you call the drawCircle() method, by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method.

    Parameters

    • x: number

      The x location of the center of the circle relative to the registration point of the parent display object(in pixels).

    • y: number

      The y location of the center of the circle relative to the registration point of the parent display object(in pixels).

    • radius: number

      The radius of the circle(in pixels).

    Returns void

drawEllipse

  • drawEllipse(x: number, y: number, width: number, height: number): void
  • Draws an ellipse. Set the line style, fill, or both before you call the drawEllipse() method, by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method.

    Parameters

    • x: number

      The x location of the top-left of the bounding-box of the ellipse relative to the registration point of the parent display object(in pixels).

    • y: number

      The y location of the top left of the bounding-box of the ellipse relative to the registration point of the parent display object(in pixels).

    • width: number

      The width of the ellipse(in pixels).

    • height: number

      The height of the ellipse(in pixels).

    Returns void

drawGraphicsData

  • Submits a series of IGraphicsData instances for drawing. This method accepts a Vector containing objects including paths, fills, and strokes that implement the IGraphicsData interface. A Vector of IGraphicsData instances can refer to a part of a shape, or a complex fully defined set of data for rendering a complete shape.

    Graphics paths can contain other graphics paths. If the graphicsData Vector includes a path, that path and all its sub-paths are rendered during this operation.

    Parameters

    Returns void

drawPath

  • Submits a series of commands for drawing. The drawPath() method uses vector arrays to consolidate individual moveTo(), lineTo(), and curveTo() drawing commands into a single call. The drawPath() method parameters combine drawing commands with x- and y-coordinate value pairs and a drawing direction. The drawing commands are values from the GraphicsPathCommand class. The x- and y-coordinate value pairs are Numbers in an array where each pair defines a coordinate location. The drawing direction is a value from the GraphicsPathWinding class.

    Generally, drawings render faster with drawPath() than with a series of individual lineTo() and curveTo() methods.

    The drawPath() method uses a uses a floating computation so rotation and scaling of shapes is more accurate and gives better results. However, curves submitted using the drawPath() method can have small sub-pixel alignment errors when used in conjunction with the lineTo() and curveTo() methods.

    The drawPath() method also uses slightly different rules for filling and drawing lines. They are:

    • When a fill is applied to rendering a path:
      • A sub-path of less than 3 points is not rendered.(But note that the stroke rendering will still occur, consistent with the rules for strokes below.)
      • A sub-path that isn't closed(the end point is not equal to the begin point) is implicitly closed.
    • When a stroke is applied to rendering a path:
      • The sub-paths can be composed of any number of points.
      • The sub-path is never implicitly closed.

    Parameters

    • commands: Array<number>
    • data: Array<number>
    • winding: GraphicsPathWinding

      Specifies the winding rule using a value defined in the GraphicsPathWinding class.

    Returns void

drawRect

  • drawRect(x: number, y: number, width: number, height: number): void
  • Draws a rectangle. Set the line style, fill, or both before you call the drawRect() method, by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method.

    throws

    ArgumentError If the width or height parameters are not a number (Number.NaN).

    Parameters

    • x: number

      A number indicating the horizontal position relative to the registration point of the parent display object(in pixels).

    • y: number

      A number indicating the vertical position relative to the registration point of the parent display object(in pixels).

    • width: number

      The width of the rectangle(in pixels).

    • height: number

      The height of the rectangle(in pixels).

    Returns void

drawRoundRect

  • drawRoundRect(x: number, y: number, width: number, height: number, ellipseWidth: number, ellipseHeight?: number): void
  • Draws a rounded rectangle. Set the line style, fill, or both before you call the drawRoundRect() method, by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method.

    throws

    ArgumentError If the width, height, ellipseWidth or ellipseHeight parameters are not a number(Number.NaN).

    Parameters

    • x: number

      A number indicating the horizontal position relative to the registration point of the parent display object(in pixels).

    • y: number

      A number indicating the vertical position relative to the registration point of the parent display object (in pixels).

    • width: number

      The width of the round rectangle(in pixels).

    • height: number

      The height of the round rectangle(in pixels).

    • ellipseWidth: number

      The width of the ellipse used to draw the rounded corners(in pixels).

    • Default value ellipseHeight: number = NaN

      The height of the ellipse used to draw the rounded corners(in pixels). Optional; if no value is specified, the default value matches that provided for the ellipseWidth parameter.

    Returns void

drawRoundRectComplex

  • drawRoundRectComplex(x: number, y: number, width: number, height: number, topLeftRadius: number, topRightRadius: number, bottomLeftRadius: number, bottomRightRadius: number): void
  • Parameters

    • x: number
    • y: number
    • width: number
    • height: number
    • topLeftRadius: number
    • topRightRadius: number
    • bottomLeftRadius: number
    • bottomRightRadius: number

    Returns void

drawTriangles

  • drawTriangles(vertices: Array<number>, indices?: Array<number>, uvtData?: Array<number>, culling?: TriangleCulling): void
  • Renders a set of triangles, typically to distort bitmaps and give them a three-dimensional appearance. The drawTriangles() method maps either the current fill, or a bitmap fill, to the triangle faces using a set of(u,v) coordinates.

    Any type of fill can be used, but if the fill has a transform matrix that transform matrix is ignored.

    A uvtData parameter improves texture mapping when a bitmap fill is used.

    Parameters

    • vertices: Array<number>
    • Default value indices: Array<number> = null
    • Default value uvtData: Array<number> = null
    • Default value culling: TriangleCulling = null

      Specifies whether to render triangles that face in a specified direction. This parameter prevents the rendering of triangles that cannot be seen in the current view. This parameter can be set to any value defined by the TriangleCulling class.

    Returns void

draw_fills

  • draw_fills(): void
  • Returns void

draw_strokes

  • draw_strokes(): void
  • Returns void

endFill

  • endFill(): void
  • Applies a fill to the lines and curves that were added since the last call to the beginFill(), beginGradientFill(), or beginBitmapFill() method. Flash uses the fill that was specified in the previous call to the beginFill(), beginGradientFill(), or beginBitmapFill() method. If the current drawing position does not equal the previous position specified in a moveTo() method and a fill is defined, the path is closed with a line and then filled.

    Returns void

getBoxBounds

  • getBoxBounds(): Box
  • Returns Box

getShapeAt

  • getShapeAt(index: number): Shape
  • Parameters

    • index: number

    Returns Shape

getShapeIndex

  • getShapeIndex(shape: Shape): number
  • Parameters

    Returns number

getSphereBounds

  • getSphereBounds(center: Vector3D, target?: Sphere): Sphere
  • Parameters

    • center: Vector3D
    • Default value target: Sphere = null

    Returns Sphere

hasEventListener

  • hasEventListener(type: string, listener?: function): boolean
  • check if an object has an event listener assigned to it

    method

    hasListener

    Parameters

    • type: string
    • Optional listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns boolean

invalidate

  • invalidate(): void
  • Returns void

invalidateElements

  • invalidateElements(): void
  • Returns void

invalidateMaterials

  • invalidateMaterials(): void
  • Returns void

isAsset

  • isAsset(assetClass: IAssetClass): boolean
  • Parameters

    • assetClass: IAssetClass

    Returns boolean

lineBitmapStyle

  • lineBitmapStyle(bitmap: BitmapImage2D, matrix?: Matrix, repeat?: boolean, smooth?: boolean): void
  • Specifies a bitmap to use for the line stroke when drawing lines.

    The bitmap line style is used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. The line style remains in effect until you call the lineStyle() or lineGradientStyle() methods, or the lineBitmapStyle() method again with different parameters.

    You can call the lineBitmapStyle() method in the middle of drawing a path to specify different styles for different line segments within a path.

    Call the lineStyle() method before you call the lineBitmapStyle() method to enable a stroke, or else the value of the line style is undefined.

    Calls to the clear() method set the line style back to undefined.

    Parameters

    • bitmap: BitmapImage2D

      The bitmap to use for the line stroke.

    • Default value matrix: Matrix = null

      An optional transformation matrix as defined by the flash.geom.Matrix class. The matrix can be used to scale or otherwise manipulate the bitmap before applying it to the line style.

    • Default value repeat: boolean = true

      Whether to repeat the bitmap in a tiled fashion.

    • Default value smooth: boolean = false

      Whether smoothing should be applied to the bitmap.

    Returns void

lineGradientStyle

  • lineGradientStyle(type: GradientType, colors: Array<number>, alphas: Array<number>, ratios: Array<number>, matrix?: Matrix, spreadMethod?: SpreadMethod, interpolationMethod?: InterpolationMethod, focalPointRatio?: number): void
  • Specifies a gradient to use for the stroke when drawing lines.

    The gradient line style is used for subsequent calls to Graphics methods such as the lineTo() methods or the drawCircle() method. The line style remains in effect until you call the lineStyle() or lineBitmapStyle() methods, or the lineGradientStyle() method again with different parameters.

    You can call the lineGradientStyle() method in the middle of drawing a path to specify different styles for different line segments within a path.

    Call the lineStyle() method before you call the lineGradientStyle() method to enable a stroke, or else the value of the line style is undefined.

    Calls to the clear() method set the line style back to undefined.

    Parameters

    • type: GradientType

      A value from the GradientType class that specifies which gradient type to use, either GradientType.LINEAR or GradientType.RADIAL.

    • colors: Array<number>

      An array of RGB hexadecimal color values used in the gradient; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, specify a corresponding value in the alphas and ratios parameters.

    • alphas: Array<number>

      An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1. If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.

    • ratios: Array<number>

      An array of color distribution ratios; valid values are 0-255. This value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left position in the gradient box, and 255 represents the right position in the gradient box.

    • Default value matrix: Matrix = null

      A transformation matrix as defined by the flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the lineGradientStyle() method.

    • Default value spreadMethod: SpreadMethod = null

      A value from the SpreadMethod class that specifies which spread method to use:

    • Default value interpolationMethod: InterpolationMethod = null

      A value from the InterpolationMethod class that specifies which value to use. For example, consider a simple linear gradient between two colors(with the spreadMethod parameter set to SpreadMethod.REFLECT). The different interpolation methods affect the appearance as follows:

    • Default value focalPointRatio: number = 0

      A number that controls the location of the focal point of the gradient. The value 0 means the focal point is in the center. The value 1 means the focal point is at one border of the gradient circle. The value -1 means that the focal point is at the other border of the gradient circle. Values less than -1 or greater than 1 are rounded to -1 or 1. The following image shows a gradient with a focalPointRatio of -0.75:

    Returns void

lineStyle

  • lineStyle(thickness?: number, color?: number, alpha?: number, pixelHinting?: boolean, scaleMode?: LineScaleMode, capstyle?: number, jointstyle?: number, miterLimit?: number): void
  • Specifies a line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. The line style remains in effect until you call the lineGradientStyle() method, the lineBitmapStyle() method, or the lineStyle() method with different parameters.

    You can call the lineStyle() method in the middle of drawing a path to specify different styles for different line segments within the path.

    Note: Calls to the clear() method set the line style back to undefined.

    Note: Flash Lite 4 supports only the first three parameters (thickness, color, and alpha).

    Parameters

    • Default value thickness: number = 0

      An integer that indicates the thickness of the line in points; valid values are 0-255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, the default is 0. The value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the default is 255.

    • Default value color: number = 0

      A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value is not indicated, the default is 0x000000 (black). Optional.

    • Default value alpha: number = 1

      A number that indicates the alpha value of the color of the line; valid values are 0 to 1. If a value is not indicated, the default is 1(solid). If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.

    • Default value pixelHinting: boolean = false
    • Default value scaleMode: LineScaleMode = null

      (Not supported in Flash Lite 4) A value from the LineScaleMode class that specifies which scale mode to use:

      • LineScaleMode.NORMAL - Always scale the line thickness when the object is scaled (the default).
      • LineScaleMode.NONE - Never scale the line thickness.
      • LineScaleMode.VERTICAL - Do not scale the line thickness if the object is scaled vertically only. For example, consider the following circles, drawn with a one-pixel line, and each with the scaleMode parameter set to LineScaleMode.VERTICAL. The circle on the left is scaled vertically only, and the circle on the right is scaled both vertically and horizontally:
      • LineScaleMode.HORIZONTAL - Do not scale the line thickness if the object is scaled horizontally only. For example, consider the following circles, drawn with a one-pixel line, and each with the scaleMode parameter set to LineScaleMode.HORIZONTAL. The circle on the left is scaled horizontally only, and the circle on the right is scaled both vertically and horizontally:

    • Default value capstyle: number = CapsStyle.NONE
    • Default value jointstyle: number = JointStyle.MITER
    • Default value miterLimit: number = 100

      (Not supported in Flash Lite 4) A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255(and values outside that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.

                      <p>For example, consider the following angled lines,
                      each drawn with a <code>thickness</code> of 20, but
                      with <code>miterLimit</code> set to 1, 2, and 4.
                      Superimposed are black reference lines showing the
                      meeting points of the joints:</p>
      
                      <p>Notice that a given <code>miterLimit</code> value
                      has a specific maximum angle for which the miter is
                      cut off. The following table lists some examples:</p>
      

    Returns void

lineTo

  • lineTo(x: number, y: number): void
  • Draws a line using the current line style from the current drawing position to(x, y); the current drawing position is then set to(x, y). If the display object in which you are drawing contains content that was created with the Flash drawing tools, calls to the lineTo() method are drawn underneath the content. If you call lineTo() before any calls to the moveTo() method, the default position for the current drawing is(0, 0). If any of the parameters are missing, this method fails and the current drawing position is not changed.

    Parameters

    • x: number

      A number that indicates the horizontal position relative to the registration point of the parent display object(in pixels).

    • y: number

      A number that indicates the vertical position relative to the registration point of the parent display object(in pixels).

    Returns void

moveTo

  • moveTo(x: number, y: number): void
  • Moves the current drawing position to(x, y). If any of the parameters are missing, this method fails and the current drawing position is not changed.

    Parameters

    • x: number

      A number that indicates the horizontal position relative to the registration point of the parent display object(in pixels).

    • y: number

      A number that indicates the vertical position relative to the registration point of the parent display object(in pixels).

    Returns void

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Remove an event listener

    method

    removeEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

removeShape

  • removeShape(shape: Shape): void
  • Parameters

    Returns void

removeShapeAt

  • removeShapeAt(index: number): void
  • Parameters

    • index: number

    Returns void

resetAssetPath

  • resetAssetPath(name: string, ns?: string, overrideOriginal?: boolean): void
  • Parameters

    • name: string
    • Optional ns: string
    • Optional overrideOriginal: boolean

    Returns void

scale

  • scale(scale: number): void
  • Scales the geometry.

    Parameters

    • scale: number

      The amount by which to scale.

    Returns void

scaleUV

  • scaleUV(scaleU?: number, scaleV?: number): void
  • Scales the uv coordinates (tiling)

    Parameters

    • Default value scaleU: number = 1

      The amount by which to scale on the u axis. Default is 1;

    • Default value scaleV: number = 1

      The amount by which to scale on the v axis. Default is 1;

    Returns void

updateFullPath

  • updateFullPath(): void
  • Returns void

updateScale

  • updateScale(scaleX: number, scaleY: number): void
  • Parameters

    • scaleX: number
    • scaleY: number

    Returns void

updateSlice9

  • updateSlice9(scaleX: number, scaleY: number): void
  • Parameters

    • scaleX: number
    • scaleY: number

    Returns void

Static getGraphics

Static get_material_for_color

  • get_material_for_color(color: number, alpha: number): any
  • Parameters

    • color: number
    • alpha: number

    Returns any

Static get_material_for_gradient

Static storeGraphics

  • storeGraphics(graphics: Graphics): void
  • Parameters

    Returns void

Generated using TypeDoc