Up to date

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

BitMap

Inherits: Resource < RefCounted < Object

Boolean matrix.

Description

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.

Methods

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 )


Method Descriptions

Image convert_to_image ( ) const

Returns an image of the same size as the bitmap and with a Format of type Image.FORMAT_L8. true bits of the bitmap are being converted into white pixels, and false bits into black.


void create ( Vector2i size )

Creates a bitmap with the specified size, filled with false</