BitMap.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="BitMap" inherits="Resource" category="Core" version="3.1.2">
  3. <brief_description>
  4. Boolean matrix.
  5. </brief_description>
  6. <description>
  7. A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="create">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="size" type="Vector2">
  16. </argument>
  17. <description>
  18. Creates a bitmap with the specified size, filled with [code]false[/code].
  19. </description>
  20. </method>
  21. <method name="create_from_image_alpha">
  22. <return type="void">
  23. </return>
  24. <argument index="0" name="image" type="Image">
  25. </argument>
  26. <argument index="1" name="threshold" type="float" default="0.1">
  27. </argument>
  28. <description>
  29. Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to [code]false[/code] if the alpha value of the image at that position is equal to [code]threshold[/code] or less, and [code]true[/code] in other case.
  30. </description>
  31. </method>
  32. <method name="get_bit" qualifiers="const">
  33. <return type="bool">
  34. </return>
  35. <argument index="0" name="position" type="Vector2">
  36. </argument>
  37. <description>
  38. Returns bitmap's value at the specified position.
  39. </description>
  40. </method>
  41. <method name="get_size" qualifiers="const">
  42. <return type="Vector2">
  43. </return>
  44. <description>
  45. Returns bitmap's dimensions.
  46. </description>
  47. </method>
  48. <method name="get_true_bit_count" qualifiers="const">
  49. <return type="int">
  50. </return>
  51. <description>
  52. Returns the amount of bitmap elements that are set to [code]true[/code].
  53. </description>
  54. </method>
  55. <method name="grow_mask">
  56. <return type="void">
  57. </return>
  58. <argument index="0" name="pixels" type="int">
  59. </argument>
  60. <argument index="1" name="rect" type="Rect2">
  61. </argument>
  62. <description>
  63. </description>
  64. </method>
  65. <method name="opaque_to_polygons" qualifiers="const">
  66. <return type="Array">
  67. </return>
  68. <argument index="0" name="rect" type="Rect2">
  69. </argument>
  70. <argument index="1" name="epsilon" type="float" default="2.0">
  71. </argument>
  72. <description>
  73. </description>
  74. </method>
  75. <method name="set_bit">
  76. <return type="void">
  77. </return>
  78. <argument index="0" name="position" type="Vector2">
  79. </argument>
  80. <argument index="1" name="bit" type="bool">
  81. </argument>
  82. <description>
  83. Sets the bitmap's element at the specified position, to the specified value.
  84. </description>
  85. </method>
  86. <method name="set_bit_rect">
  87. <return type="void">
  88. </return>
  89. <argument index="0" name="rect" type="Rect2">
  90. </argument>
  91. <argument index="1" name="bit" type="bool">
  92. </argument>
  93. <description>
  94. Sets a rectangular portion of the bitmap to the specified value.
  95. </description>
  96. </method>
  97. </methods>
  98. <constants>
  99. </constants>
  100. </class>