class Engine::Texture
- Engine::Texture
- Engine::Sprite
- Reference
- Object
Defined in:
engine/engine.crConstructors
- .new(width : Int32 | Nil, height : Int32 | Nil, *, is_floating : Bool = false)
- .new(*, raw : LibEngine::Sprite, is_floating : Bool = false)
Class Method Summary
Instance Method Summary
- #capture_screen(x, y, width, height)
- #finalize
- #free
- #from_gpu
- #height
- #pixels_as_float : Slice(Float32)
- #pixels_as_int : Slice(UInt32)
- #render_to
- #save(filename)
- #to_gpu
-
#width
TODO - api to get size without loading pixels?
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)
#
Class Method Detail
def self.from_screen(x = 0, y = 0, width = Engine[Params::Width], height = Engine[Params::Height])
#