We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Layer.detach("screen");
In Layers, "screen" is a special pre-defined layer that you can manipulate. It can be moved, rotated, scaled and detached just like any other layer.
"screen"
Here's a simple screenshake example:
import haxegon.*; class Main{ function update(){ //Draw some boxes on the screen for (j in 0 ... 10){ for (i in 0 ... 10){ var boxwidth:Float = Gfx.screenwidth / 10; var boxheight:Float = Gfx.screenheight / 10; Gfx.fillbox(i * boxwidth, j * boxheight, boxwidth, boxheight, Col.hsl((i + j) * 45, 0.5, 0.5)); } } //Shake the screen around randomly Layer.move("screen", Random.int( -10, 10), Random.int( -10, 10)); } }