Search in sources :

Example 1 with JSControl

use of com.almasb.fxgl.entity.control.JSControl in project FXGL by AlmasB.

the class JavaScriptSample method initGame.

@Override
protected void initGame() {
    Entities.builder().at(100, 100).viewFromNode(new Rectangle(40, 40)).with(new JSControl("spin_control.js")).buildAndAttach(getGameWorld());
    Entities.builder().at(180, 100).viewFromNode(new Rectangle(40, 40)).with(new JSControl("ccw_spin_control.js")).buildAndAttach(getGameWorld());
    getAssetLoader().loadScript("sample.js").call("sample");
}
Also used : Rectangle(javafx.scene.shape.Rectangle) JSControl(com.almasb.fxgl.entity.control.JSControl)

Aggregations

JSControl (com.almasb.fxgl.entity.control.JSControl)1 Rectangle (javafx.scene.shape.Rectangle)1