Circle
Package: Libraries.Data.Formats.ScalableVectorGraphics · Inherits from: Libraries.Language.Object, Libraries.Data.Formats.ScalableVectorGraphics.ScalableVectorGraphicsObject
The Circle class is an implementation of the circle shape in the SVG standard. Like other ScalableVectorGraphicsObjects the circle class inherits global attributes but it also has its own attributes such as the position of the center point and radius.
Example Code
Libraries.Data.Formats.ScalableVectorGraphics.all
// make an svg circle
Circle circle
canvas:SetSize(100,100)
circle:SetPosition(50, 50)
circle:SetRadius(20)
circle:SetFill("green")
Actions
GetPositionX()
This action returns the x position of the center of the circle with the unit appended.
Returns
text: the x position of the circle.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
output circle:GetPositionX()
GetPositionY()
This action returns the y position of the center of the circle with the unit appended.
Returns
text: the y position of the circle.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
output circle:GetPositionY()
GetRadius()
This action returns the radius of the center of the circle with the unit appended.
Returns
text: the radius of the circle.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
output circle:GetRadius()
SetPosition(number x, number y, text unit)
This action sets the position of the circle along with a unit. Circles are positioned based on their center point. In SVG, units are defined by unit identifiers giving by the CSS specification along with percentages.
Parameters
xnumber: The x position of the center of the circle.ynumber: The y position of the center of the circle.unittext: The unit of the length given. Applied to both x and y.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
circle:SetPosition(50,50, "pt")
SetPosition(number x, number y)
This action sets the position of the circle. Circles are positioned based on their center point.
Parameters
xnumber: The x position of the center of the circle.ynumber: The y position of the center of the circle.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
circle:SetPosition(50,50)
SetPositionX(number x, text unit)
This action sets the x position of the circle along with a unit. Circles are positioned based on their center point. In SVG, units are defined by unit identifiers giving by the CSS specification along with percentages.
Parameters
xnumber: The x position of the center of the circle.unittext: The unit of the length given. Applied to both x and y.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
circle:SetPositionX(5, "%")
SetPositionX(number x)
This action sets the x position of the circle. Circles are positioned based on their center point.
Parameters
xnumber: The x position of the center of the circle.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
circle:SetPositionX(50)
SetPositionY(number y)
This action sets the y position of the circle. Circles are positioned based on their center point.
Parameters
ynumber: The y position of the center of the circle.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
circle:SetPositionY(50)
SetPositionY(number y, text unit)
This action sets the y position of the circle along with a unit. Circles are positioned based on their center point. In SVG, units are defined by unit identifiers giving by the CSS specification along with percentages.
Parameters
ynumber: The y position of the center of the circle.unittext: The unit of the length given. Applied to both x and y.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
circle:SetPositionY(5, "%")
SetRadius(number radius, text unit)
This action sets the radius of the circle along with a unit. In SVG, units are defined by unit identifiers giving by the CSS specification along with percentages.
Parameters
radiusnumber: The radius of the circle.unittext: The unit of the length given. Applied to both x and y.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
circle:SetRadius(5, "%")
SetRadius(number radius)
This action sets the radius of the circle.
Parameters
radiusnumber: The radius of the circle.
Example
Libraries.Data.Formats.ScalableVectorGraphics.all
Circle circle
circle:SetRadius(20)
ToText()
This action writes out all of the necessary tags and attributes that make up this circle. This action will be called automatically by the parent ScalableVectorGraphics, as such this action does not need to be used directly by the user.
Returns
text: the formatted string of all tags and attributes for this shape
Inherited Actions
68 actions from Libraries.Data.Formats.ScalableVectorGraphics.ScalableVectorGraphicsObject
- AddDataAttribute(text attribute, text value)
- ConvertReservedCharacters(text value)
- GetAriaDescribedBy()
- GetAriaDescription()
- GetAriaHidden()
- GetAriaLabel()
- GetAriaLabelledBy()
- GetAriaRoleDescription()
- GetCloseTag(text name, boolean container)
- GetColor()
- GetDataValue(text attribute)
- GetDescription()
- GetFill()
- GetFillOpacity()
- GetID()
- GetOnBlur()
- GetOnFocus()
- GetRole()
- GetStroke()
- GetStrokeOpacity()
- GetStrokeWidth()
- GetStyle()
- GetStyleClass()
- GetTabIndex()
- GetTitle()
- GlobalAttributesToText()
- HasDataAttribute(text attribute)
- IsContainer()
- IsOneLine()
- SetAriaDescribedBy(text ariaDescribedBy)
- SetAriaDescription(text ariaDescription)
- SetAriaHidden(text ariaHidden)
- SetAriaLabel(text ariaLabel)
- SetAriaLabelledBy(text ariaLabelledBy)
- SetAriaRoleDescription(text ariaRoleDescription)
- SetColor(text color)
- SetDataAttribute(text attribute, text value)
- SetDescription(text description)
- SetFill(Libraries.Game.Graphics.Color fill)
- SetFill(text fill)
- SetFillOpacity(text opacity)
- SetFillOpacity(number opacity)
- SetFillOpacity(Libraries.Game.Graphics.Color opacity)
- SetID(text id)
- SetIsContainer(boolean isContainer)
- SetIsOneLine(boolean isOneLine)
- SetOnBlur(text onBlur)
- SetOnFocus(text onFocus)
- SetRole(text role)
- SetRotateTransform(number angle, number x, number y)
- SetRotateTransform(number angle)
- SetScaleTransform(number x, number y)
- SetScaleTransform(number x)
- SetSkewXTransform(number degrees)
- SetSkewYTransform(number degrees)
- SetStroke(text stroke)
- SetStroke(Libraries.Game.Graphics.Color stroke)
- SetStrokeDashArray(text strokeDashArray)
- SetStrokeOpacity(number opacity)
- SetStrokeOpacity(text opacity)
- SetStrokeOpacity(Libraries.Game.Graphics.Color opacity)
- SetStrokeWidth(number strokeWidth)
- SetStrokeWidth(number strokeWidth, text unit)
- SetStyle(text style)
- SetStyleClass(text styleClass)
- SetTabIndex(integer tabIndex)
- SetTitle(text title)
- SetTranslateTransform(number x, number y)