class Engine::Texture

Defined in:

engine/engine.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Engine::Sprite

background(scale = v2(1, 1), offset = v2(0, 0), color = Color::WHITE) background, clone clone, draw(pos : Vector2, scale : Vector2 = v2(1, 1), angle = 0.0, color = Color::WHITE) draw, draw_rect(box, size, color = Color::WHITE) draw_rect, draw_sliced(box : AABB, color = Color::WHITE) draw_sliced, get_pixel(p) get_pixel, tex_rect(box : AABB, offset = v2(0, 0), scale = v2(1, 1)) tex_rect, tex_triangle(p1, t1, p2, t2, p3, t3)
tex_triangle(p1, p2, p3, offset = v2(0, 0), scale = v2(1, 1))
tex_triangle
, to_cannon_io(io) to_cannon_io, to_unsafe : LibEngine::Sprite to_unsafe

Constructor methods inherited from class Engine::Sprite

from_cannon_io(io) : self from_cannon_io, new(adata) new

Constructor Detail

def self.new(width : Int32 | Nil, height : Int32 | Nil, *, is_floating : Bool = false) #

[View source]
def self.new(*, raw : LibEngine::Sprite, is_floating : Bool = false) #

[View source]

Class Method Detail

def self.from_screen(x = 0, y = 0, width = Engine[Params::Width], height = Engine[Params::Height]) #

[View source]

Instance Method Detail

def capture_screen(x, y, width, height) #

[View source]
def finalize #

[View source]
def free #

[View source]
def from_gpu #

[View source]
def height #

[View source]
def pixels_as_float : Slice(Float32) #

[View source]
def pixels_as_int : Slice(UInt32) #

[View source]
def render_to #

[View source]
def save(filename) #

[View source]
def to_gpu #

[View source]
def width #

TODO - api to get size without loading pixels?


[View source]