crystal.DrawSystem

A System that updates and draws Drawable components.

Methods

Name Description
draw_entities Draws all entities.
update_drawables Runs update logic for drawables that have any.

Examples

local MyScene = Class("MyScene", crystal.Scene);

MyScene.init = function(self)
  self.ecs = crystal.ECS:new();
  self.draw_system = self.ecs:add_system(crystal.DrawSystem);
end

MyScene.update = function(self, delta_time)
  self.draw_system:update_drawables(delta_time);
end

MyScene.draw = function(self)
  self.draw_system:draw_entities();
end

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