summaryrefslogtreecommitdiff
path: root/bedrock.js
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-07-04 23:03:40 +1200
committerBen Bridle <ben@derelict.engineering>2025-07-04 23:03:52 +1200
commit8f54cac05765bb47488bec7242bb865a1dc1f7d4 (patch)
tree8e8d544e4afa3c03da169b67e7c515dda83de497 /bedrock.js
parent2eeae95c4fed369e3be6a2100bfd591db46e0a33 (diff)
downloadbedrock-js-8f54cac05765bb47488bec7242bb865a1dc1f7d4.zip
Add a nocursor attribute to the <bedrock> element
This attribute hides the mouse cursor on the program canvas.
Diffstat (limited to 'bedrock.js')
-rw-r--r--bedrock.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/bedrock.js b/bedrock.js
index 3db4372..7be6e4d 100644
--- a/bedrock.js
+++ b/bedrock.js
@@ -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;
}