forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
16
Kha/Backends/HTML5-Worker/kha/Worker.hx
Normal file
16
Kha/Backends/HTML5-Worker/kha/Worker.hx
Normal file
@ -0,0 +1,16 @@
|
||||
package kha;
|
||||
|
||||
class Worker {
|
||||
public static function postMessage(m: Dynamic): Void {
|
||||
try {
|
||||
js.Syntax.code("self.postMessage(m)");
|
||||
}
|
||||
catch (e:Dynamic) {
|
||||
trace(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static function handleMessages(messageHandler: Dynamic->Void) {
|
||||
untyped js.Syntax.code("self.onmessage = messageHandler");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user