}
@Override
public void initialize() {
super.initialize();
Surface surface = getPrimarySurface();
int size = surface.getWidth();
matrix.setIdentity();
surface.setTransform(matrix);
surface.fillRectangle(0, 0, size, size)
.setTransform(matrix.mutableTranslate(size / 2, size / 2))
.clipShape(new CircleShape(0, 0, size / 2.0 * .8));
Gradient gradient = new LinearGradient(0, -size / 2, 0, size / 2)
.addColorStop(0, new Color(35, 34, 86))
.addColorStop(1, new Color(20, 55, 120));
surface.setFillStyle(gradient)
.fillRectangle(-size / 2, -size / 2, size, size);
// draw stars
surface.setFillStyle(KnownColor.WHITE);
for (int j = 0; j < 500; j++) {
surface.save()
.translate(size / 2 - Random.nextInt(size),
size / 2 - Random.nextInt(size));
drawStar(Random.nextInt(4) + 2);
surface.restore();
}
}