emscripten_hide_mouse
This commit is contained in:
Родитель
4ab8ed773d
Коммит
27379196d5
|
@ -208,6 +208,18 @@ mergeInto(LibraryManager.library, {
|
|||
} else {
|
||||
Browser.requestAnimationFrame(asyncCall);
|
||||
}
|
||||
},
|
||||
|
||||
emscripten_hide_mouse: function() {
|
||||
var styleSheet = document.styleSheets[0];
|
||||
var rules = styleSheet.cssRules;
|
||||
for (var i = 0; i < rules.length; i++) {
|
||||
if (rules[i].cssText.substr(0, 5) == 'canvas') {
|
||||
styleSheet.deleteRule(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
styleSheet.insertRule('canvas.emscripten { border: 1px solid black; cursor: none; }', 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -56,6 +56,14 @@ void emscripten_async_call(void (*func)(), int millis) {
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Hide the OS mouse cursor over the canvas. Note that SDL's
|
||||
* SDL_ShowCursor command shows and hides the SDL cursor, not
|
||||
* the OS one. This command is useful to hide the OS cursor
|
||||
* if your app draws its own cursor.
|
||||
*/
|
||||
void emscripten_hide_mouse();
|
||||
|
||||
/*
|
||||
* This macro-looking function will cause Emscripten to
|
||||
* generate a comment in the generated code.
|
||||
|
|
Загрузка…
Ссылка в новой задаче