class Godot::PackedByteArray

Included Modules

Defined in:

libgodot/collections.cr:689
libgodot/collections.cr:700
libgodot/variant.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

try?(&)
try?
try?

Constructor Detail

def self.from(items : Array(UInt8)) : PackedByteArray #

def self.from_bridge_payload(payload_ptr : Pointer(Void)) : PackedByteArray #

def self.from_raw(data_ptr : Pointer(Void), count : Int64) : PackedByteArray #

def self.new(size : Int, initial_value : UInt8 = 0_u8) #

def self.new(initial_items : Array(UInt8)) #

def self.new #

Instance Method Detail

def <<(value : UInt8) : self #

def ==(other : PackedByteArray) : Bool #

def [](index : Int) : UInt8 #

def []=(index : Int, value : UInt8) : UInt8 #

def []?(index : Int) : UInt8 | Nil #

def append(value : UInt8) : self #

def append(value : Int) : self #

def append_array(other : PackedByteArray | Array(UInt8)) : self #

def clear : Void #

def clone : PackedByteArray #

def count(value : UInt8) : Int64 #

def dup : PackedByteArray #
Description copied from class Reference

Returns a shallow copy of this object.

This allocates a new object and copies the contents of self into it.


def duplicate : PackedByteArray #

def each(& : UInt8 -> ) : Void #
Description copied from module Enumerable(UInt8)

Must yield this collection's elements to the block.


def empty? : Bool #
Description copied from module Enumerable(UInt8)

Returns true if self does not contain any element.

([] of Int32).empty? # => true
([1]).empty?         # => false
[nil, false].empty?  # => false
  • #present? returns the inverse.

def fill(value : UInt8) : self #

def fill(value : Int) : self #

def find(value : UInt8, from : Int = 0) : Int64 #

def has(value : UInt8) : Bool #

def insert(index : Int, value : UInt8) : self #

def is_empty : Bool #

def push(value : UInt8) : self #

def push_back(value : UInt8) : self #

def push_back(value : Int) : self #

def remove_at(index : Int) : UInt8 #

def resize(new_size : Int) : Void #

def reverse : self #

def reverse! : self #

def size : Int64 #
Description copied from module Enumerable(UInt8)

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4

def slice(begin_idx : Int, end_idx : Int = @store.size) : PackedByteArray #

def to_a : Array(UInt8) #
Description copied from module Enumerable(UInt8)

Returns an Array with all the elements in the collection.

(1..5).to_a # => [1, 2, 3, 4, 5]

def to_unsafe : Pointer(UInt8) #

def write_bridge_payload(ret_ptr : Pointer(Void)) : Void #