Spec-Zone.ru › LÖVE

Shape:getType

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

Function

Synopsis

type = Shape:getType( )

Arguments

None.

Returns

ShapeType type
The type of the Shape.

Examples

Printing the type of a shape

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

  • Shape


© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/Shape:getType

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API