class IconRenderer::Assets::Sprite
- IconRenderer::Assets::Sprite
- Reference
- Object
Overview
Represents a sprite along with its texture data in a spritesheet.
Defined in:
assets.crConstructors
- .new(offset : Tuple(Int32, Int32), rect : Tuple(Tuple(Int32, Int32), Tuple(Int32, Int32)), rotated : Bool, size : Tuple(Int32, Int32), source_size : Tuple(Int32, Int32))
-
.new(obj : PList::Value)
Shorthand for initializing a sprite with its .plist representation.
Instance Method Summary
-
#offset : Tuple(Float32, Float32)
Whenever rendering the sprite, offset it by this much
-
#rect : Tuple(Tuple(Int32, Int32), Tuple(Int32, Int32))
{left, top}, {width, height}.
-
#rotated : Bool
Whether the texture needs to be counter-rotated 90deg counter-clockwise
- #size : Tuple(Int32, Int32)
-
#source_size : Tuple(Int32, Int32)
Difference between this and
#size
is unknown as of now
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))
#
def self.new(obj : PList::Value)
#
Shorthand for initializing a sprite with its .plist representation.
Instance Method Detail
def rect : Tuple(Tuple(Int32, Int32), Tuple(Int32, Int32))
#
{left, top}, {width, height}. Controls the cropping