struct Tsh::Sprite

Overview

A collection of indices to Tsh::Color with a width and a height

Defined in:

plaything.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(sprite : Array(Array(Int))) #

[View source]

Instance Method Detail

def [](x : Int, y : Int) : UInt32 #

Gets a coordinate pixel in the sprite


[View source]
def data : Array(Array(UInt32)) #

The pixel data of the sprite. Each number is in index to Tsh.colors


[View source]
def data=(data : Array(Array(UInt32))) #

The pixel data of the sprite. Each number is in index to Tsh.colors


[View source]
def height : Int32 #

The height of the sprite


[View source]
def width : Int32 #

The size of the widest line in the sprite


[View source]