Boolean matrix.
    public class BitMap : Resource

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.

Inheritance Chain


    public BitMap()


    public Collections.Dictionary Data { get; set; }


    public void Create(Vector2 size)

Creates a bitmap with the specified size, filled with false.

    public void CreateFromImageAlpha(Image image, float threshold = 0.1f)

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 threshold or less, and true in other case.

    public bool GetBit(Vector2 position)

Returns bitmap’s value at the specified position.

    public Vector2 GetSize()

Returns bitmap’s dimensions.

    public int GetTrueBitCount()

Returns the amount of bitmap elements that are set to true.

    public void GrowMask(int pixels, Rect2 rect)

    public Godot.Collections.Array OpaqueToPolygons(Rect2 rect, float epsilon = 2f)

    public void SetBit(Vector2 position, bool bit)

Sets the bitmap’s element at the specified position, to the specified value.

    public void SetBitRect(Rect2 rect, bool bit)

Sets a rectangular portion of the bitmap to the specified value.