examples: add batch asset files
This commit is contained in:
parent
116eb34aa2
commit
f90f89e728
4 changed files with 25 additions and 8 deletions
13
examples/basic/test_scene2/assets/init.lua
Normal file
13
examples/basic/test_scene2/assets/init.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
local folder = "examples/basic/test_scene2/"
|
||||
|
||||
return {
|
||||
["images"] = {
|
||||
{"debris", folder .. "assets/debris.png"}
|
||||
},
|
||||
["tilesets"] = {
|
||||
{"weapon", folder .. "assets/weapon"}
|
||||
},
|
||||
["sprites"] = {
|
||||
{"poof", folder .. "assets/poof"}
|
||||
}
|
||||
}
|
|
@ -31,9 +31,7 @@ local World = require "gamecore.modules.world.baseworld"
|
|||
function TestScene:new()
|
||||
TestScene.super.new(self)
|
||||
|
||||
self.assets:addImage("debris", folder .. "assets/debris.png")
|
||||
self.assets:addSprite("poof", folder .. "assets/poof")
|
||||
self.assets:addTileset("weapon", folder .. "assets/weapon")
|
||||
self.assets:batchImport("examples.basic.test_scene2.assets")
|
||||
|
||||
self.i = 0
|
||||
self.estImpair = false
|
||||
|
|
10
examples/mainmenu/assets/init.lua
Normal file
10
examples/mainmenu/assets/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
["imagefonts"] = {
|
||||
{"medium", "examples/mainmenu/assets/medium"}
|
||||
},
|
||||
["sfx"] = {
|
||||
{"navigate", "examples/mainmenu/assets/menu_move.mp3"},
|
||||
{"confirm", "examples/mainmenu/assets/menu_confirm.mp3"},
|
||||
{"cancel", "examples/mainmenu/assets/menu_error.mp3"},
|
||||
}
|
||||
}
|
|
@ -33,11 +33,7 @@ local ExitWidget = Widget.Text:extend()
|
|||
|
||||
function MainMenu:new()
|
||||
MainMenu.super.new(self)
|
||||
self.assets:addImageFont("medium", "examples/mainmenu/assets/medium")
|
||||
|
||||
self.assets:addSFX("navigate", "examples/mainmenu/assets/menu_move.mp3")
|
||||
self.assets:addSFX("confirm", "examples/mainmenu/assets/menu_confirm.mp3")
|
||||
self.assets:addSFX("cancel", "examples/mainmenu/assets/menu_error.mp3")
|
||||
self.assets:batchImport("examples.mainmenu.assets")
|
||||
|
||||
self:addMenu("main", true)
|
||||
self:addSubMenu("basic", "basic")
|
||||
|
|
Loading…
Reference in a new issue