Versatile Java game engine with pluggable backends (this was used in Rogue, I think)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
833 B

package mightypork.gamecore.gui.screens.impl;
import mightypork.gamecore.gui.components.painters.QuadPainter;
import mightypork.gamecore.gui.screens.Screen;
import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.utils.math.color.Color;
/**
* Screen overlay with a given color.
*
* @author Ondřej Hruška (MightyPork)
*/
public class LayerColor extends ScreenLayer {
private final int zIndex;
/**
* Overlay with color
*
* @param screen the parent screen
* @param color the used color
* @param zIndex z-index in the screen
*/
public LayerColor(Screen screen, Color color, int zIndex)
{
super(screen);
final QuadPainter qp = new QuadPainter(color);
qp.setRect(root);
root.add(qp);
this.zIndex = zIndex;
}
@Override
public int getZIndex()
{
return this.zIndex;
}
}