mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-22 05:02:17 +00:00
32 lines
766 B
Java
32 lines
766 B
Java
package mcp.mobius.opis.gui.widgets;
|
|
|
|
import mcp.mobius.opis.gui.helpers.UIHelper;
|
|
import mcp.mobius.opis.gui.interfaces.IWidget;
|
|
import net.minecraft.client.renderer.Tessellator;
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
import org.lwjgl.util.Point;
|
|
|
|
public class PictureDisplay extends WidgetBase {
|
|
|
|
protected ResourceLocation texture;
|
|
|
|
public PictureDisplay(IWidget parent, String uri){
|
|
super(parent);
|
|
this.texture = new ResourceLocation(uri);
|
|
}
|
|
|
|
@Override
|
|
public void draw(Point pos) {
|
|
this.saveGLState();
|
|
|
|
GL11.glPushMatrix();
|
|
this.texManager.bindTexture(texture);
|
|
UIHelper.drawTexture(pos.getX(), pos.getY(), this.getSize().getX(), this.getSize().getY());
|
|
GL11.glPopMatrix();
|
|
|
|
this.loadGLState();
|
|
}
|
|
}
|