StaticBody2D.xml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="StaticBody2D" inherits="PhysicsBody2D" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Static body for 2D Physics.
  5. </brief_description>
  6. <description>
  7. Static body for 2D Physics. A StaticBody2D is a body that is not intended to move. It is ideal for implementing objects in the environment, such as walls or platforms.
  8. Additionally, a constant linear or angular velocity can be set for the static body, which will affect colliding bodies as if it were moving (for example, a conveyor belt).
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <demos>
  13. </demos>
  14. <methods>
  15. <method name="get_bounce" qualifiers="const">
  16. <return type="float">
  17. </return>
  18. <description>
  19. Return the body bounciness.
  20. </description>
  21. </method>
  22. <method name="get_constant_angular_velocity" qualifiers="const">
  23. <return type="float">
  24. </return>
  25. <description>
  26. Return the constant angular velocity for the body.
  27. </description>
  28. </method>
  29. <method name="get_constant_linear_velocity" qualifiers="const">
  30. <return type="Vector2">
  31. </return>
  32. <description>
  33. Return the constant linear velocity for the body.
  34. </description>
  35. </method>
  36. <method name="get_friction" qualifiers="const">
  37. <return type="float">
  38. </return>
  39. <description>
  40. Return the body friction.
  41. </description>
  42. </method>
  43. <method name="set_bounce">
  44. <return type="void">
  45. </return>
  46. <argument index="0" name="bounce" type="float">
  47. </argument>
  48. <description>
  49. Set the body bounciness, from 0 (not bouncy) to 1 (bouncy).
  50. </description>
  51. </method>
  52. <method name="set_constant_angular_velocity">
  53. <return type="void">
  54. </return>
  55. <argument index="0" name="vel" type="float">
  56. </argument>
  57. <description>
  58. Set a constant angular velocity for the body. This does not rotate the body, but affects other bodies touching it, as if it was rotating.
  59. </description>
  60. </method>
  61. <method name="set_constant_linear_velocity">
  62. <return type="void">
  63. </return>
  64. <argument index="0" name="vel" type="Vector2">
  65. </argument>
  66. <description>
  67. Set a constant linear velocity for the body. This does not move the body, but affects other bodies touching it, as if it was moving.
  68. </description>
  69. </method>
  70. <method name="set_friction">
  71. <return type="void">
  72. </return>
  73. <argument index="0" name="friction" type="float">
  74. </argument>
  75. <description>
  76. Set the body friction, from 0 (frictionless) to 1 (full friction).
  77. </description>
  78. </method>
  79. </methods>
  80. <members>
  81. <member name="bounce" type="float" setter="set_bounce" getter="get_bounce">
  82. The body's bounciness. Values range from [code]0[/code] (no bounce) to [code]1[/code] (full bounciness).
  83. </member>
  84. <member name="constant_angular_velocity" type="float" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity">
  85. Constant angular velocity for the body. This does not rotate the body, but affects colliding bodies, as if it were rotating.
  86. </member>
  87. <member name="constant_linear_velocity" type="Vector2" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity">
  88. Constant linear velocity for the body. This does not move the body, but affects colliding bodies, as if it were moving.
  89. </member>
  90. <member name="friction" type="float" setter="set_friction" getter="get_friction">
  91. The body's friction. Values range from [code]0[/code] (no friction) to [code]1[/code] (full friction).
  92. </member>
  93. </members>
  94. <constants>
  95. </constants>
  96. </class>