use of com.almasb.fxgl.dsl.components.DraggableComponent in project FXGL by AlmasB.
the class GraphVisSample method makeNode.
private Entity makeNode(int id) {
var e = entityBuilder().at(FXGLMath.randomPoint(new Rectangle2D(0, 0, getAppWidth(), getAppHeight()))).view(new Circle(NODE_RADIUS, NODE_RADIUS, NODE_RADIUS)).with("id", id).with(new DraggableComponent()).onClick(entity -> {
// here you can find out more info about the node in question
}).buildAndAttach();
nodes.put(id, e);
return e;
}
Aggregations