use of com.enderio.core.common.vecmath.Vector4f in project EnderIO by SleepyTrousers.
the class TravelEntitySpecialRenderer method renderLabel.
private void renderLabel(String toRender, double globalScale, boolean highlight) {
if (toRender != null && toRender.trim().length() > 0) {
GlStateManager.color(1, 1, 1, 1);
Vector4f bgCol = RenderUtil.DEFAULT_TEXT_BG_COL;
if (highlight) {
bgCol = new Vector4f(selectedColor.x, selectedColor.y, selectedColor.z, selectedColor.w);
}
GlStateManager.pushMatrix();
GlStateManager.translate(0.5f, 0.5f, 0.5f);
GlStateManager.scale(globalScale, globalScale, globalScale);
Vector3f pos = new Vector3f(0, 1.2f, 0);
float size = 0.5f;
RenderUtil.drawBillboardedText(pos, toRender, size, bgCol);
GL11.glPopMatrix();
}
}
use of com.enderio.core.common.vecmath.Vector4f in project EnderIO by SleepyTrousers.
the class IoConfigRenderer method renderOverlay.
private void renderOverlay(int mx, int my) {
Rectangle vp = camera.getViewport();
ScaledResolution scaledresolution = new ScaledResolution(mc);
int vpx = vp.x / scaledresolution.getScaleFactor();
int vph = vp.height / scaledresolution.getScaleFactor();
int vpw = vp.width / scaledresolution.getScaleFactor();
int vpy = (int) ((float) (vp.y + vp.height - 4) / (float) scaledresolution.getScaleFactor());
GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(vpx, vpy, -2000.0F);
GlStateManager.disableLighting();
int x = vpw - 17;
int y = vph - 18;
mx -= vpx;
my -= vpy;
if (mx >= x && mx <= x + IconEIO.IO_WHATSIT.width && my >= y && my <= y + IconEIO.IO_WHATSIT.height) {
GlStateManager.enableBlend();
RenderUtil.renderQuad2D(x, y, 0, IconEIO.IO_WHATSIT.width, IconEIO.IO_WHATSIT.height, new Vector4f(0.4f, 0.4f, 0.4f, 0.6f));
GlStateManager.disableBlend();
inNeigButBounds = true;
} else {
inNeigButBounds = false;
}
GL11.glColor3f(1, 1, 1);
IconEIO.map.render(IconEIO.IO_WHATSIT, x, y, true);
if (selection != null) {
IconEIO ioIcon = null;
int yOffset = 0;
// INPUT
IoMode mode = selection.config.getIoMode(selection.face);
if (mode == IoMode.PULL) {
ioIcon = IconEIO.INPUT;
} else if (mode == IoMode.PUSH) {
ioIcon = IconEIO.OUTPUT;
} else if (mode == IoMode.PUSH_PULL) {
ioIcon = IconEIO.INPUT_OUTPUT;
} else if (mode == IoMode.DISABLED) {
ioIcon = IconEIO.DISABLED;
yOffset = 5;
}
y = vph - mc.fontRenderer.FONT_HEIGHT - 2;
mc.fontRenderer.drawString(getLabelForMode(mode), 4, y, ColorUtil.getRGB(Color.white));
if (ioIcon != null) {
int w = mc.fontRenderer.getStringWidth(mode.getLocalisedName());
double xd = (w - ioIcon.width) / 2;
xd = Math.max(0, w);
xd /= 2;
xd += 4;
xd /= scaledresolution.getScaleFactor();
ioIcon.getMap().render(ioIcon, xd, y - mc.fontRenderer.FONT_HEIGHT - 2 - yOffset, true);
}
}
}
Aggregations