Scaleform Studio Lua API Reference: scaleform.ShapeComponent object reference
An interface to shape component.
This element inherits from:
Parameters Returns boolean |
A Boolean value of true if the path is started and false otherwise.
|
Parameters Returns boolean |
Whether the shape component was already cleared.
|
Parameters Returns boolean |
A Boolean value of true if the path is drawn closed or false otherwise.
|
Parameters w : | number |
The width of the gradient.
|
h : | number |
The height of the gradient.
|
rot : | number |
The rotation of gradient in radians.
|
tx : | number |
The translation of the gradient along the x axis.
|
ty : | number |
The translation of the gradient along the y axis.
|
Returns Matrix2F |
A matrix which can be used when setting the gradient styles on Shapes.
|
Parameters self : | scaleform.ShapeComponent |
The shape component to draw the circle in.
|
center : | scaleform.Point |
The location of the center of the circle relative to the registration point of
the parent actor (in pixels).
|
radius : | number |
The radius of the circle.
|
Returns boolean |
Whether the circle is drawn or not.
|
Parameters self : | scaleform.ShapeComponent |
The shape component to draw the curve in.
|
control : | scaleform.Point |
The position of the control point relative to the registration point of the
parent actor.
|
anchor : | scaleform.Point |
The position of the next anchor point relative to the registration point of the
parent actor.
|
Returns boolean |
A Boolean value of true if the drawing position is moved and false otherwise.
|
Parameters Returns boolean |
Whether the ellipse is drawn or not.
|
Parameters Returns boolean |
A Boolean value of true if the drawing position is moved and false otherwise.
|
The current drawing position is then set to (x, y).
Parameters Returns boolean |
Whether the rect is drawn or not.
|
Parameters Returns boolean |
Whether the rect is drawn or not.
|
Parameters self : | scaleform.ShapeComponent |
The shape component to draw the rounded rect in.
|
rect : | scaleform.Rect |
The rect relative to the registration point of the parent actor.
|
top_left_rad : | number |
The radius of the circle draw the top left corner.
|
top_right_rad : | number |
The radius of the circle draw the top right corner.
|
bot_left_rad : | number |
The radius of the circle draw the bottom left corner.
|
bot_right_rad : | number |
The radius of the circle draw the bottom right corner.
|
Returns boolean |
Whether the rect is drawn or not.
|
Parameters Returns boolean |
A Boolean value of true if the path is ended.
|
Parameters Returns boolean |
Returns true if the file was successfully loaded.
|
Parameters Returns boolean |
A Boolean value of true if the path is moved or false otherwise.
|
Parameters self : | scaleform.ShapeComponent |
The shape component to load.
|
imageRes : | lightuserdata |
The image to be filled with.
|
matrix : | Matrix2F |
A transformation matrix that can be used to scale or otherwise manipulate
the bitmap before applying it to the line style.
|
repeat : | boolean? |
Default value of true. A Boolean flag to repeat the bitmap in a tiled fashion.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
smooth : | boolean? |
Default value of true. A Boolean flag to smoothing should be applied to the bitmap.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns boolean |
Returns whether the area is filled with the image.
|
Parameters Returns | This function does not return any values. |
Parameters self : | scaleform.ShapeComponent |
The shape component to set the fill on.
|
color : | integer |
The BGR color encoded in an unsigned integer.
|
alpha : | number? |
The alpha for the color normalized from 0.0 to 1.0; Default is 1.0;
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns | This function does not return any values. |
Parameters self : | scaleform.ShapeComponent |
The shape component to fill.
|
gradType : | string |
The gradient type to fill in.
|
matrix : | Matrix2F |
A transformation matrix that can be used to scale or otherwise manipulate
the bitmap before applying it to the line style.
|
colors : | scaleform.Color[] |
Array of colors for the fill.
The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown. |
ratios : | number[] |
An array of color distribution ratios. Valid values are 0 to 1.0.
The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown. |
focalPointRatio : | number? |
Location of the focal point of the gradient.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
linearRGB : | boolean? |
Default value of true.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns | This function does not return any values. |
Parameters self : | scaleform.ShapeComponent |
The shape component to set the line gradient style of.
|
gradType : | string |
The gradient type to fill in.
|
matrix : | Matrix2F |
A transformation matrix that can be used to scale or otherwise manipulate the bitmap
before applying it to the line style.
|
colors : | scaleform.Color[] |
Array of colors for the fill.
The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown. |
ratios : | number[] |
An array of color distribution ratios. Valid values are 0 to 1.0.
The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown. |
focalPointRatio : | number? |
Location of the focal point of the gradient.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
linearRGB : | boolean? |
Default value of true.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns boolean |
A Boolean value of true if the style is set or false otherwise.
|
Parameters self : | scaleform.ShapeComponent |
The shape component to set the line style of.
|
thickness : | number |
The thickness of the line in points.
|
color : | integer |
The color of the line encoded as 8-bit channels in packed in BGR order.
|
alpha : | number? |
The alpha of the line from 0.0 to 1.0. Default is 1.0.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
pixelHinting : | boolean? |
Default value of false. A Boolean value that specifies whether to hint
strokes to full pixels.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
scaleMode : | integer? |
The scale mode to use for the line style
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
caps : | integer? |
The type of caps at the end of lines.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
joints : | integer? |
The type of joint appearance used at angles.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
miterLimit : | number? |
The limit at which a miter is cut off. Default value of 3.0f.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns boolean |
A Boolean value of true if the style is set or false otherwise.
|
Parameters self : | scaleform.ShapeComponent |
The shape component to set the line style of.
|
color : | scaleform.Color |
The color of the line.
|
pixelHinting : | boolean? |
Default value of false. A Boolean value that specifies whether to hint strokes
to full pixels.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
scaleMode : | integer? |
The scale mode to use for the line style
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
caps : | integer? |
The type of caps at the end of lines.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
joints : | integer? |
The type of joint appearance used at angles.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
miterLimit : | number? |
The limit at which a miter is cut off. Default value of 3.0f.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns boolean |
A Boolean value of true if the style is set or false otherwise.
|
Parameters Returns boolean |
Returns true if the shape component no line was set or false otherwise.
|
scaleform.Component
The root type of all actor components.
scaleform.VisualComponent
An interface to the visual component.
scaleform.physics.Fixture.shape (self) : scaleform.ShapeComponent
Returns the shape of the fixture.
scaleform.ShapeComponent.create (owner) : scaleform.ShapeComponent
Creates a shape component for the actor.
scaleform.ShapeComponent.begin_path (self, point) : boolean
Begins a path.
self : scaleform.ShapeComponent
The shape component to begin the path in.
point : scaleform.Point
The position to start the path at.
boolean
scaleform.ShapeComponent
An interface to shape component.
scaleform.Point
Point should be in the form of a table {x=a, y=b}
{ PropertyType : string, x : number, y : number, }true or false.
scaleform.ShapeComponent.clear (self) : boolean
Clears all drawing from the shape.
self : scaleform.ShapeComponent
The shape component to clear.
boolean
scaleform.ShapeComponent.close_path (self) : boolean
Draws a line from the path start position to the current position.
self : scaleform.ShapeComponent
The shape component to close the path in.
boolean
owner : scaleform.Actor
The actor parent of the newly created shape.
scaleform.ShapeComponent
A handle to the newly create shape component.
scaleform.Actor
Generic objects located in a scene.
scaleform.ShapeComponent.create_gradient_matrix (w, h, rot, tx, ty) : Matrix2F
w : number
The width of the gradient.
h : number
The height of the gradient.
rot : number
The rotation of gradient in radians.
tx : number
The translation of the gradient along the x axis.
ty : number
The translation of the gradient along the y axis.
Matrix2F
A matrix which can be used when setting the gradient styles on Shapes.A numeric value.
Matrix2F
A two-dimensional matrix in row-major order.
scaleform.ShapeComponent.draw_circle (self, center, radius) : boolean
Draws a circle using current line and fill styles.
self : scaleform.ShapeComponent
The shape component to draw the circle in.
center : scaleform.Point
The location of the center of the circle relative to the registration point of the parent actor (in pixels).
radius : number
The radius of the circle.
boolean
scaleform.ShapeComponent.draw_curve_to (self, control, anchor) : boolean
Draws a quadratic Bezier curve using the current line style from the current drawing position
to (anchorX, anchorY) and using the control point that (controlX, controlY) specifies.
self : scaleform.ShapeComponent
The shape component to draw the curve in.
control : scaleform.Point
The position of the control point relative to the registration point of the parent actor.
anchor : scaleform.Point
The position of the next anchor point relative to the registration point of the parent actor.
boolean
scaleform.ShapeComponent.draw_ellipse (self, center, size) : boolean
Draws a ellipse using current line and fill styles.
self : scaleform.ShapeComponent
The shape component to draw the ellipse in.
center : scaleform.Point
The location of the center of the circle relative to the registration point of the parent actor.
size : scaleform.Size
The width and height of the ellipse.
boolean
scaleform.Size
Width should be in the form of a table {width=a, height=b}
{ height : number, width : number, }
scaleform.ShapeComponent.draw_line_to (self, point) : boolean
Draws a line using the current line style from the current drawing position to (x, y).
self : scaleform.ShapeComponent
The shape component to draw the line in.
point : scaleform.Point
A point indicating the position relative to the registration point of the parent actor.
boolean
scaleform.ShapeComponent.draw_rect (self, rect) : boolean
Draws a rect using current line and fill styles.
self : scaleform.ShapeComponent
The shape component to draw the rect in.
rect : scaleform.Rect
The rect relative to the registration point of the parent actor.
boolean
scaleform.Rect
A rectangle based upon two points.
{ x1 : number, x2 : number, y1 : number, y2 : number, }
scaleform.ShapeComponent.draw_round_rect (self, rect, radii) : boolean
Draws a rounded rect using current line and fill styles.
self : scaleform.ShapeComponent
The shape component to draw the rounded rect in.
rect : scaleform.Rect
The rect relative to the registration point of the parent actor.
radii : scaleform.Size
The radii the ellipse used to draw the rounded corners.
boolean
scaleform.ShapeComponent.draw_round_rect_complex (self, rect, top_left_rad, top_right_rad, bot_left_rad, bot_right_rad) : boolean
Draws a complex rounded rect using current line and fill styles.
self : scaleform.ShapeComponent
The shape component to draw the rounded rect in.
rect : scaleform.Rect
The rect relative to the registration point of the parent actor.
top_left_rad : number
The radius of the circle draw the top left corner.
top_right_rad : number
The radius of the circle draw the top right corner.
bot_left_rad : number
The radius of the circle draw the bottom left corner.
bot_right_rad : number
The radius of the circle draw the bottom right corner.
boolean
scaleform.ShapeComponent.end_path (self) : boolean
Ends the current path.
self : scaleform.ShapeComponent
The shape component to end the path in.
boolean
scaleform.ShapeComponent.load (self, filename) : boolean
Loads a shape from a file.
self : scaleform.ShapeComponent
The shape component to load.
filename : string
The name of the file to load.
booleanA string of characters.
scaleform.ShapeComponent.move_to (self, point) : boolean
Moves the current drawing position to (x, y).
self : scaleform.ShapeComponent
The shape component to move the path in.
point : scaleform.Point
The position to move the path to.
boolean
scaleform.ShapeComponent.set_bitmap_fill (self, imageRes, matrix, repeat, smooth) : boolean
Fills a drawing area with a bitmap image.
self : scaleform.ShapeComponent
The shape component to load.
imageRes : lightuserdata
The image to be filled with.
matrix : Matrix2F
A transformation matrix that can be used to scale or otherwise manipulate the bitmap before applying it to the line style.
repeat : boolean?
Default value of true. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
smooth : boolean?
Default value of true. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
booleanA pointer to a memory block that is allocated and maintained in C.
scaleform.ShapeComponent.set_fill (self, color)
Begins a solid fill.
self : scaleform.ShapeComponent
The shape component to set the fill on.
color : scaleform.Color
The color to be filled with.
scaleform.Color
{ alpha : integer, blue : integer, green : integer, red : integer, }
scaleform.ShapeComponent.set_fill (self, color, alpha)
Begins a solid fill.
self : scaleform.ShapeComponent
The shape component to set the fill on.
color : integer
The BGR color encoded in an unsigned integer.
alpha : number?
The alpha for the color normalized from 0.0 to 1.0; Default is 1.0;The ? notation indicates that this type is optional: there may be zero or one instances of it.
A strictly integral numeric value, with no decimal component.
scaleform.ShapeComponent.set_gradient_fill (self, gradType, matrix, colors, ratios, focalPointRatio, linearRGB)
Sets a gradient fill.
self : scaleform.ShapeComponent
The shape component to fill.
gradType : string
The gradient type to fill in.
matrix : Matrix2F
A transformation matrix that can be used to scale or otherwise manipulate the bitmap before applying it to the line style.
colors : scaleform.Color[]
Array of colors for the fill.The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
ratios : number[]
An array of color distribution ratios. [more...]The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
focalPointRatio : number?
Location of the focal point of the gradient.The ? notation indicates that this type is optional: there may be zero or one instances of it.
linearRGB : boolean?
Default value of true.The ? notation indicates that this type is optional: there may be zero or one instances of it.
scaleform.ShapeComponent.set_line_gradient_style (self, gradType, matrix, colors, ratios, focalPointRatio, linearRGB) : boolean
Sets a gradient line style.
self : scaleform.ShapeComponent
The shape component to set the line gradient style of.
gradType : string
The gradient type to fill in.
matrix : Matrix2F
A transformation matrix that can be used to scale or otherwise manipulate the bitmap before applying it to the line style.
colors : scaleform.Color[]
Array of colors for the fill.The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
ratios : number[]
An array of color distribution ratios. [more...]The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
focalPointRatio : number?
Location of the focal point of the gradient.The ? notation indicates that this type is optional: there may be zero or one instances of it.
linearRGB : boolean?
Default value of true.The ? notation indicates that this type is optional: there may be zero or one instances of it.
boolean
scaleform.ShapeComponent.set_line_style (self, thickness, color, alpha, pixelHinting, scaleMode, caps, joints, miterLimit) : boolean
Specifies a line style used for subsequent calls to drawing methods such as the LineTo()
method or the DrawCircle() method.
self : scaleform.ShapeComponent
The shape component to set the line style of.
thickness : number
The thickness of the line in points.
color : integer
The color of the line encoded as 8-bit channels in packed in BGR order.
alpha : number?
The alpha of the line from 0.0 to 1.0. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
pixelHinting : boolean?
Default value of false. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
scaleMode : integer?
The scale mode to use for the line styleThe ? notation indicates that this type is optional: there may be zero or one instances of it.
caps : integer?
The type of caps at the end of lines.The ? notation indicates that this type is optional: there may be zero or one instances of it.
joints : integer?
The type of joint appearance used at angles.The ? notation indicates that this type is optional: there may be zero or one instances of it.
miterLimit : number?
The limit at which a miter is cut off. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
boolean
scaleform.ShapeComponent.set_line_style (self, color, pixelHinting, scaleMode, caps, joints, miterLimit) : boolean
Specifies a line style used for subsequent calls to drawing methods such as the LineTo()
method or the DrawCircle() method.
self : scaleform.ShapeComponent
The shape component to set the line style of.
color : scaleform.Color
The color of the line.
pixelHinting : boolean?
Default value of false. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
scaleMode : integer?
The scale mode to use for the line styleThe ? notation indicates that this type is optional: there may be zero or one instances of it.
caps : integer?
The type of caps at the end of lines.The ? notation indicates that this type is optional: there may be zero or one instances of it.
joints : integer?
The type of joint appearance used at angles.The ? notation indicates that this type is optional: there may be zero or one instances of it.
miterLimit : number?
The limit at which a miter is cut off. [more...]The ? notation indicates that this type is optional: there may be zero or one instances of it.
boolean
scaleform.ShapeComponent.set_no_line (self) : boolean
Enables or Disables drawing using the line style when performing drawing commands.
self : scaleform.ShapeComponent
The shape component to set the no line state.
boolean
self : scaleform.physics.Fixture
The fixture currently in use.
scaleform.ShapeComponent
The shape of the fixture.
scaleform.physics.Fixture
An interface to attach shapes to the fixtures.
Indicates a table.
This documentation uses the term table to mean an anonymous, temporary Lua table that contains named data values. You typically use these tables to pass data or settings to a function, or to hold data returned by a function.Indicates an object.
This documentation uses the term object to mean a named Lua table or userdata value that maintains a state. Some object types may have multiple instances existing at the same time, each with its own state; these objects typically have creation functions or accessors that you must call in order to get an instance. Some object types have only one instance, which you always access through the object's name.Indicates a named variable within a namespace, object or table; or an element within an enumeration.Indicates a code sample.Indicates an enumeration.
This documentation uses the term enumeration to mean a named Lua table that contains only a set of constant values. These values typically identify a predefined set of options for some setting or behavior. You might pass an enumeration value to a function, or test the value returned by a function against the items in the enumeration to see which option is currently set.Indicates a named variable within a namespace or object that has a pre-set constant value.Indicates a category: a semantic grouping of related API elements.Indicates a namespace.
This documentation uses the term namespace to mean a named Lua table that exists in only one single instance, intended as a container for an interface of related objects, functions and data variables.Indicates an output value returned by a function.Indicates a named function within a namespace or object.Indicates an input parameter for a function.