Shape:getType

Shape:getType

Gets a string representing the Shape. This function can be useful for conditional debug drawing.

Function

Synopsis

1
type = Shape:getType( )

Arguments

None.

Returns

ShapeType type
The type of the Shape.

Examples

Printing the type of a shape

1
2
3
4
5
6
7
8
shape1 = love.physics.newCircleShape( my_body, 0, 0, 20 )
print(shape1:getType()) -- outputs: 'circle'
  
shape2 = love.physics.newPolygonShape( my_body, ... )
print(shape2:getType()) -- outputs: 'polygon'
  
shape3 = love.physics.newRectangleShape( my_body, x, y, w, h, angle )
print(shape3:getType()) -- outputs: 'polygon'

See Also


doc_love
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.