Libraries.Data.Formats.ScalableVectorGraphics.Path Documentation

The Circle class is an implementation of the path element in the SVG standard. Like other ScalableVectorGraphicsObjects the path class inherits global attributes but it also has its own attributes.

Example Code

Libraries.Data.Formats.ScalableVectorGraphics.all

// make a rectangle with rounded corners circle
use Libraries.Data.Formats.ScalableVectorGraphics.all

ScalableVectorGraphics canvas
canvas:SetSize(440, 440)
Path path
path:SetFill("none")
path:SetStroke("black")
path:SetStrokeWidth(3)
path:AddMoveTo(100, 100, false)
path:AddHorizontalLine(200)
path:AddArc(20, 20, 0, false, true, 20,20)
path:AddVerticalLine(220)
path:AddHorizontalLine(-240)
path:AddVerticalLine(-220)
path:AddArc(20,20, 0, false, true, 20, -20)
path:ClosePath()

canvas:Add(path)

output canvas:ToText()

Inherits from: Libraries.Language.Object, Libraries.Data.Formats.ScalableVectorGraphics.ScalableVectorGraphicsObject

Actions Documentation

AddArc(number xRadius, number yRadius, number rotation, boolean largeArcFlag, boolean sweepFlag, number x, number y)

This action adds an Elliptical Arc Curve command to the path. Elliptical arc curves are defined as portions of an ellipse. Due to the possibilites of connecting two points with an arc there are several flags to choose which arc to use to draw the curve. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number xRadius: the x-radius of the ellipse
  • number yRadius: the y-radius of the ellipse
  • number rotation: The angle in degrees to rotate the ellipse
  • boolean largeArcFlag: If true use the larger arc otherwise use the smaller one
  • boolean sweepFlag: If true use the arc that curves clockwise otherwise use the counterclockwise one
  • number x: X of point to end the curve
  • number y: Y of point to end the curve

AddArc(number xRadius, number yRadius, number rotation, boolean largeArcFlag, boolean sweepFlag, number x, number y, boolean relative)

This action adds an Elliptical Arc Curve command to the path. Elliptical arc curves are defined as portions of an ellipse. Due to the possibilites of connecting two points with an arc there are several flags to choose which arc to use to draw the curve. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number xRadius: the x-radius of the ellipse
  • number yRadius: the y-radius of the ellipse
  • number rotation: The angle in degrees to rotate the ellipse
  • boolean largeArcFlag: If true use the larger arc otherwise use the smaller one
  • boolean sweepFlag: If true use the arc that curves clockwise otherwise use the counterclockwise one
  • number x: X of point to end the curve
  • number y: Y of point to end the curve
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddCubicBezierCurve(number x1, number y1, number x2, number y2, number x, number y, boolean relative)

This action adds a Cubic Bezier Curve command to the path. This draws a bezier curve from the current point to the passed point while using two control points to draw a curve to the passed point. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x1: X of control point 1
  • number y1: Y of control point 1
  • number x2: X of control point 2
  • number y2: Y of control point 2
  • number x: X of point to end the curve
  • number y: Y of point to end the curve
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddCubicBezierCurve(number x1, number y1, number x2, number y2, number x, number y)

This action adds a Cubic Bezier Curve command to the path. This draws a bezier curve from the current point to the passed point while using two control points to draw a curve to the passed point. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x1: X of control point 1
  • number y1: Y of control point 1
  • number x2: X of control point 2
  • number y2: Y of control point 2
  • number x: X of point to end the curve
  • number y: Y of point to end the curve

AddDataAttribute(text attribute, text value)

text rgba = "rgba(" + stroke:GetRed()*255 + "," + stroke:GetGreen()*255 + "," + stroke:GetBlue()*255 + "," + stroke:GetAlpha()*255 + ")"

Parameters

  • text attribute
  • text value

AddHorizontalLine(number length)

This action adds a Horizontal Line command to the path. This draws a line from the current point of the passed length. A negative length will draw the line in the opposite direction. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number length: The length of line to draw

AddHorizontalLine(number length, boolean relative)

This action adds a Horizontal Line command to the path. This draws a line from the current point of the passed length. A negative length will draw the line in the opposite direction. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number length: The length of line to draw
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddLineTo(number x, number y, boolean relative)

This action adds a LineTo command to the path. This draws a line from the current point to the passed point. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x: The x position to move to
  • number y: The y position to move to
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddLineTo(number x, number y)

This action adds a LineTo command to the path. This draws a line from the current point to the passed point. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x: The x position to move to
  • number y: The y position to move to

AddMoveTo(number x, number y)

This action adds a MoveTo command to the path. This draws no lines but move the pointer where drawing will occur. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x: The x position to move to
  • number y: The y position to move to

AddMoveTo(number x, number y, boolean relative)

This action adds a MoveTo command to the path. This draws no lines but move the pointer where drawing will occur. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x: The x position to move to
  • number y: The y position to move to
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddQuadraticBezierCurve(number x1, number y1, number x, number y)

This action adds a Quadratic Bezier Curve command to the path. This draws a bezier curve from the current point to the passed point using a single control point to draw a curve. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x1: X of the control point
  • number y1: Y of the control point
  • number x: X of point to end the curve
  • number y: Y of point to end the curve

AddQuadraticBezierCurve(number x1, number y1, number x, number y, boolean relative)

This action adds a Quadratic Bezier Curve command to the path. This draws a bezier curve from the current point to the passed point using a single control point to draw a curve. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x1: X of the control point
  • number y1: Y of the control point
  • number x: X of point to end the curve
  • number y: Y of point to end the curve
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddShortcutBezierCurve(number x2, number y2, number x, number y)

This action adds a shortcutted Cubic Bezier Curve command to the path. This draws a bezier curve from the current point to the passed point while still using two control points to draw a curve to the passed point. The first control point is a reflection of the control point of the previous curve command so only the the second control point needs to be defined. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x2: X of control point 2
  • number y2: Y of control point 2
  • number x: X of point to end the curve
  • number y: Y of point to end the curve

AddShortcutBezierCurve(number x2, number y2, number x, number y, boolean relative)

This action adds a shortcutted Cubic Bezier Curve command to the path. This draws a bezier curve from the current point to the passed point while still using two control points to draw a curve to the passed point. The first control point is a reflection of the control point of the previous curve command so only the the second control point needs to be defined. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x2: X of control point 2
  • number y2: Y of control point 2
  • number x: X of point to end the curve
  • number y: Y of point to end the curve
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddSmoothQuadraticCurve(number x, number y, boolean relative)

This action adds a smooth Quadratic Bezier Curve command to the path. This curve's control point is a relection of the control point of the previous quadratic bezier curve command. If the previous command is not a quadratic curve then the control point is the same as the starting point. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number x: X of point to end the curve
  • number y: Y of point to end the curve
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddSmoothQuadraticCurve(integer x, integer y)

This action adds a smooth Quadratic Bezier Curve command to the path. This curve's control point is a relection of the control point of the previous quadratic bezier curve command. If the previous command is not a quadratic curve then the control point is the same as the starting point. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • integer x: X of point to end the curve
  • integer y: Y of point to end the curve

AddVerticalLine(number height, boolean relative)

This action adds a Vertical Line command to the path. This draws a line from the current point of the passed height. A negative height will draw the line in the opposite direction. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number height: The height of line to draw
  • boolean relative: If true use coordinates relative to the current point otherwise use absolute

AddVerticalLine(number height)

This action adds a Vertical Line command to the path. This draws a line from the current point of the passed height. A negative height will draw the line in the opposite direction. If the relative flag is not set it will be assumed that points are relative to the current point.

Parameters

  • number height: The height of line to draw

ClosePath()

This action adds the Close Path command to the path. THe current path is closed by connecting the last point to the initial point. If the points are different coordinates then a straight line is drawn between both points.

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

ConvertReservedCharacters(text value)

This action returns a new string that automatically converts any characters that are reserved in the HTML specification before placing them into the vector graphic. This prevents the graphic from not compiling in circumstances where a DataFrame created a graphic that used a reserved character.

Parameters

  • text value: the text to be converted

Return

text: A new text value with converted reserved characters.

DataToText()

This action builds the element based on the the commands added that define this path.

Return

text:

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetAriaDescribedBy()

This action will give a aria-describedby attribute to the SVG element. This aria-describedby can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaDescribedBy("This is a blue circle with a radius of 5.0")

GetAriaDescription()

This action will give a aria-description attribute to the SVG element. This aria-description can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaDescription("This is a blue circle with a radius of 5.0")

GetAriaHidden()

This action will give a aria-hidden attribute to the SVG element. This aria-hideen can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaHidden("true")

GetAriaLabel()

This action will give a aria-label attribute to the SVG element. This aria-label can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaLabel("My Circle")

GetAriaLabelledBy()

This action will give a aria-labelledby attribute to the SVG element. This aria-labelledby can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaLabelledBy("id")

GetAriaRoleDescription()

This action will give a aria-roledescription attribute to the SVG element. This aria-roledescription can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaRoleDescription("This is a blue circle with a radius of 5.0")

GetCloseTag(text name, boolean container)

This is an interal action that allows the ScalableVectorGraphicsObject generate the correct closing tag.

Parameters

  • text name
  • boolean container

Return

text:

GetColor()

This action returns the color of the object.

Return

text: the color of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetColor("navy")
output circle:GetColor()

GetDataValue(text attribute)

This action will give a stroke attribute to the SVG element. This attribute defines the color used to paint the outline of a shape. For shapes like lines that have no fill a stroke must be set so that the line will be visible.

Parameters

  • text attribute

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("navy")

GetDescription()

This action will return the currently set description to a ScalableVectorGraphicsObject.

Return

text: The current text description of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetDescription("This is my circle and it will be blue")
text myDescpription = circle:GetDescription()

GetFill()

This action returns the fill of the object.

Return

text: the fill of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("navy")
output circle:GetFill()

GetFillOpacity()

This action returns the fill opacity of the object.

Return

text: the fill opacity of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("navy")
circle:SetFillOpacity(0.7)
output circle:GetFillOpacity()

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetID()

This action returns the id of the object.

Return

text: the id of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetID("My Circle")
output circle:GetID()

GetOnBlur()

This action will give a blur event handler attribute to the SVG element. This blur can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Group group
group:SetOnBlur("console.log('hello world');")

GetOnFocus()

This action will give a focus event handler attribute to the SVG element. This focus can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Group group
group:SetOnFocus("console.log('hello world');")

GetPath()

This action returns the LinePath used to define the path. This is undefined by default, and must be set using SetPath.

Return

Libraries.Game.Graphics.LinePath: The LinePath that this path is copying.

GetPoint(integer index, integer canvasHeight)

This action builds the element based on the LinePath that defines this path. Which should be set before using ToText.

Parameters

  • integer index
  • integer canvasHeight

Return

Libraries.Compute.Vector2:

GetRole()

This action will give a role attribute to the SVG element. This role can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetRole("region")

GetStroke()

This action returns the stroke of the object.

Return

text: the stroke of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("navy")
output circle:GetStroke()

GetStrokeOpacity()

This action returns the stroke opacity of the object.

Return

text: the stroke opacity of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("navy")
circle:SetStrokeOpacity(0.7)
output circle:GetStrokeOpacity()

GetStrokeWidth()

This action returns the stroke width of the object. Since lengths can have varying units in SVG the unit will be appended to the returned length

Return

text: the stroke width with the unit appended if one was given.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStrokeWidth(5, "%")
text strokeWidth = circle:GetStrokeWidth()

GetStyle()

This action returns the style information of the object.

Return

text: the style information of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStyle("fill: skyblue; stroke: navy;")
output circle:GetStyle()

GetStyleClass()

This action will give a class attribute to the SVG element. This class can be for gerneral use by a web browser or for when using a styling sheet on the SVG file.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStyleClass("circleClass")

GetTabIndex()

This action returns the tab index of the object.

Return

integer: the tab index of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetTabIndex(5)
output circle:GetTabIndex()

GetTitle()

This action will return the currently set title of the object.

Return

text: The current title of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetTitle("My Circle")
text myTitle = circle:GetTitle()

GlobalAttributesToText()

This is an interal action that allows the ScalableVectorGraphicsObject to write out its global attributes.

Return

text:

HasDataAttribute(text attribute)

This action returns the fill opacity of the object.

Parameters

  • text attribute

Return

boolean: the fill opacity of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("navy")
circle:SetFillOpacity(0.7)
output circle:GetFillOpacity()

IsContainer()

This action is used internally by the system to designate whether the SVG element is a single tag or contains more objects within it.

Return

boolean:

IsOneLine()

This action is used internally by the system to designate whether the SVG element should print with new lines.

Return

boolean:

LinePathToText()

This action builds the element based on the LinePath that defines this path. Which should be set before using ToText.

Return

text:

SetAriaDescribedBy(text ariaDescribedBy)

This action will give a aria-describedby attribute to the SVG element. This aria-describedby can be for general use by a web browser.

Parameters

  • text ariaDescribedBy: The aria-describedby for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaDescribedBy("This is a blue circle with a radius of 5.0")

SetAriaDescription(text ariaDescription)

This action will give a aria-description attribute to the SVG element. This aria-description can be for general use by a web browser.

Parameters

  • text ariaDescription: The aria-description for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaDescription("This is a blue circle with a radius of 5.0")

SetAriaHidden(text ariaHidden)

This action will give a aria-hidden attribute to the SVG element. This aria-hideen can be for general use by a web browser.

Parameters

  • text ariaHidden: The aria-hidden for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaHidden("true")

SetAriaLabel(text ariaLabel)

This action will give a aria-label attribute to the SVG element. This aria-label can be for general use by a web browser.

Parameters

  • text ariaLabel: The aria-label name for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaLabel("My Circle")

SetAriaLabelledBy(text ariaLabelledBy)

This action will give a aria-labelledby attribute to the SVG element. This aria-labelledby can be for general use by a web browser.

Parameters

  • text ariaLabelledBy: The aria-labelledby name for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaLabelledBy("id")

SetAriaRoleDescription(text ariaRoleDescription)

This action will give a aria-roledescription attribute to the SVG element. This aria-roledescription can be for general use by a web browser.

Parameters

  • text ariaRoleDescription: The aria-roledescription for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaRoleDescription("This is a blue circle with a radius of 5.0")

SetCanvasSize(integer width, integer height)

This action tells the Path how large the canvas it will be added to is. This is needed to correctly position the Path on the canvas.

Parameters

  • integer width: The width of the SVG canvas.
  • integer height: The height of the SVG canvas.

SetColor(text color)

This action will give a color attribute to the SVG element. This attribute does not directly change an objects color. It provides a color for other attriubtes, such as fill and stroke that may not have a defined color, to inherit a color.

Parameters

  • text color: The color for the object. Color in SVG is defined by the CSS data type so this could be defined a keyword, the RGB cubic-coordinate system, or the HSL cyclindrical-coordinate system.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetColor("green")

SetDataAttribute(text attribute, text value)

This action will give a stroke attribute to the SVG element. This attribute defines the color used to paint the outline of a shape. For shapes like lines that have no fill a stroke must be set so that the line will be visible.

Parameters

  • text attribute
  • text value

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetStroke(blue)

SetDescription(text description)

This action will give a description to a ScalableVectorGraphicsObject. When an object has a non-empty description a description tag will be generated when the whole object is written out. A description in SVG functions similarly to the description of an image in HTML.

Parameters

  • text description: The text that will be the description of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetDescription("This is my circle and it will be blue")

SetFill(Libraries.Game.Graphics.Color fill)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color used to paint the object

Parameters

  • Libraries.Game.Graphics.Color: The fill attribute for the object. For shapes and text this will be a color and color in SVG is defined by the CSS data type so this could be defined a keyword, the RGB cubic-coordinate system, or the HSL cyclindrical-coordinate system.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetFill(blue)

SetFill(text fill)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color used to paint the object

Parameters

  • text fill: The fill attribute for the object. For shapes and text this will be a color and color in SVG is defined by the CSS data type so this could be defined a keyword, the RGB cubic-coordinate system, or the HSL cyclindrical-coordinate system.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("green")

SetFillOpacity(text opacity)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the object

Parameters

  • text opacity: The fill opacity attribute for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("green")
circle:SetFillOpacity("50%") // alternate: circle:SetFillOpacity("0.5")

SetFillOpacity(number opacity)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the object

Parameters

  • number opacity

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetFill(blue)
circle:SetFillOpacity(0.7)

SetFillOpacity(Libraries.Game.Graphics.Color opacity)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the object

Parameters

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetFill(blue)
circle:SetFillOpacity(blue) // alternate: circle:SetFillOpacity("1")

SetID(text id)

This action will give an ID attribute to the SVG element. This is useful in contexts where you need to reference an SVG element by a name such as when using a styling sheet with the SVG file.

Parameters

  • text id: The id of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetID("circle1")

SetIsContainer(boolean isContainer)

This action is used internally by the system to designate whether the SVG element is a single tag or contains more objects within it.

Parameters

  • boolean isContainer: true if it will contain other objects, false if not

SetIsOneLine(boolean isOneLine)

This action is used internally by the system to designate whether the SVG element should print with new lines.

Parameters

  • boolean isOneLine

SetOnBlur(text onBlur)

This action will give a blur event handler attribute to the SVG element. This blur can be for general use by a web browser.

Parameters

  • text onBlur: The onblur for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Group group
group:SetOnBlur("console.log('hello world');")

SetOnFocus(text onFocus)

This action will give a focus event handler attribute to the SVG element. This focus can be for general use by a web browser.

Parameters

  • text onFocus: The onfocus for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Group group
group:SetOnFocus("console.log('hello world');")

SetPath(Libraries.Game.Graphics.LinePath path)

This action sets the LinePath that will be used to define this path. This should be set before using ToText.

Parameters

SetRole(text role)

This action will give a role attribute to the SVG element. This role can be for general use by a web browser.

Parameters

  • text role: The role name for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetRole("region")

SetRotateTransform(number angle, number x, number y)

This action sets the width of the stroke of the SVG element. Shapes with an outline have a stroke width.

Parameters

  • number angle
  • number x
  • number y

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStrokeWidth(5)

SetRotateTransform(number angle)

This action sets the width of the stroke of the SVG element along with which unit to use. Shapes with an outline have a stroke width. In SVG, units are defined by unit identifiers giving by the CSS specification along with percentages.

Parameters

  • number angle

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStrokeWidth(5, "%")

SetScaleTransform(number x)

This action will give a stroke opacity attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the border of the object

Parameters

  • number x

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetStroke(blue)
circle:SetStrokeOpacity(blue) // alternate: circle:SetStrokeOpacity("1")

SetScaleTransform(number x, number y)

This action returns the stroke of the object.

Parameters

  • number x
  • number y

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("navy")
output circle:GetStroke()

SetSkewXTransform(number degrees)

This action will give a stroke opacity attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the border of the object

Parameters

  • number degrees

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetStroke(blue)
circle:SetStrokeOpacity(0.7)

SetSkewYTransform(number degrees)

This action will give a stroke opacity attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the border of the object

Parameters

  • number degrees

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("green")
circle:SetStrokeOpacity("50%") // alternate: circle:SetStrokeOpacity("0.5")

SetStroke(Libraries.Game.Graphics.Color stroke)

This action will give a stroke attribute to the SVG element. This attribute defines the color used to paint the outline of a shape. For shapes like lines that have no fill a stroke must be set so that the line will be visible.

Parameters

  • Libraries.Game.Graphics.Color: The stroke attribute for the object. For shapes and text this will be a color and color in SVG is defined by the CSS data type so this could be defined a keyword, the RGB cubic-coordinate system, or the HSL cyclindrical-coordinate system.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetStroke(blue)

SetStroke(text stroke)

This action will give a stroke attribute to the SVG element. This attribute defines the color used to paint the outline of a shape. For shapes like lines that have no fill a stroke must be set so that the line will be visible.

Parameters

  • text stroke: The stroke attribute for the object. For shapes and text this will be a color and color in SVG is defined by the CSS data type so this could be defined a keyword, the RGB cubic-coordinate system, or the HSL cyclindrical-coordinate system.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("navy")

SetStrokeDashArray(text strokeDashArray)

This action returns the stroke width of the object. Since lengths can have varying units in SVG the unit will be appended to the returned length

Parameters

  • text strokeDashArray

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStrokeWidth(5, "%")
text strokeWidth = circle:GetStrokeWidth()

SetStrokeOpacity(Libraries.Game.Graphics.Color opacity)

This action will give a stroke opacity attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the border of the object

Parameters

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetStroke(blue)
circle:SetStrokeOpacity(blue) // alternate: circle:SetStrokeOpacity("1")

SetStrokeOpacity(number opacity)

This action will give a stroke opacity attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the border of the object

Parameters

  • number opacity

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetStroke(blue)
circle:SetStrokeOpacity(0.7)

SetStrokeOpacity(text opacity)

This action will give a stroke opacity attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the border of the object

Parameters

  • text opacity: The stroke opacity attribute for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("green")
circle:SetStrokeOpacity("50%") // alternate: circle:SetStrokeOpacity("0.5")

SetStrokeWidth(number strokeWidth)

This action sets the width of the stroke of the SVG element. Shapes with an outline have a stroke width.

Parameters

  • number strokeWidth: The width of the stroke

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStrokeWidth(5)

SetStrokeWidth(number strokeWidth, text unit)

This action sets the width of the stroke of the SVG element along with which unit to use. Shapes with an outline have a stroke width. In SVG, units are defined by unit identifiers giving by the CSS specification along with percentages.

Parameters

  • number strokeWidth: The width of the stroke
  • text unit: The unit of the length given.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStrokeWidth(5, "%")

SetStyle(text style)

This action will give a style attribute to the SVG element. This attribute also for embedding CSS declarations inline with the SVG element. Use of this attribute requires knowledge of CSS.

Parameters

  • text style: The style information that will be added to the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStyle("fill: skyblue; stroke: navy;")

SetStyleClass(text styleClass)

This action will give a class attribute to the SVG element. This class can be for gerneral use by a web browser or for when using a styling sheet on the SVG file.

Parameters

  • text styleClass

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStyleClass("circleClass")

SetTabIndex(integer tabIndex)

This action will give the ScalableVectorGraphicsObject a tab index. A non-negative tab index attribute will allow the element to be focusable and it can define the relative order for sequential navigation with the tab key. If two objects have the same tab index then whichever was added first is first in the naviagation. Default is 0 which means the item is focusable.

Parameters

  • integer tabIndex: The index of the object in the tab navigation.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle1
Circle circle2
Circle circle3
circle1:SetTabIndex(1)
circle2:SetTabIndex(2)
circle3:SetTabIndex(3)

SetTitle(text title)

This action will give a title to a ScalableVectorGraphicsObject. When an object has a non-empty title a title tag will be generated when the whole object is written out which will show the title as a popup box when hovering over the object in the final SVG file.

Parameters

  • text title: The text that will be the title of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetTitle("My Circle")

SetTranslateTransform(number x, number y)

This action returns the stroke opacity of the object.

Parameters

  • number x
  • number y

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("navy")
circle:SetStrokeOpacity(0.7)
output circle:GetStrokeOpacity()

ToText()

This action writes out all of the necessary tags and attributes that make up this ellipse. This action will be called automatically by the parent ScalableVectorGraphics, as such this action does not need to be used directly by the user.

Return

text: the formatted string of all tags and attributes for this shape