Exemple #1
0
        public override bool OnMouseMove(Vector2 position)
        {
            Vector2 Pos = position;

            TextHelper txt   = new TextHelper(app, "burn");
            int        textx = 55;

            hover = -1;

            if (dialogmode == 0)
            {
                int    texty = 85;
                String line  = txt[499];
                if (Pos.x >= textx && Pos.y >= texty && Pos.x < textx + fontText.GetWidth(line) && Pos.y < texty + 10)
                {
                    hover = 0;
                }
            }
            else if (dialogmode == 1)
            {
                int texty = 63;
                for (int i = 0; i < 3; i++)
                {
                    String line = conversation.Choices[i].Text;

                    if (Pos.x >= textx && Pos.y >= texty && Pos.x < textx + fontText.GetWidth(line) && Pos.y < texty + 10)
                    {
                        hover = i;
                    }
                    texty += 11;
                }
            }

            return(base.OnMouseMove(Position));
        }
Exemple #2
0
        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)
        {
            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;
            }
        }
Exemple #4
0
        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);
        }