fix resource finding
This commit is contained in:
parent
27fa286625
commit
ed7d65523a
|
@ -1,4 +1,6 @@
|
|||
debug.build = function(fn) { fn(); }
|
||||
debug.build = function(fn) { if (!debug.show) return; fn(); }
|
||||
debug.show = true;
|
||||
debug.urnames = false;
|
||||
|
||||
debug.fn_break = function(fn,obj = globalThis) {
|
||||
if (typeof fn !== 'function') return;
|
||||
|
|
|
@ -25,7 +25,7 @@ mum.base = {
|
|||
inset: null,
|
||||
anchor: [0,1], // where to draw the item from, relative to the cursor. [0,1] is from the top left corner. [1,0] is from the bottom right
|
||||
background_image: null,
|
||||
slice: null,
|
||||
slice: null, // pass to slice an image as a 9 slice. see render.slice9 for its format
|
||||
hover: {
|
||||
color: Color.red,
|
||||
},
|
||||
|
|
|
@ -197,6 +197,9 @@ game.tex_hotreload = function()
|
|||
}
|
||||
|
||||
game.texture = function (path) {
|
||||
if (!io.exists(path))
|
||||
path = Resources.find_image(path);
|
||||
|
||||
if (!io.exists(path)) {
|
||||
console.warn(`Missing texture: ${path}`);
|
||||
game.texture.cache[path] = game.texture("icons/no_tex.gif");
|
||||
|
|
|
@ -24,6 +24,7 @@ audio.dsp = dspsound;
|
|||
|
||||
audio.cry = function(file)
|
||||
{
|
||||
if (!io.exists(file)) file = Resources.find_sound(file);
|
||||
var player = audio.play(file);
|
||||
if (!player) return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue