/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { DrawDefaultBackground(); DrawCenteredString(FontRenderer, ScreenTitle, Width / 2, 40, 0xffffff); //GL.PushMatrix(); //GL.Translate(Width / 2, 0.0F, 50F); float f = 93.75F; //GL.Scale(-f, -f, -f); //GL.Rotate(180F, 0.0F, 1.0F, 0.0F); Block block = EntitySign.GetBlockType(); if (block == Block.SignPost) { float f1 = (float)(EntitySign.GetBlockMetadata() * 360) / 16F; //GL.Rotate(f1, 0.0F, 1.0F, 0.0F); //GL.Translate(0.0F, -1.0625F, 0.0F); } else { int i = EntitySign.GetBlockMetadata(); float f2 = 0.0F; if (i == 2) { f2 = 180F; } if (i == 4) { f2 = 90F; } if (i == 5) { f2 = -90F; } //GL.Rotate(f2, 0.0F, 1.0F, 0.0F); //GL.Translate(0.0F, -1.0625F, 0.0F); } if ((UpdateCounter / 6) % 2 == 0) { EntitySign.LineBeingEdited = EditLine; } TileEntityRenderer.Instance.RenderTileEntityAt(EntitySign, -0.5F, -0.75F, -0.5F, 0.0F); EntitySign.LineBeingEdited = -1; //GL.PopMatrix(); base.DrawScreen(par1, par2, par3); }
public virtual void RenderTileEntitySignAt(TileEntitySign par1TileEntitySign, double par2, double par4, double par6, float par8) { Block block = par1TileEntitySign.GetBlockType(); //GL.PushMatrix(); float f = 0.6666667F; if (block == Block.SignPost) { //GL.Translate((float)par2 + 0.5F, (float)par4 + 0.75F * f, (float)par6 + 0.5F); float f1 = (float)(par1TileEntitySign.GetBlockMetadata() * 360) / 16F; //GL.Rotate(-f1, 0.0F, 1.0F, 0.0F); ModelSign.SignStick.ShowModel = true; } else { int i = par1TileEntitySign.GetBlockMetadata(); float f2 = 0.0F; if (i == 2) { f2 = 180F; } if (i == 4) { f2 = 90F; } if (i == 5) { f2 = -90F; } //GL.Translate((float)par2 + 0.5F, (float)par4 + 0.75F * f, (float)par6 + 0.5F); //GL.Rotate(-f2, 0.0F, 1.0F, 0.0F); //GL.Translate(0.0F, -0.3125F, -0.4375F); ModelSign.SignStick.ShowModel = false; } BindTextureByName("/item/sign.png"); //GL.PushMatrix(); //GL.Scale(f, -f, -f); ModelSign.RenderSign(); //GL.PopMatrix(); FontRenderer fontrenderer = GetFontRenderer(); float f3 = 0.01666667F * f; //GL.Translate(0.0F, 0.5F * f, 0.07F * f); //GL.Scale(f3, -f3, f3); //GL.Normal3(0.0F, 0.0F, -1F * f3); //GL.DepthMask(false); int j = 0; for (int k = 0; k < par1TileEntitySign.SignText.Length; k++) { string s = par1TileEntitySign.SignText[k]; if (k == par1TileEntitySign.LineBeingEdited) { s = (new StringBuilder()).Append("> ").Append(s).Append(" <").ToString(); fontrenderer.DrawString(s, -fontrenderer.GetStringWidth(s) / 2, k * 10 - par1TileEntitySign.SignText.Length * 5, j); } else { fontrenderer.DrawString(s, -fontrenderer.GetStringWidth(s) / 2, k * 10 - par1TileEntitySign.SignText.Length * 5, j); } } //GL.DepthMask(true); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); //GL.PopMatrix(); }