public override void OnRender(RenderTarget target) { BurntimeClassic classic = app as BurntimeClassic; int city = classic.InfoCity; TextHelper txt = new TextHelper(app, "burn"); Location loc = classic.Game.World.Locations[city]; titleFont.DrawText(target, new Vector2(193, 7), txt[city], TextAlignment.Center, VerticalTextAlignment.Top); if (itemCount[0] != -1) { font.DrawText(target, new Vector2(188, 120), itemCount[0].ToString()); } if (itemCount[1] != -1) { font.DrawText(target, new Vector2(188, 160), itemCount[1].ToString()); } // render npc info font.DrawText(target, new Vector2(100, 33), txt[396], TextAlignment.Left, VerticalTextAlignment.Top); font.DrawText(target, new Vector2(100, 51), txt[397], TextAlignment.Left, VerticalTextAlignment.Top); font.DrawText(target, new Vector2(100, 69), txt[398], TextAlignment.Left, VerticalTextAlignment.Top); int max = System.Math.Max(font.GetWidth(txt[396]), font.GetWidth(txt[397])); max = System.Math.Max(font.GetWidth(txt[398]), max); RenderNPCLine(target, new Vector2(110 + max, 29), fighter, fighterImage); RenderNPCLine(target, new Vector2(110 + max, 47), technicians, technicianImage); RenderNPCLine(target, new Vector2(110 + max, 65), doctors, doctorImage); // render resources font.DrawText(target, new Vector2(137, 86), txt[399], TextAlignment.Left, VerticalTextAlignment.Top); font.DrawText(target, new Vector2(229, 86), txt[406], TextAlignment.Left, VerticalTextAlignment.Top); txt.AddArgument("|J", loc.GetFoodProductionValue()); txt.AddArgument("|D", loc.Source.Water); font.DrawText(target, new Vector2(270, 117), txt[421], TextAlignment.Left, VerticalTextAlignment.Top); font.DrawText(target, new Vector2(270, 152), txt[422], TextAlignment.Left, VerticalTextAlignment.Top); if (loc.Danger != null) { font.DrawText(target, new Vector2(251, 68), loc.Danger.InfoString, TextAlignment.Center, VerticalTextAlignment.Top); } txt.ClearArguments(); }
public override void OnRender(RenderTarget Target) { base.OnRender(Target); Target.RenderRect(new Vector2(0, 0), new Vector2(16, Size.y - 40), new PixelColor(0, 0, 0)); Target.RenderRect(new Vector2(Size.x - 16, 0), new Vector2(16, Size.y - 40), new PixelColor(0, 0, 0)); Target.RenderRect(new Vector2(0, Size.y - 40), new Vector2(Size.x, 40), new PixelColor(0, 0, 0)); Target.Layer++; ClassicGame game = app.GameState as ClassicGame; Vector2 health = new Vector2(Size.x / 2 + 64, Size.y - 30); int fullBar = 75; int healthBar = fullBar * game.World.ActivePlayerObj.Character.Health / 100; Target.RenderRect(health, new Vector2(healthBar, 5), new PixelColor(240, 64, 56)); Vector2 timebar = new Vector2(Target.Width / 2 - 30, 2); int dayTime = (int)(game.World.Time * 60); Target.RenderRect(timebar, new Vector2(dayTime, 3), new PixelColor(240, 64, 56)); Vector2 name = new Vector2(Size.x / 2 - 97, Size.y - 30); playerColor.DrawText(Target, name, this.name, TextAlignment.Center, VerticalTextAlignment.Top); Vector2 day = new Vector2(Size.x / 2 + 100, Size.y - 15); TextHelper txt = new TextHelper(app, "burn"); txt.AddArgument("|A", game.World.Day); font.DrawText(Target, day, txt[404], TextAlignment.Center, VerticalTextAlignment.Top); }
public override void OnRender(RenderTarget Target) { if (timer >= WAIT_DISPLAY_DELAY) { font.DrawText(Target, new Vector2(160, 100), new GuiString("@newburn?10"), TextAlignment.Center, VerticalTextAlignment.Center); } }
public override void OnRender(RenderTarget Target) { int y = -1; TextHelper txt = new TextHelper(app, "burn"); txt.AddArgument("|J", (app as BurntimeClassic).Game.World.Day); txt.AddArgument("|B", fighter); txt.AddArgument("|G", technician); txt.AddArgument("|H", doctor); txt.AddArgument("|C", maggots); txt.AddArgument("|D", rats); txt.AddArgument("|E", snakes); txt.AddArgument("|F", meat); txt.AddArgument("|A", locations); txt.AddArgument("|I", controlledCities); txt.AddArgument("|K", cities); for (int i = 0; i < 16; i++) { String str = txt[569 + i]; int x = Target.Width / 2 - font.GetWidth(str) / 2 - 10; font.DrawText(Target, new Vector2(x, y), str, TextAlignment.Left, VerticalTextAlignment.Top); y += 11; } }
public override void OnRender(RenderTarget target) { base.OnRender(target); if (txtlines != 0) { TextHelper txt = new TextHelper(app, "burn"); String line = txt[txtoffset + (int)txtline]; font.DrawText(target, new Vector2(160, 200 - 15), line, TextAlignment.Center, VerticalTextAlignment.Top); } }
public override void OnRender(RenderTarget Target) { base.OnRender(Target); // show hover text only for one item if (GetTopMostItem() == this && text != null) { Target.Layer++; RenderTarget bigger = Target.GetSubBuffer(new Rect(-50, -50, 132, 132)); font.DrawText(bigger, new Vector2(66, 41), text, TextAlignment.Center, VerticalTextAlignment.Top); } }
public override void OnRender(Platform.Graphics.RenderTarget target) { base.OnRender(target); target.Layer += 1; target.RenderRect(Vector2.Zero, new Vector2((int)System.Math.Ceiling(Progress * (Size.x - border * 2)) + border, Size.y), color); target.Layer -= 1; target.Layer += 3; font.DrawText(target, new Vector2(Size.x / 2, Size.y / 2), Text, TextAlignment.Center, VerticalTextAlignment.Center); target.Layer -= 3; }
public override void OnRender(RenderTarget target) { base.OnRender(target); if (restaurantText != null) { int basex = 157 + 80; int basey = 4; for (int i = 0; i < 3; i++) { font.DrawText(target, new Vector2(basex, basey + 9 * i), restaurantText[i], TextAlignment.Center, VerticalTextAlignment.Top); } } }
public override void OnRender(RenderTarget target) { base.OnRender(target); target.Layer += 10; BurntimeClassic classic = app as BurntimeClassic; if (classic.InventoryRoom != null && classic.InventoryRoom.IsWaterSource) { TextHelper txt = new TextHelper(app, "burn"); txt.AddArgument("|C", classic.Game.World.ActiveLocationObj.Source.Reserve); waterSourceFont.DrawText(target, target.Size, txt[423]); Vector2 bar = new Vector2(14, classic.Game.World.ActiveLocationObj.Source.Reserve * 2); target.RenderRect(target.Size - new Vector2(2, 10) - bar, bar, new PixelColor(240, 64, 56)); } target.Layer -= 10; }
public override void OnRender(RenderTarget target) { target.DrawSprite(Vector2.Zero, top); for (int i = 0; i < list.Count; i++) { int itemx = 0; int itemy = 4 + 11 * i; int textx = 34 - font.GetWidth(list[i].Text) / 2; int texty = itemy + 2; target.DrawSprite(new Vector2(itemx, itemy), middle); target.Layer++; GuiFont f = (hover == i) ? hoverFont : font; f.DrawText(target, new Vector2(textx, texty), list[i].Text, TextAlignment.Left, VerticalTextAlignment.Top); target.Layer--; } target.DrawSprite(new Vector2(0, top.Height + middle.Height * list.Count), bottom); }
public override void OnRender(RenderTarget Target) { font.DrawText(Target, new Vector2(63, 6), title, TextAlignment.Center, VerticalTextAlignment.Top); Target.Layer++; PixelColor color; switch (exchangeResult) { case ExchangeResult.Ok: color = new PixelColor(0, 156, 0); break; case ExchangeResult.Ng: color = new PixelColor(208, 0, 0); break; default: color = new PixelColor(72, 72, 116); break; } Target.RenderRect(new Vector2(10, 7), new Vector2(12, 5), color); Target.Layer--; }
public override void OnRender(RenderTarget Target) { font.DrawText(Target, new Vector2(160, 100), new GuiString("@newburn?11"), TextAlignment.Center, VerticalTextAlignment.Center); }
public override void OnRender(RenderTarget Target) { if (side) { for (int i = pages.Count - 1; i >= 0; i--) { Target.DrawSprite(basePos + new Vector2(3, -2) * i, back); } } else { for (int i = pages.Count - 1; i >= 0; i--) { Target.DrawSprite(basePos + -3 * i, back); } } TextHelper txt = new TextHelper(app, "burn"); txt.AddArgument("|B", activePage.Character.Health); txt.AddArgument("|A", activePage.Character.Experience); txt.AddArgument("|C", activePage.Character.Water); txt.AddArgument("|D", activePage.Character.Food); txt.AddArgument("{attack}", (int)activePage.Character.AttackValue); txt.AddArgument("{defense}", (int)activePage.Character.DefenseValue); int fontSpacing = 10; Vector2 textPos = new Vector2(); textPos.x = basePos.x + (side ? 11 : 73); textPos.y = basePos.y + 11; font.DrawText(Target, textPos, txt[40 + (int)activePage.Character.Class], TextAlignment.Left, VerticalTextAlignment.Top); textPos.y += fontSpacing; font.DrawText(Target, textPos, txt[380], TextAlignment.Left, VerticalTextAlignment.Top); textPos.y += fontSpacing; font.DrawText(Target, textPos, txt[381], TextAlignment.Left, VerticalTextAlignment.Top); textPos.y += fontSpacing; if (activePage.Character.Class != CharClass.Trader) { font.DrawText(Target, textPos, txt[403], TextAlignment.Left, VerticalTextAlignment.Top); textPos.y += fontSpacing; font.DrawText(Target, textPos, txt[402], TextAlignment.Left, VerticalTextAlignment.Top); textPos.y += fontSpacing; font.DrawText(Target, textPos, txt.Get("newburn?100"), TextAlignment.Left, VerticalTextAlignment.Top); textPos.x = basePos.x + 20; font.DrawText(Target, textPos, txt.Get("newburn?99"), TextAlignment.Left, VerticalTextAlignment.Top); textPos.y += fontSpacing; if (activePage.Character.Protection != null) { string text = ""; foreach (var protection in activePage.Character.Protection.Type.Protection) { var p = protection.Object; text += (int)(System.Math.Round(p.Rate * 100)); if (p.Type == "gas") { text += app.ResourceManager.GetString("newburn?101"); } else { text += app.ResourceManager.GetString("newburn?102"); } } font.DrawText(Target, textPos, text, TextAlignment.Left, VerticalTextAlignment.Top); } textPos.y += fontSpacing; } pageName = ""; for (int i = 0; i < pageButtons.Length; i++) { if (pageButtons[i].IsHover && pageIndices[i] >= 0) { namePosition = pageButtons[i].Position + new Vector2(6, -9); pageName = pages[pageIndices[i]].Character.Name; } } Target.Layer += 5; if (pageName != "") { nameFont.DrawText(Target, namePosition, pageName, TextAlignment.Center, VerticalTextAlignment.Top); } Target.Layer -= 5; }
public override void OnRender(RenderTarget target) { target.RenderRect(FramePos, FrameSize, new PixelColor(128, 0, 0, 0)); base.OnRender(target); if (!ready) { return; } Vector2 textPos = new Vector2(43 + FrameSize.x / 2, 20); TextHelper txt = new TextHelper(app, "burn"); for (int i = 0; i < 2; i++) { if (dlgoffset + i < conversation.Text.Length) { String line = conversation.Text[dlgoffset + i]; Vector2 t = new Vector2(textPos); t.x -= fontText.GetWidth(line) / 2 - 1; fontText.DrawText(target, t, line, TextAlignment.Left, VerticalTextAlignment.Top); textPos.y += 11; } } textPos.x = 55; if (dialogmode == 0) { textPos.y = 85; if (hover == 0) { fontChoice.DrawText(target, textPos, txt[499], TextAlignment.Left, VerticalTextAlignment.Top); } else { fontOptions.DrawText(target, textPos, txt[499], TextAlignment.Left, VerticalTextAlignment.Top); } } else { textPos.y = 63; for (int i = 0; i < 3; i++) { String line = conversation.Choices[i].Text; if (hover == i) { fontChoice.DrawText(target, textPos, line, TextAlignment.Left, VerticalTextAlignment.Top); } else { fontOptions.DrawText(target, textPos, line, TextAlignment.Left, VerticalTextAlignment.Top); } textPos.y += 11; } } }