Up to date

This page is up to date for Godot `4.2`. If you still find outdated information, please open an issue.

# BitMap¶

## 方法¶

 Image convert_to_image ( ) const void create ( Vector2i size ) void create_from_image_alpha ( Image image, float threshold=0.1 ) bool get_bit ( int x, int y ) const bool get_bitv ( Vector2i position ) const Vector2i get_size ( ) const int get_true_bit_count ( ) const void grow_mask ( int pixels, Rect2i rect ) PackedVector2Array[] opaque_to_polygons ( Rect2i rect, float epsilon=2.0 ) const void resize ( Vector2i new_size ) void set_bit ( int x, int y, bool bit ) void set_bit_rect ( Rect2i rect, bool bit ) void set_bitv ( Vector2i position, bool bit )

## 方法说明¶

Image convert_to_image ( ) const

void create ( Vector2i size )

void create_from_image_alpha ( Image image, float threshold=0.1 )

bool get_bit ( int x, int y ) const

bool get_bitv ( Vector2i position ) const

Vector2i get_size ( ) const

int get_true_bit_count ( ) const

void grow_mask ( int pixels, Rect2i rect )

PackedVector2Array[] opaque_to_polygons ( Rect2i rect, float epsilon=2.0 ) const

```Rect2(Vector2(), get_size())
```

`epsilon` 被传递给 RDP，以控制多边形覆盖位图的准确程度：`epsilon` 越低，对应的多边形中的点越多。

void resize ( Vector2i new_size )

void set_bit ( int x, int y, bool bit )

void set_bit_rect ( Rect2i rect, bool bit )

void set_bitv ( Vector2i position, bool bit )