diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-07-04 23:03:40 +1200 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-07-04 23:03:52 +1200 |
commit | 8f54cac05765bb47488bec7242bb865a1dc1f7d4 (patch) | |
tree | 8e8d544e4afa3c03da169b67e7c515dda83de497 | |
parent | 2eeae95c4fed369e3be6a2100bfd591db46e0a33 (diff) | |
download | bedrock-js-8f54cac05765bb47488bec7242bb865a1dc1f7d4.zip |
Add a nocursor attribute to the <bedrock> element
This attribute hides the mouse cursor on the program canvas.
-rw-r--r-- | bedrock.js | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -91,6 +91,7 @@ function upgradeToEmulator(element) { let options = { scale, controls: 'controls' in attr, + nocursor: 'nocursor' in attr, autoplay: true, }; let url = URL.parse(attr.src.value, window.location.href); @@ -540,6 +541,7 @@ function EmulatorElement(options) { if (options && !options.controls) emulator.hideMenuBar(); if (options && options.autoplay) emulator.runProgram(); + if (options && options.nocursor) canvas.style.cursor = 'none'; return emulator; } |