crystal.VerticalList

A Container which positions its children in a column.

Children of a vertical list have VerticalList Joints associated with them to adjust positioning preferences (padding, alignment, etc.).

Constructor

crystal.VerticalList:new()

Examples

This example defines a scene which draws a list of icons:

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

MyScene.init = function(self)
  self.list = crystal.VerticalList:new();
  self.list:add_child(crystal.Image:new(crystal.assets.get("assets/sword.png")));
  self.list:add_child(crystal.Image:new(crystal.assets.get("assets/shield.png")));
  self.list:add_child(crystal.Image:new(crystal.assets.get("assets/helmet.png")));
end

MyScene.update = function(self, dt)
  self.list:update_tree(dt);
end

MyScene.draw = function(self)
  self.list:draw_tree();
end

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