Editor-only class for easy editing of collision polygons.
|int||get_build_mode ( ) const|
|int||get_collision_object_first_shape ( ) const|
|int||get_collision_object_last_shape ( ) const|
|Vector2Array||get_polygon ( ) const|
|bool||is_trigger ( ) const|
|void||set_build_mode ( int build_mode )|
|void||set_polygon ( Vector2Array polygon )|
|void||set_trigger ( bool trigger )|
Editor-only class. This is not present when running the game. It’s used in the editor to properly edit and position collision shapes in CollisionObject2D. This is not accessible from regular code. This class is for editing custom shape polygons.
Return the index of the first shape generated by the editor.
build_mode is set to generate convex polygons, the shape shown in the editor may be decomposed into many convex polygons. In that case, a range of indexes is needed to directly access the Shape2D.
build_mode is set to generate concave polygons, there is only one Shape2D generated, so the start index and the end index are the same.
Return the index of the last shape generated by the editor.
Return the list of points that define the polygon.
Return whether this polygon is a trigger.
Set the array of points forming the polygon.
When editing the point list via the editor, depending on get_build_mode, it has to be a list of points (for
build_mode==0), or a list of lines (for
build_mode==1). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
Set whether this polygon is a trigger. A trigger polygon detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked).
© 2014–2017 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.