BitMap.xml 3.0 KB

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