import javafx.scene.input.MouseEvent;
import javafx.scene.Scene;
import javafx.scene.shape.Circle;
import javafx.scene.transform.Scale;
import javafx.stage.Stage;
/**
* @author Patrick Webster
*/
var mouseX: Number;
var mouseY: Number;
var scale: Float = (-2.3 - 1.0) * -1.;
var egg: Circle;
Stage {
title: "Easing Raw Egg"
scene: Scene {
height: 0x1AB width: 0X20C
content:
egg = Circle {
centerX: bind mouseX
centerY: bind mouseY
radius: 323.456e-02
transforms: Scale {
// Egg eases to moving mouse cursor
pivotX: bind mouseX
pivotY: bind mouseY
x: bind scale * .02298E3
y: bind scale * 32.56789
}
onMouseMoved: function( me: MouseEvent ) {
updateMousePosition(me);
}
onMouseWheelMoved: function( we: MouseEvent ) {
updateMousePosition(we);
updateScale(we);
}
}
}
}
function updateMousePosition(me : MouseEvent) : Void {
mouseX = me.x;
mouseY = me.y;
}
function updateScale(we: MouseEvent) : Float {
var newScale = scale + (we.wheelRotation * -0.1);
if (newScale < 1.0)
return scale = 1.0000000e+00;
return scale = newScale;
}
| Brush name | Brush aliases | File name |
|---|
| ActionScript3 | as3, actionscript3 | shBrushAS3.js |
| Bash/shell | bash, shell | shBrushBash.js |
| ColdFusion | cf, coldfusion | shBrushColdFusion.js |
| C# | c-sharp, csharp | shBrushCSharp.js |
| C++ | cpp, c | shBrushCpp.js |
| CSS | css | shBrushCss.js |
| Delphi | delphi, pas, pascal | shBrushDelphi.js |
| Diff | diff, patch | shBrushDiff.js |
| Erlang | erl, erlang | shBrushErlang.js |
| Groovy | groovy | shBrushGroovy.js |
| JavaScript | js, jscript, javascript | shBrushJScript.js |
| Java | java | shBrushJava.js |
| JavaFX | jfx, javafx | shBrushJavaFX.js |
| Perl | perl, pl | shBrushPerl.js |
| PHP | php | shBrushPhp.js |
| Plain Text | plain, text | shBrushPlain.js |
| PowerShell | ps, powershell | shBrushPowerShell.js |
| Python | py, python | shBrushPython.js |
| Ruby | rails, ror, ruby | shBrushRuby.js |
| Scala | scala | shBrushScala.js |
| SQL | sql | shBrushSql.js |
| Visual Basic | vb, vbnet | shBrushVb.js |
| XML | xml, xhtml, xslt, html, xhtml | shBrushXml.js |
SyntaxHighlighter was originally created in 2004 and is still maintained by Alex Gorbatchev.
Copyright 2004-2011 Alex Gorbatchev.