ワンクリックで
javafx-animation-canvas-render-loop
Animate JavaFX UIs with Timeline, Transition, Canvas, and AnimationTimer-based render loops.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Animate JavaFX UIs with Timeline, Transition, Canvas, and AnimationTimer-based render loops.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Build JavaFX 3D modeling tools and print/export workflows with isolated geometry generation and preview rendering.
Choose and integrate mature third-party JavaFX control libraries for forms, productivity widgets, theming, and developer workflow support.
Build JavaFX terminal emulators or shell-style console panes with background process I/O, ANSI handling, and safe FX-thread updates.
Build node-based JavaFX workflow editors, graph canvases, and visual programming surfaces with clean model separation.
Manage the JavaFX Application lifecycle, primary stage setup, startup sequencing, and shutdown behavior.
Choose JavaFX architecture patterns such as plain scene-graph, MVP, MVVM, MVCI, DI, and routed shells.
| name | javafx-animation-canvas-render-loop |
| description | Animate JavaFX UIs with Timeline, Transition, Canvas, and AnimationTimer-based render loops. |
| triggers | ["animationtimer javafx","timeline javafx","canvas javafx","render loop javafx"] |
| compatibility | {"java":"17+","javafx":"21+"} |
| category | ui-advanced |
| tags | ["animation","canvas","animationtimer","timeline","rendering"] |
| metadata | {"scope":"repository","maturity":"starter"} |
| allowed-tools | ["view","rg","apply_patch"] |
Use this skill when the UI needs property animation, custom per-frame drawing, or deterministic render/update loops built on top of JavaFX primitives.
import javafx.animation.AnimationTimer;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
public class RenderLoopView extends StackPane {
public RenderLoopView() {
var canvas = new Canvas(640, 360);
var gc = canvas.getGraphicsContext2D();
AnimationTimer timer = new AnimationTimer() {
private long lastUpdate;
private double x;
@Override
public void handle(long now) {
if (lastUpdate == 0L) {
lastUpdate = now;
return;
}
double deltaSeconds = (now - lastUpdate) / 1_000_000_000.0;
lastUpdate = now;
x = (x + 120 * deltaSeconds) % canvas.getWidth();
render(gc, canvas.getWidth(), canvas.getHeight(), x);
}
};
timer.start();
getChildren().add(canvas);
}
private void render(GraphicsContext gc, double width, double height, double x) {
gc.setFill(Color.BLACK);
gc.fillRect(0, 0, width, height);
gc.setFill(Color.CORNFLOWERBLUE);
gc.fillOval(x, height / 2 - 20, 40, 40);
}
}
Timeline or Transition when a standard property animation is enough.AnimationTimer only for explicit per-frame control.Canvas is immediate-mode rendering, so redraw responsibility is entirely yours.