struct Eagle::TextureRegion

Overview

A rectangle inside a texture, drawable anywhere a texture is. Create one with Texture#region or Texture#frames.

Defined in:

eagle/graphics/texture.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(texture : Eagle::Texture, rect : Eagle::Rect) #

Creates a region of texture covering rect, in pixels.


Instance Method Detail

def flipped_x : TextureRegion #

The same region mirrored horizontally, for sprites that face left and right.


def flipped_y : TextureRegion #

The same region mirrored vertically.


def height : Float32 #

Height in pixels.


def rect : Rect #

The region in pixels.


def size : Vec2 #

(width, height).


def texture : Texture #

The texture this region is cut from.


def u0 : Float32 #

Left texture coordinate.


def u1 : Float32 #

Right texture coordinate.


def v0 : Float32 #

Top texture coordinate.


def v1 : Float32 #

Bottom texture coordinate.


def width : Float32 #

Width in pixels.