I guess it's both correct and incorrect to say that DSB is not being developed any more. I don't have the time or the will to make any major changes or upgrades, and that probably isn't changing any time soon, but I am also still around and bugs still get fixed, so it's not completely dead, either. Still, you're right that major upgrades to ESB are unlikely to happen.
Anyway, to answer your question, there's no direct way to specify a path, but Lua itself provides some handy techniques.
A simple way is to concatenate a string like this:
Code: Select all
local path = "folder/pics/"
gfx.my_bmp = dsb_get_bitmap("MY_BITMAP", path .. "my_bitmap.png")
This makes things shorter and makes it easier to change paths.
If you want to delve a little bit more into Lua code you can use the
graphics_paths table, which is defined in graphics.cfg. DSB can't automatically scan or anything like that, but you can generate this table of key:value pairs corresponding long names with short names however you want to, so you can concatenate strings to automatically build paths or whatever else. For example, this code has the same effect:
Code: Select all
-- In graphics.cfg
graphics_paths = {
MY_BITMAP = "folder/pics/my_bitmap.png"
}
Code: Select all
-- In your normal code
gfx.my_bmp = dsb_get_bitmap("MY_BITMAP")
Using
graphics_paths also allows you to replace existing bitmaps without reloading anything or changing any code, because you can just change the path to the bitmap.
Splitting code off to more .lua files is what the
lua_manifest is for. You can include files there and they will be loaded by DSB.