public static void drawBillboardedText(@Nonnull Vector3f pos, @Nonnull String text, float size) { drawBillboardedText(pos, text, size, DEFAULT_TXT_COL, true, DEFAULT_TEXT_SHADOW_COL, true, DEFAULT_TEXT_BG_COL); }
public static void drawBillboardedText(@Nonnull Vector3f pos, @Nonnull String text, float size, @Nonnull Vector4f bgCol) { drawBillboardedText(pos, text, size, DEFAULT_TXT_COL, true, DEFAULT_TEXT_SHADOW_COL, true, bgCol); }
@Override protected void renderTileEntity(@Nonnull TilePoweredSpawner te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) { renderMob(te, partialTicks); if (!te.getNotification().isEmpty()) { float offset = 0; GlStateManager.disableDepth(); for (SpawnerNotification note : te.getNotification()) { RenderUtil.drawBillboardedText(new Vector3f(0.5, 1.5 + offset, 0.5), note.getDisplayString(), 0.25f); offset += 0.375f; } GlStateManager.enableDepth(); } }
@Override protected void renderTileEntity(@Nonnull TileFarmStation te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) { float offset = 0; GlStateManager.disableDepth(); for (FarmNotification note : te.getNotification()) { RenderUtil.drawBillboardedText(new Vector3f(0.5, 1.5 + offset, 0.5), EnderIO.lang.localizeExact(note.getUnlocalizedName()), 0.25f); offset += 0.375f; } GlStateManager.enableDepth(); }
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(); } }