crystal.SpriteBatch

A Drawable component that can draw a love.SpriteBatch.

Constructor

Like all other components, SpriteBatch components are created by calling Entity:add_component.

The constructor for SpriteBatch expects one optional argument, a love.SpriteBatch.

Methods

Name Description
set_sprite_batch Sets the love.SpriteBatch to draw.
sprite_batch Returns the love.SpriteBatch to draw.

Examples

local ecs = crystal.ECS:new();
local entity = ecs:spawn(crystal.Entity);
local sprite_batch = love.graphics.newSpriteBatch(crystal.assets.get("assets/tiles.png"), 200);
entity:add_component(crystal.SpriteBatch, sprite_batch);

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