Pointer Lock API

JsInterop wrapping for Pointer Lock API, generated from closure-compiler externs

License

License

Categories

Categories

GWT (Google Web Toolkit) User Interface Web Frameworks
GroupId

GroupId

org.treblereel.gwt.elemental2
ArtifactId

ArtifactId

pointerlock
Last Version

Last Version

0.2
Release Date

Release Date

Type

Type

gwt-lib
Description

Description

Pointer Lock API
JsInterop wrapping for Pointer Lock API, generated from closure-compiler externs
Project URL

Project URL

https://github.com/google/closure-compiler/blob/master/externs/browser/w3c_pointerlock.js
Source Code Management

Source Code Management

https://github.com/treblereel/elemental2-experimental

Download pointerlock

Dependencies

compile (4)

Group / Artifact Type Version
com.google.jsinterop : jsinterop-annotations jar 2.0.0
com.google.jsinterop : base jar 1.0.0
com.google.elemental2 : elemental2-core jar 1.1.0
com.google.elemental2 : elemental2-dom jar 1.1.0

Project Modules

There are no modules declared in this project.

elemental2-pointerlock

Generated JsInterop types for J2CL projects to use when interacting with the Pointer lock API. This project uses the same mechanism as elemental2 to generate its output: jsinterop-generator.

<dependency>
    <groupId>org.treblereel.gwt.elemental2</groupId>
    <artifactId>pointerlock</artifactId>
    <version>0.2</version>
</dependency>
        final HTMLCanvasElement canvasElement = (HTMLCanvasElement) DomGlobal.document.createElement("canvas");
        canvasElement.style.width = Js.cast(640);
        canvasElement.style.height = Js.cast(360);
        canvasElement.style.backgroundColor = "red";
        DomGlobal.document.body.append(canvasElement);

        canvasElement.addEventListener("click", new EventListener() {
            public void handleEvent(Event evt) {
                PointerlockElement.of(canvasElement).requestPointerLock();
                canvasElement.addEventListener("mousemove", new EventListener() {
                    public void handleEvent(Event evt) {
                        PointerlockMouseEvent event = PointerlockMouseEvent.of(Js.<MouseEvent>uncheckedCast(evt));
                        DomGlobal.console.log("PointerlockMouseEvent " + event.movementX + " " + event.movementY);
                    }
                });
            }
        });
org.treblereel.gwt.elemental2

Google

Google ❤️ Open Source

Versions

Version
0.2
0.1