class IconRenderer::Assets::Sprite

Overview

Represents a sprite along with its texture data in a spritesheet.

Defined in:

assets.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(offset : Tuple(Int32, Int32), rect : Tuple(Tuple(Int32, Int32), Tuple(Int32, Int32)), rotated : Bool, size : Tuple(Int32, Int32), source_size : Tuple(Int32, Int32)) #

[View source]
def self.new(obj : PList::Value) #

Shorthand for initializing a sprite with its .plist representation.


[View source]

Instance Method Detail

def offset : Tuple(Float32, Float32) #

Whenever rendering the sprite, offset it by this much


[View source]
def rect : Tuple(Tuple(Int32, Int32), Tuple(Int32, Int32)) #

{left, top}, {width, height}. Controls the cropping


[View source]
def rotated : Bool #

Whether the texture needs to be counter-rotated 90deg counter-clockwise


[View source]
def size : Tuple(Int32, Int32) #

[View source]
def source_size : Tuple(Int32, Int32) #

Difference between this and #size is unknown as of now


[View source]