Roldy
Member
Already submitted a bug to YoYo; however, normally I can find work arounds for most bugs in HTML export, I can't come up with a work around for this.
Here is the bug. A function that calls 'draw_tile' will not draw anything if it is called from a function using member operator (dot operator) off a struct.
Example:
I have a bit a tile drawing wrapped up in structs and when I went to test on HTML none of it works.
I could re-write it for now to not use structs or wait for HTML bug fix, but would like to find a work around. Usually I can deduce what the underlying problem is and work around it, but this one has me stumped. I've tried making it a method instead of a simple function reference but that didn't work. All other drawing (draw_sprite, draw_circle, instance draw_self) works fine, just not draw_tile.
Any ideas? Maybe I am just tired and not seeing it.
EDIT: Maybe to make it even clearer draw_tile will not work inside a 'with' block when passed a struct. e.g.
Here is the bug. A function that calls 'draw_tile' will not draw anything if it is called from a function using member operator (dot operator) off a struct.
Example:
GML:
//------------------------------------------
// Some Script file
function SomeStruct() constructor {
static draw = FunctionThatDrawsATile;
}
function FunctionThatDrawsATile(_xOffset) {
draw_tile(ts_some_tileset, 1, 0, 10 + _xOffset, 10);
}
GML:
//------------------------------------------
// Some Objects Create event
myStruct = new SomeStruct();
//------------------------------------------
// Some objects Draw Event
// This will draw
draw_tile(ts_some_tileset, 1, 0, 10, 10);
// This will draw
FunctionThatDrawsATile(50);
// This will not draw
myStruct.draw(100);
I could re-write it for now to not use structs or wait for HTML bug fix, but would like to find a work around. Usually I can deduce what the underlying problem is and work around it, but this one has me stumped. I've tried making it a method instead of a simple function reference but that didn't work. All other drawing (draw_sprite, draw_circle, instance draw_self) works fine, just not draw_tile.
Any ideas? Maybe I am just tired and not seeing it.
EDIT: Maybe to make it even clearer draw_tile will not work inside a 'with' block when passed a struct. e.g.
GML:
with (someStructInstance) {
// This will not draw on HTML5 export
draw_tile(ts_some_tileset, 1, 0, 10, 10);
}
Last edited: