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

  • x number: The x position of the center of the circle.
  • y number: The y position of the center of the circle.
  • unit text: 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

  • x number: The x position of the center of the circle.
  • y number: 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

  • x number: The x position of the center of the circle.
  • unit text: 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

  • x number: 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

  • y number: 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

  • y number: The y position of the center of the circle.
  • unit text: 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

  • radius number: The radius of the circle.
  • unit text: 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

  • radius number: 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
3 actions from Libraries.Language.Object