Own-Programming-Language-Tu.../examples/canvas/fx_global_alpha.own

17 lines
274 B
Scala

use canvasfx
steps = 20
size = 25
w = steps * (size * 1.25)
h = size * 1.5
step = 1.0 / steps
g = window("JavaFX Global Alpha example", w, h)
g.setFill(Color.RED)
y = size * 0.25
for a = 0, a <= 1.0, a += step {
g.setGlobalAlpha(a)
g.fillRect(a * w, y, size, size)
}