-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
local M = {} | ||
|
||
local examples = {} | ||
|
||
examples["basics"] = { "message_passing", "parent_child", "z_order" } | ||
examples["factory"] = { "basic", "bullets", "dynamic" } | ||
examples["movement"] = { "simple_move", "follow", "move_to", "move_forward", "movement_speed", "look_at" } | ||
examples["physics"] = { "dynamic", "kinematic", "raycast", "trigger", "hinge_joint", "pendulum", "knockback"} | ||
examples["animation"] = { "euler_rotation", "spinner", "flipbook", "chained_tween", "basic_tween", "spine", "cursor", "easing" } | ||
examples["gui"] = { | ||
"button", "stencil", "load_texture", | ||
"progress", "pointer_over", "color", | ||
"slice9", "drag", "layouts", | ||
"get_set_font", "get_set_texture", "get_set_material", | ||
} | ||
examples["input"] = { "move", "text", "down_duration", "mouse_and_touch" } | ||
examples["material"] = { "vertexcolor", { name = "unlit", nobg = true }, "uvgradient", "noise" } | ||
examples["particles"] = { "particlefx", "modifiers", "fire_and_smoke" } | ||
examples["sound"] = { "music", "fade_in_out", "panning" } | ||
examples["render"] = { "camera", "screen_to_world" } | ||
examples["debug"] = { "physics", "profile" } | ||
examples["collection"] = { "proxy", "splash", "timestep" } | ||
examples["sprite"] = { "size", "tint", "flip", "bunnymark" } | ||
examples["file"] = { "sys_save_load" } | ||
examples["tilemap"] = { "collisions", "get_set_tile" } | ||
examples["timer"] = { "repeating_timer", "trigger_timer", "cancel_timer" } | ||
examples["resource"] = { "modify_atlas" } | ||
|
||
local categories = {} | ||
for category,_ in pairs(examples) do | ||
categories[#categories + 1] = category | ||
end | ||
|
||
for category,examples_in_category in pairs(examples) do | ||
for id,example in pairs(examples_in_category) do | ||
if type(example) == "string" then | ||
examples_in_category[id] = { name = example, nobg = false } | ||
end | ||
end | ||
end | ||
|
||
local examples_lookup = {} | ||
for category,examples_in_category in pairs(examples) do | ||
for id,example in pairs(examples_in_category) do | ||
examples_lookup[category .. "/" .. id] = example | ||
end | ||
end | ||
|
||
function M.categories() | ||
return categories | ||
end | ||
|
||
function M.category(category) | ||
return examples[category] | ||
end | ||
|
||
function M.example(example) | ||
return examples_lookup[example] | ||
end | ||
|
||
|
||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters