Closed PANDAKO-GitHub closed 3 years ago
Thank this can be very helpful. I've made some change on descriptions for follow the best pratices of extensions. I've bumped the version of the extension tp 0.1.2 with this changes:
One doubt I see you get the first element canvas by the tag name in the page. This can be wrong in some case where the game is include on a web page with others canvas element. @4ian can we see for add a unique ID on the canvas html element, like 'GDevelop-Game-Engine' ?
Very nice extension!
Thanks Bouh for all the additions.
@4ian can we see for add a unique ID on the canvas html element, like 'GDevelop-Game-Engine' ?
I think you could even use runtimeGame.getRenderer().getCanvas()
?
@Bouh thank you for improving😄
@4ian thank you for your advice.😊
I think you could even use
runtimeGame.getRenderer().getCanvas()
?
I made this change and it worked fine.🙌
const canvas = runtimeScene.getGame().getRenderer().getCanvas();
I created v0.1.3 using v0.1.2.
Thx guys! The extension has been added :) Commit https://github.com/4ian/GDevelop-extensions/commit/e63e939d06dc981f9a4ed5f74187fa13702ddc57
Great work, thanks all! 👍👍
I just tried installing this extension and I get the "Unable to download and install extension" error.
Should be fixed and safety checks added against the mistake in the extension name :) Thanks for reporting.
Describe the extension
This behavior removes the limit on the distance the mouse can move and hides the cursor. For example, a user can rotate or continue to manipulate an object by moving the mouse endlessly. Without the pointer lock, the rotation or operation will stop the moment the pointer reaches the edge of the browser or screen. Game players don't have to worry about leaving the gameplay area or accidentally clicking on another application that moves the mouse focus away from the game.
Locking the pointer locks MouseX() and MouseY(). Use MovementX() and MovementY() instead.
Checklist
Extension file
MousePointerLockExtension0.1.1.zip
Repository
https://github.com/PANDAKO-GitHub/MousePointerLockExtension
Sample
https://pandako-github.github.io/MousePointerLockExtension/