class openfl.canvas.Object

Available on all platforms

Instance Fields

var bottom:Float

Gets a value indicating the bottom-most pixel of this object along the y-axis. This is the equivalent of the y position plus height.

var bottomLeft:Point

Gets a Point indicating the bottom-left most corner of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var bottomMiddle:Point

Gets a Point indicating the bottom central position of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var bottomRight:Point

Gets a Point indicating the bottom-right most corner of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var centerLeft:Point

Gets a Point indicating the center left position of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var centerMiddle:Point

Gets a Point indicating the exact central position of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var centerRight:Point

Gets a Point indicating the center right position of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var fillAlpha:Float

Gets or sets a value indicating the opacity of the fill color.

var fillBitmapData:BitmapData

Gets or sets the bitmap data to use as the visual representation of a fill.

var fillBitmapMatrix:Matrix

Gets or sets the Matrix indicating the transformation, positioning and rotation of the bitmap to style.

var fillBitmapRepeat:Bool

Gets or sets a value indicating whether or not the bitmap will repeat (tile).

var fillBitmapSmooth:Bool

Gets or sets a value indicating whether or not the bitmap edges will smooth out (blur).

var fillColor:Color

Gets or sets a value indicating the solid Color of the object to fill. This sets the fillAlpha value of the given Color, respectively.

var fillFocalPointRatio:Float

Gets or sets a value indicating the focal point of the fill gradient, with values between -1 and 1, where 0 is the center.

var fillGradientAlphas:Array<Float>

Gets or sets a series of values indicating the opacity for each color indicated in fillGradientColors.

var fillGradientColors:Array<Color>

Gets or sets a series of values indicating the Colors to use in a gradient.

var fillGradientMatrix:Matrix

Gets or sets a matrix that indicates the transformation, positioning and rotation calculations for the given gradient.

var fillGradientRatios:Array<Int>

Gets or sets a series of values indicating the position ratio of each color indicated in fillGradientColors. These values go from 0-255.

var fillGradientSpreadMethod:SpreadMethod

Gets or sets a SpreadMethod that indicates how gradients will spread across the given texture or graphics.

var fillGradientType:GradientType

Gets or sets a value indicating either a LINEAR or RADIAL gradient.

var fillInterpolationMethod:InterpolationMethod

Gets or sets a value indicating how the fill gradient is rendered.

var height:Float

Gets or sets the height of this object.

var left:Float

Gets a value indicating the left-most pixel of this object along the x-axis. This is the equivalent of the x position.

var lineAlpha:Float

Gets or sets a value representing the opacity of lines or borders. This is a percentage value from 0-1.

var lineBitmapData:BitmapData

Gets or sets the bitmap data to use as the visual representation of a line.

var lineBitmapMatrix:Matrix

Gets or sets the Matrix indicating the transformation, positioning and rotation of the bitmap to style.

var lineBitmapRepeat:Bool

Gets or sets a value indicating whether or not the bitmap will repeat (tile).

var lineBitmapSmooth:Bool

Gets or sets a value indicating whether or not the bitmap edges will smooth out (blur).

var lineCapsStyle:CapsStyle

Gets or sets a value indicating the edges of a line. For example, ROUND will result in both ends of a line beiing rounded.

var lineColor:Color

Gets or sets the Color of the line when used to style borders or lines. This sets the lineAlpha value of the given Color, respectively.

var lineFocalPointRatio:Float

Gets or sets a value indicating the focal point of the line gradient, with values between -1 and 1, where 0 is the center.

var lineGradientAlphas:Array<Float>

Gets or sets a series of values indicating the opacity for each color indicated in lineGradientColors.

var lineGradientColors:Array<Color>

Gets or sets a series of values indicating the number of colors used in a gradient.

var lineGradientMatrix:Matrix

Gets or sets a matrix that indicates the transformation, positioning and rotation calculations for the given gradient.

var lineGradientRatios:Array<Int>

Gets or sets a series of values indicating the position ratio of each color indicated in lineGradientColors. These values go from 0-255.

var lineGradientSpreadMethod:SpreadMethod

Gets or sets a SpreadMethod that indicates how gradients will spread across the given texture or graphics.

var lineGradientType:GradientType

Gets or sets a value indicating either a LINEAR or RADIAL gradient.

var lineInterpolationMethod:InterpolationMethod

Gets or sets a value indicating how the line gradient is rendered.

var lineJointStyle:JointStyle

Gets or sets a value indicating the visual representation of lines that inter-connect. For example, ROUND will result in a border corner being rounded than completely rough; should not be confused with rounded rectangles.

var lineMiterLimit:Float

Gets or sets a value indicating the percentage limit of line thickness when JointStyle is set to MITER.

var linePixelHinting:Bool

Gets or sets a value indicating that lines will use full pixel hinting.

var lineScaleMode:LineScaleMode

Gets or sets a value indicating how lines are scaled when it's calling parent object is re-scaled.

var lineThickness:Float

Gets or sets the thickness of lines or borders. This can be a value from 0-255.

var right:Float

Gets a value indicating the right-most pixel of this object along the x-axis. This is the equivalent of the x position plus width.

var top:Float

Gets a value indicating the top-most pixel of this object along the y-axis. This is the equivalent of the y position.

var topLeft:Point

Gets a Point indicating the top-left most corner of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var topMiddle:Point

Gets a Point indicating the top central position of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var topRight:Point

Gets a Point indicating the top-right most corner of this object. If using any non-rectangular shape and you wish to acquire a Point from a given angle, you should call its respective function.

var width:Float

Gets or sets the width of this object.

var x:Float

Gets or sets position of this object on the x-axis.

var y:Float

Gets or sets the position of this object on the y-axis.

function new(?styleName:String = ''):Void

Creates a new object with the given style. If the StyleReader's CURRENT instance has been modified, the changes will take affect.

styleName

The name of the style as found in the JSON-formatted file to represent the visuals for this object.

function draw(g:Graphics, ?applyFill:Bool = false):Void

The function used to commit the drawing for this object. This will only apply styling unless drawn via a derived class.

g

The graphics component that this object is drawn to.

applyFill

A value indicating if fill styling options will be applied. Default is false.