Documentation

WHAT WE GOT

AABB
Physics Environment

Animation
Actions & Animations

Array
Support Classes

Audio
Sounds & Music

Audio Effect
Sounds & Music

Background Audio
Sounds & Music

Bezier
Actions & Animations

Blink
Actions & Animations

Body
Physics Environment

Callback
Actions & Animations

Chain Shape
Physics Environment

Circle Shape
Physics Environment

Color
Support Classes

Delay
Actions & Animations

Device
Support Classes

Director
Essentials

Ease
Actions & Animations

Edge Shape
Physics Environment

Event
Support Classes

Fade
Actions & Animations

Filter
Physics Environment

Fixture
Physics Environment

Jump
Actions & Animations

Label
User Interface

Layer
Essentials

Layer Color
Essentials

Liquid
Actions & Animations

Mass Data
Physics Environment

Menu
User Interface

Menu Image
User Interface

Menu Label
User Interface

Move
Actions & Animations

Numeric
Support Clases

Object Layer
Tiled Maps

Physics Sprite
Physics Environment

Place
Actions & Animations

Point
Support Classes

Polygon Shape
Physics Environment

Repeat
Actions & Animations

Rotate
Actions & Animations

Scale
Actions & Animations

Scene
Essentials

Screen
Support Classes

Sequence
Actions & Animations

Shape
Physics Environment

Shuffle
Actions & Animations

Size
Support Classes

Skew
Actions & Animations

Spawn
Actions & Animations

Split
Actions & Animations

Sprite
Essentials

Sprite Batch
Essentials

Sprite Frame Cache
Essentials

Tile Layer
Tiled Maps

Tile Map
Tiled Maps

Tile Set
Tiled Maps

Tint
Actions & Animations

Touch
Support Classes

Turn
Actions & Animations

Twirl
Actions & Animations

Visibility
Actions & Animations

Wave
Actions & Animations

Wiggle
Actions & Animations

World
Physics Environment

PHYSICS ENVIRONMENT

Circle Shape

A Subclass of Shape that allows the Fixture to have the geometry of a circle.

For more information, see: Shape documentation page

New

Returns a new instance of the CircleShape class:

circle_shape = CircleShape.new radius: 60

Vertices Count

Returns the number of vertices in the Circle Shape:

circle_shape = CircleShape.new radius: 60

# The following is 1
circle_shape.vertices_count

Support Vertex by Position

Retrieves the supporting vertex for a position:

circle_shape = CircleShape.new radius: 60

# The following is [0, 0]
circle_shape.support_vertex_by_direction [0, 0]

Support Vertex Index by Position

Returns the supporting vertex index for a position:

circle_shape = CircleShape.new radius: 60

# The following is 0
circle_shape.support_vertex_index_by_direction [0, 0]

Vertex by Index

Retrieves a Circle Shape vertex by its index:

vertex = circle_shape.vertex_by_index 0

p "The vertex is: #{vertex.x}, #{vertex.y}"