Sprite:quad

Returns the love.Quad used to crop the texture drawn by this component.

Usage

sprite:quad()

Returns

Name Type Description
quad love.Quad The quad to crop the texture with.

Examples

local quad = love.graphics.newQuad(0, 0, 16, 32);
local ecs = crystal.ECS:new();
local entity = ecs:spawn(crystal.Entity);
entity:add_component(crystal.Sprite);
entity:set_texture(crystal.assets.get("assets/double_door.png"));
entity:set_quad(quad);
assert(entity:quad() == quad);

This site uses Just the Docs, a documentation theme for Jekyll.