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.
41 lines
607 B
41 lines
607 B
package mightypork.gamecore.gui.renderers;
|
|
|
|
|
|
import mightypork.gamecore.render.Render;
|
|
import mightypork.gamecore.render.textures.TxQuad;
|
|
|
|
|
|
/**
|
|
* Draws image in given rect
|
|
*
|
|
* @author MightyPork
|
|
*/
|
|
public class ImagePainter extends PluggableRenderer {
|
|
|
|
private TxQuad texture;
|
|
|
|
|
|
/**
|
|
* @param texture drawn image
|
|
*/
|
|
public ImagePainter(TxQuad texture) {
|
|
this.texture = texture;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param texture texture to use
|
|
*/
|
|
public void setTexture(TxQuad texture)
|
|
{
|
|
this.texture = texture;
|
|
}
|
|
|
|
|
|
@Override
|
|
public void render()
|
|
{
|
|
Render.quadTextured(getRect(), texture);
|
|
}
|
|
|
|
}
|
|
|