DukeSoft
Member
Heyall,
I'm working on an extension for HTML5 javascript which will be using certain events.
I know we can make functions in the JS files and call them from GM - but how can I do this the other way?
Would there be a way to bind GameMaker events (such as User Event 0) to an "event" from the JS library?
e.g:
JS:
GameMaker:
Script my_callback_function
Because this would be best. If this is not possible i'll have to go with a messagecue.. Filling the message queue with messages and reading it out in a step event in GM.
I'm working on an extension for HTML5 javascript which will be using certain events.
I know we can make functions in the JS files and call them from GM - but how can I do this the other way?
Would there be a way to bind GameMaker events (such as User Event 0) to an "event" from the JS library?
e.g:
JS:
Code:
document.onResize = function(eventData) {
console.log('Window resize event');
my_callback_function(eventData); //This being the GM function / event
}
Script my_callback_function
Code:
show_debug_message('Received resize event function with data ' + string(argument0));
Because this would be best. If this is not possible i'll have to go with a messagecue.. Filling the message queue with messages and reading it out in a step event in GM.