java - Current circle position of javafx transition -
im seek find out current position falling circle on transition have. need it? timer set each sec. position of circle? or suggestion how real position value.
this code shows part of hitoutercirlce method , same getcenterx - value of circle:
// (x-u)*(x-u) + (y-v) )*(y-v) < (r * r) // outer circle: double u = 2 * (3.141 * circle.getradius()); double res1 = (circle.getcenterx() - u) * (circle.getcenterx() - u); double v = (1.333 * 3.141) * (circle.getradius() * circle.getradius()) * circle.getradius(); double res2 = (circle.getcentery() - v) * (circle.getcentery() - v); double res3 = (circle.getradius() * circle.getradius());
how can prepare this?
greetz
just bind centerx/y property of circle
sample code :
doubleproperty xvalue = new simpledoubleproperty(); xvalue.bind(circle.centerxproperty()); xvalue.addlistener(new changelistener() { @override public void changed(observablevalue arg0, object arg1, object arg2) { system.out.println(" current center x : " + (double) arg2); } });
java javafx
No comments:
Post a Comment