Example #1
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            Ability s = BattleState.Commanding.EnemySkillMenu.Selected;

            int row = 0;

            if (s != null)
            {
                string cost = s.MPCost.ToString();
                Text.ShadowedText(g, "MP Req", X + x1, Y + y0);

                row++;

                cost = cost + "/";
                te = g.TextExtents(cost);
                Text.ShadowedText(g, cost, X + x2 - te.Width, Y + y0 + (row * ys));

                string tot = BattleState.Commanding.MP.ToString();
                te = g.TextExtents(tot);
                Text.ShadowedText(g, tot, X + x3 - te.Width, Y + y0 + (row * ys));

                row++;
            }
        }
Example #2
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            Text.ShadowedText(g, "Time", X + x1, Y + y1);
            Text.ShadowedText(g, "Gil", X + x1, Y + y2);

            g.SelectFontFace("Courier New", FontSlant.Normal, FontWeight.Bold);

            long s, m, h;
            s = GameClock.Seconds;
            m = GameClock.Minutes;
            h = GameClock.Hours;

            string time = String.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);

            te = g.TextExtents(time);
            Text.ShadowedText(g, time, X + x2 - te.Width, Y + y1);

            te = g.TextExtents(Gil);
            Text.ShadowedText(g, Gil, X + x2 - te.Width, Y + y2);
        }
Example #3
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            SummonMenuEntry s = BattleState.Commanding.SummonMenu.Selected;

            int row = 0;

            if (s != null)
            {
                string cost = s.Spell.MPCost.ToString();
                Text.ShadowedText(g, "MP Req", X + x1, Y + y0);

                row++;

                cost = cost + "/";
                te = g.TextExtents(cost);
                Text.ShadowedText(g, cost, X + x2 - te.Width, Y + y0 + (row * ys));

                string tot = BattleState.Commanding.MP.ToString();
                te = g.TextExtents(tot);
                Text.ShadowedText(g, tot, X + x3 - te.Width, Y + y0 + (row * ys));

                row++;

            //                if (s.AddedAbility.Contains(AddedAbility.All))
            //                {
            //                    string msg = "All x";
            //                    msg += s.AllCount.ToString();
            //                    Text.ShadowedText(g, msg, X + x0, Y + y0 + (row * ys));
            //                    row++;
            //                }

            //                if (s.AddedAbility.Contains(AddedAbility.QuadraMagic))
            //                {
            //                    string msg = "Q-Magic x";
            //                    msg += s.QMagicCount.ToString();
            //                    Text.ShadowedText(g, msg, X + x0, Y + y0 + (row * ys));
            //                    row++;
            //                }

            }
        }
Example #4
0
        public void Draw(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(20);

            TextExtents te = g.TextExtents(Message);

            Text.ShadowedText(g, Color, Message, X - (te.Width / 2), Y - (te.Height / 2) + GetCurrentDisplacement());
        }
Example #5
0
		void DrawVersionNumber (Cairo.Context c, ref Cairo.PointD bottomRight, string text)
		{
			c.SelectFontFace (SplashFontFamily, Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
			c.SetFontSize (SplashFontSize);
			
			var extents = c.TextExtents (text);
			c.MoveTo (bottomRight.X - extents.Width - 1, bottomRight.Y - extents.Height);
			
			c.Color = new Cairo.Color (1, 1, 1);
			c.ShowText (text);
		}
Example #6
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            te = g.TextExtents(AP);
            Text.ShadowedText(g, "AP", X + x1, Y + ys);
            Text.ShadowedText(g, AP, X + x2 - te.Width, Y + ys);
        }
Example #7
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            string gil = PostBattleState.Gil.ToString() + "g";
            te = g.TextExtents(gil);
            Text.ShadowedText(g, "Gained Gil", X + x1, Y + ys);
            Text.ShadowedText(g, gil, X + x2 - te.Width, Y + ys);
        }
Example #8
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            Color textColor = Character.Death ? Colors.TEXT_RED : Colors.WHITE;

            if (Character != null)
            {
                Images.RenderProfile(d, X + xpic, Y + ypic, Character);

                Text.ShadowedText(g, textColor,Character.Name, X + x1, Y + y0);
                Text.ShadowedText(g, textColor, "Level:", X + x2, Y + y1);

                string lvl = Character.Level.ToString();
                te = g.TextExtents(lvl);
                Text.ShadowedText(g, textColor, lvl, X + x3 - te.Width, Y + y1);

                string temp = "Exp:";
                te = g.TextExtents(temp);
                Text.ShadowedText(g, textColor, temp, X + x4 - te.Width, Y + y0);

                temp = "For level up:";
                te = g.TextExtents(temp);
                Text.ShadowedText(g, textColor, temp, X + x4 - te.Width, Y + y1);

                string exp = Character.Exp.ToString() + "p";
                te = g.TextExtents(exp);
                Text.ShadowedText(g, textColor, exp, X + x5 - te.Width, Y + y0);

                string expNext = Character.ExpToNextLevel.ToString() + "p";
                te = g.TextExtents(expNext);
                Text.ShadowedText(g, textColor, expNext, X + x5 - te.Width, Y + y1);
            }
        }
Example #9
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            BattleEvent e = BattleState.ActiveAbility;

            if (e != null)
            {
                g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
                g.SetFontSize(24);

                string msg = e.GetStatus();

                TextExtents te = g.TextExtents(msg);

                Text.ShadowedText(g, msg, X + (W / 2) - (te.Width / 2), Y + 32);
            }
        }
Example #10
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            string msg = "";

            if (BattleState.Screen.Control != null)
            {
                msg = BattleState.Screen.Control.Info;
            }

            te = g.TextExtents(msg);

            Text.ShadowedText(g, msg, X + (W / 2) - (te.Width / 2), Y + 32);
        }
Example #11
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            Text.ShadowedText(g, "Item", X + x1, Y + (ys * 1));

            List<Inventory.Record> taken = HoardItemLeft.Taken;

            for (int i = 0; i < taken.Count; i++)
            {
                if (taken[i].ID != "")
                {
                    string count = taken[i].Count.ToString();
                    te = g.TextExtents(count);
                    Text.ShadowedText(g, taken[i].Item.Name, X + x2, Y + (ys * (i + 2)));
                    Text.ShadowedText(g, count, X + x3 - te.Width, Y + (ys * (i + 2)));
                }
            }
        }
Example #12
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            string message = Message(Timer);

            TextExtents te = g.TextExtents(message);

            Move(100, 100);

            Width = (int)te.Width + w_padding * 2;
            Height = (int)te.Height + h_padding * 2;

            int x = ScreenState.Width / 2 - Width / 2;
            int y = ScreenState.Height / 2 - Height / 2;

            Move(x, y);

            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            double x_text = X + Width / 2 - te.Width / 2 - te.Width;
            double y_text = Y + Height / 2 - te.Height / 2;

            Text.ShadowedText(g, message, x_text, y_text);
        }
Example #13
0
        private void DrawText(Cairo.Context cr, string text, double lineSpacing)
        {
            string [] lines = text.Split('\n');
            double [] cuml_heights = new double[lines.Length];
            double y_start = 0.0;

            for(int i = 0; i < lines.Length; i++) {
                TextExtents extents = cr.TextExtents(lines[i]);
                double height = extents.Height + (i > 0 ? lineSpacing : 0);
                cuml_heights[i] = i > 0 ? cuml_heights[i - 1] + height : height;
            }

            y_start = (Allocation.Height / 2) - (cuml_heights[cuml_heights.Length - 1] / 2);

            for(int i = 0; i < lines.Length; i++) {
                TextExtents extents = cr.TextExtents(lines[i]);

                double x = (Allocation.Width / 2) - (extents.Width / 2);
                double y = y_start + cuml_heights[i];

                cr.MoveTo(x, y);
                cr.ShowText(lines[i]);
            }
        }
Example #14
0
        private Cairo.TextExtents TextExtents(Cairo.Context g, string str)
        {
            g.SelectFontFace (font_combo.ComboBox.ActiveText, FontSlant, FontWeight);
            g.SetFontSize (FontSize);

            return g.TextExtents (str);
        }
Example #15
0
            private void DrawCoords(Cairo.Context cairo)
            {
                cairo.Color = coordColor;
                // x-axis
                cairo.MoveTo (start_x, start_y);
                cairo.LineTo (start_x + graph_area_width,
                          start_y);
                cairo.Stroke ();

                // y-axis
                cairo.MoveTo (start_x, start_y);
                cairo.LineTo (start_x, offset_y);
                cairo.Stroke ();

                int max_height = 0;
                for (int i = 0; i < x_marks.Length; i++)
                  {
                      TextExtents extents =
                          cairo.
                          TextExtents (x_marks[i].
                                   name);
                      int height =
                          (int) Math.Round (extents.
                                    Height);
                      if (height > max_height)
                          max_height = height;
                  }

                for (int i = 0; i < x_marks.Length; i++)
                  {
                      if (i != 0)
                        {
                            cairo.MoveTo (start_x +
                                  x_marks[i].
                                  x, start_y);
                            cairo.LineTo (start_x +
                                  x_marks[i].
                                  x,
                                  offset_y);
                            cairo.Stroke ();
                        }

                      cairo.MoveTo (start_x +
                            x_marks[i].x,
                            start_y + offset +
                            max_height);
                      cairo.ShowText (x_marks[i].name);
                      cairo.Stroke ();
                  }

                for (int i = 0; i < y_marks.Length; i++)
                  {
                      TextExtents extents =
                          cairo.
                          TextExtents (y_marks[i].
                                   name);
                      int width =
                          (int) Math.Round (extents.
                                    Width);
                      int height =
                          (int) Math.Round (extents.
                                    Height);

                      cairo.MoveTo (start_x - offset / 2,
                            start_y -
                            y_marks[i].y);
                      cairo.LineTo (start_x + offset / 2,
                            start_y -
                            y_marks[i].y);
                      cairo.Stroke ();

                      cairo.MoveTo (start_x - offset -
                            width,
                            start_y -
                            y_marks[i].y +
                            height / 2);
                      cairo.ShowText (y_marks[i].name);
                      cairo.Stroke ();
                  }
            }
Example #16
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            Text.ShadowedText(g, "Take everything", X + x1, Y + (ys * 1));

            for (int i = 0; i < _hoard.Count; i++)
            {
                if (_hoard[i].ID != "")
                {
                    string count = _hoard[i].Count.ToString();
                    te = g.TextExtents(count);
                    Text.ShadowedText(g, _hoard[i].Item.Name, X + x2, Y + (ys * (i + 2)));
                    Text.ShadowedText(g, count, X + x3 - te.Width, Y + (ys * (i + 2)));
                }
            }

            Text.ShadowedText(g, "Exit", X + x1, Y + (ys * 7));

            if (IsControl)
            {
                Shapes.RenderCursor(g, X + cx + x1, Y + cy + ys * (_option + 1));
            }
        }
Example #17
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            string s;

            #region Character Status

            DrawCharacterStatus(d, g);

            #endregion Status

            Text.ShadowedText(g, Colors.TEXT_TEAL, "Attack", X + x0, Y + ym);
            Text.ShadowedText(g, Colors.TEXT_TEAL, "Halve", X + x0, Y + yn);
            Text.ShadowedText(g, Colors.TEXT_TEAL, "Void", X + x0, Y + yo);
            Text.ShadowedText(g, Colors.TEXT_TEAL, "Absorb", X + x0, Y + yp);

            g.SetFontSize(16);

            double x = (double)x1;
            double r = (double)(ym + ys);
            foreach (Element e in Enum.GetValues(typeof(Element)))
            {
                if (x > W - stop)
                {
                    x = x1;
                    r = r + ys;
                }

                s = e.ToString() + " ";
                te = g.TextExtents(s);
                if (Party.Selected.Halves(e))
                {
                    Text.ShadowedText(g, Colors.WHITE, e.ToString(), X + x, Y + r);
                }
                else
                {
                    Text.ShadowedText(g, Colors.GRAY_4, e.ToString(), X + x, Y + r);
                }
                x += te.XAdvance;
            }

            x = (double)x1;
            r = (double)(yn + ys);
            foreach (Element e in Enum.GetValues(typeof(Element)))
            {
                if (x > W - stop)
                {
                    x = x1;
                    r = r + ys;
                }

                s = e.ToString() + " ";
                te = g.TextExtents(s);
                if (Party.Selected.Halves(e))
                {
                    Text.ShadowedText(g, Colors.WHITE, e.ToString(), X + x, Y + r);
                }
                else
                {
                    Text.ShadowedText(g, Colors.GRAY_4, e.ToString(), X + x, Y + r);
                }
                x += te.XAdvance;
            }

            x = (double)x1;
            r = (double)(yo + ys);
            foreach (Element e in Enum.GetValues(typeof(Element)))
            {
                if (x > W - stop)
                {
                    x = x1;
                    r = r + ys;
                }

                s = e.ToString() + " ";
                te = g.TextExtents(s);
                if (Party.Selected.Voids(e))
                {
                    Text.ShadowedText(g, Colors.WHITE, e.ToString(), X + x, Y + r);
                }
                else
                {
                    Text.ShadowedText(g, Colors.GRAY_4, e.ToString(), X + x, Y + r);
                }
                x += te.XAdvance;
            }

            x = (double)x1;
            r = (double)(yp + ys);
            foreach (Element e in Enum.GetValues(typeof(Element)))
            {
                if (x > W - stop)
                {
                    x = x1;
                    r = r + ys;
                }

                s = e.ToString() + " ";
                te = g.TextExtents(s);
                if (Party.Selected.Absorbs(e))
                {
                    Text.ShadowedText(g, Colors.WHITE, e.ToString(), X + x, Y + r);
                }
                else
                {
                    Text.ShadowedText(g, Colors.GRAY_4, e.ToString(), X + x, Y + r);
                }
                x += te.XAdvance;
            }
        }
Example #18
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            MateriaOrb orb = MenuState.MateriaTop.Selection;

            if (orb == null)
            {
                orb = MenuState.MateriaList.Selection;
            }

            if (orb != null)
            {
                Shapes.RenderCircle(g, Colors.WHITE, 9, X + x1, Y + yp);
                Shapes.RenderCircle(g, orb.Color, 7, X + x1, Y + yp);
                Text.ShadowedText(g, orb.Name, X + x2, Y + y0);

                Cairo.Color greenish = Colors.TEXT_TEAL;
                Cairo.Color yellow = Colors.TEXT_YELLOW;
                Cairo.Color red = Colors.TEXT_RED;

                if (orb is EnemySkillMateria)
                {
                    EnemySkillMateria esm = (EnemySkillMateria)orb;

                    string mask = "";
                    for (int i = 0; i < MenuState.Seven.Data.EnemySkillCount; i++)
                    {
                        mask += ((esm.AP >> i) & 1) > 0 ? "1" : "0";
                    }
                    Text.ShadowedText(g, mask, X + x1, Y + y3);
                }
                else
                {
                    string lvl = (orb.Level + 1).ToString() + "/";
                    te = g.TextExtents(lvl);
                    Text.ShadowedText(g, lvl, X + x6 - te.Width, Y + y0);

                    string lvls = orb.Tiers.Length.ToString();
                    te = g.TextExtents(lvls);
                    Text.ShadowedText(g, lvls, X + x7 - te.Width, Y + y0);

                    te = g.TextExtents("Level");
                    Text.ShadowedText(g, greenish, "Level", X + x5 - te.Width, Y + y0);

                    string ap;
                    if (orb.AP < orb.Tiers[orb.Tiers.Length - 1])
                    {
                        ap = orb.AP.ToString();
                    }
                    else
                    {
                        ap = "MASTER";
                    }
                    te = g.TextExtents(ap);
                    Text.ShadowedText(g, ap, X + x7 - te.Width, Y + y1);
                    te = g.TextExtents("AP");
                    Text.ShadowedText(g, greenish, "AP", X + x5 - te.Width, Y + y1);

                    string nxt;
                    if (orb.Master)
                    {
                        nxt = "0";
                    }
                    else
                    {
                        nxt = (orb.Tiers[orb.Level + 1] - orb.AP).ToString();
                    }
                    te = g.TextExtents(nxt);
                    Text.ShadowedText(g, nxt, X + x7 - te.Width, Y + y2);
                    te = g.TextExtents("To next level");
                    Text.ShadowedText(g, greenish, "To next level", X + x5 - te.Width, Y + y2);

                    Text.ShadowedText(g, greenish, "Ability List", X + x0, Y + y3);

                    int k = 0;
                    foreach (string s in orb.AbilityDescriptions)
                    {
                        if (!String.IsNullOrEmpty(s))
                        {
                            Color abilityTextColor = Colors.GRAY_4;

                            if (orb is MasterMateria || orb.Abilities.Contains(s))
                            {
                                abilityTextColor = Colors.WHITE;
                            }

                            Text.ShadowedText(g, abilityTextColor, s, X + x1, Y + y4 + (ys * k));

                            k++;
                        }
                    }

                    Text.ShadowedText(g, greenish, "Equip Effect", X + x4, Y + y3);

                    int i = 0;
                    string stat;

                    te = g.TextExtents("-");
                    double dashw = te.Width;

                    te = g.TextExtents("+");
                    double plusw = te.Width;

                    #region Strength
                    if (orb.StrengthMod != 0)
                    {
                        Text.ShadowedText(g, "Str", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.StrengthMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.StrengthMod < 0)
                        {
                            Text.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Text.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Strength
                    #region Vitality
                    if (orb.VitalityMod != 0)
                    {
                        Text.ShadowedText(g, "Vit", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.VitalityMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.VitalityMod < 0)
                        {
                            Text.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Text.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Vitality
                    #region Dexterity
                    if (orb.DexterityMod != 0)
                    {
                        Text.ShadowedText(g, "Dex", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.DexterityMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.DexterityMod < 0)
                        {
                            Text.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Text.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Dexterity
                    #region Magic
                    if (orb.MagicMod != 0)
                    {
                        Text.ShadowedText(g, "Mag", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.MagicMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.MagicMod < 0)
                        {
                            Text.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Text.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Magic
                    #region Spirit
                    if (orb.SpiritMod != 0)
                    {
                        Text.ShadowedText(g, "Spr", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.SpiritMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.SpiritMod < 0)
                        {
                            Text.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Text.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Spirit
                    #region Luck
                    if (orb.LuckMod != 0)
                    {
                        Text.ShadowedText(g, "Lck", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.LuckMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }

                        te = g.TextExtents(stat);
                        if (orb.LuckMod < 0)
                        {
                            Text.ShadowedText(g, "-", X + x7 - te.Width - dashw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, red, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Text.ShadowedText(g, "+", X + x7 - te.Width - plusw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, yellow, stat, X + x7 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion Luck
                    #region HP
                    if (orb.HPMod != 0)
                    {
                        Text.ShadowedText(g, "MaxHP", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.HPMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }
                        stat = stat + "%";
                        te = g.TextExtents(stat);
                        if (orb.HPMod < 0)
                        {
                            Text.ShadowedText(g, "-", X + x8 - te.Width - dashw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, red, stat, X + x8 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Text.ShadowedText(g, "+", X + x8 - te.Width - plusw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, yellow, stat, X + x8 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion HP
                    #region MP
                    if (orb.MPMod != 0)
                    {
                        Text.ShadowedText(g, "MaxMP", X + x5, Y + y4 + (ys * i));

                        stat = Math.Abs(orb.MPMod).ToString();
                        if (stat.Length < 2)
                        {
                            stat = "0" + stat;
                        }
                        stat = stat + "%";
                        te = g.TextExtents(stat);
                        if (orb.MPMod < 0)
                        {
                            Text.ShadowedText(g, "-", X + x8 - te.Width - dashw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, red, stat, X + x8 - te.Width, Y + y4 + (ys * i));
                        }
                        else
                        {
                            Text.ShadowedText(g, "+", X + x8 - te.Width - plusw, Y + y4 + (ys * i));
                            Text.ShadowedText(g, yellow, stat, X + x8 - te.Width, Y + y4 + (ys * i));
                        }
                        i++;
                    }
                    #endregion MP
                }
            }
        }
Example #19
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            string exp, next, llvl;

            #region Top Row

            DrawCharacterStatus(d, g);

            exp = Party.Selected.Exp.ToString();
            next = Party.Selected.ExpToNextLevel.ToString();
            llvl = Party.Selected.LimitLevel.ToString();

            Text.ShadowedText(g, "Exp:", X + x8, Y + ya);
            Text.ShadowedText(g, "Next lvl:", X + x8, Y + yb);
            Text.ShadowedText(g, "Limit lvl:", X + x8, Y + yc);

            te = g.TextExtents(exp);
            Text.ShadowedText(g, exp, X + x11 - te.Width, Y + ya);
            te = g.TextExtents(next);
            Text.ShadowedText(g, next, X + x11 - te.Width, Y + yb);
            te = g.TextExtents(llvl);
            Text.ShadowedText(g, llvl, X + x11 - te.Width, Y + yc);

            #endregion Top

            #region Left

            string str, vit, dex, mag, spi, lck;
            string atk, atkp, def, defp, mat, mdf, mdfp;

            str = Party.Selected.Strength.ToString();
            vit = Party.Selected.Vitality.ToString();
            dex = Party.Selected.Dexterity.ToString();
            mag = Party.Selected.Magic.ToString();
            spi = Party.Selected.Spirit.ToString();
            lck = Party.Selected.Luck.ToString();

            atk = Ally.Attack(Party.Selected).ToString();
            atkp = Ally.AttackPercent(Party.Selected).ToString();
            def = Ally.Defense(Party.Selected).ToString();
            defp = Ally.DefensePercent(Party.Selected).ToString();
            mat = Ally.MagicAttack(Party.Selected).ToString();
            mdf = Ally.MagicDefense(Party.Selected).ToString();
            mdfp = Ally.MagicDefensePercent(Party.Selected).ToString();

            Cairo.Color greenish = Colors.TEXT_TEAL;

            Text.ShadowedText(g, greenish, "Strength", X + x0, Y + yq + (line * 0));
            Text.ShadowedText(g, greenish, "Vitality", X + x0, Y + yq + (line * 1));
            Text.ShadowedText(g, greenish, "Dexterity", X + x0, Y + yq + (line * 2));
            Text.ShadowedText(g, greenish, "Magic", X + x0, Y + yq + (line * 3));
            Text.ShadowedText(g, greenish, "Spirit", X + x0, Y + yq + (line * 4));
            Text.ShadowedText(g, greenish, "Luck", X + x0, Y + yq + (line * 5));

            Text.ShadowedText(g, greenish, "Attack", X + x0, Y + yr + (line * 0));
            Text.ShadowedText(g, greenish, "Attack %", X + x0, Y + yr + (line * 1));
            Text.ShadowedText(g, greenish, "Defense", X + x0, Y + yr + (line * 2));
            Text.ShadowedText(g, greenish, "Defense %", X + x0, Y + yr + (line * 3));
            Text.ShadowedText(g, greenish, "Magic", X + x0, Y + yr + (line * 4));
            Text.ShadowedText(g, greenish, "Magic def", X + x0, Y + yr + (line * 5));
            Text.ShadowedText(g, greenish, "Magic def %", X + x0, Y + yr + (line * 6));

            te = g.TextExtents(str);
            Text.ShadowedText(g, str, X + x1 - te.Width, Y + yq + (line * 0));
            te = g.TextExtents(vit);
            Text.ShadowedText(g, vit, X + x1 - te.Width, Y + yq + (line * 1));
            te = g.TextExtents(dex);
            Text.ShadowedText(g, dex, X + x1 - te.Width, Y + yq + (line * 2));
            te = g.TextExtents(mag);
            Text.ShadowedText(g, mag, X + x1 - te.Width, Y + yq + (line * 3));
            te = g.TextExtents(spi);
            Text.ShadowedText(g, spi, X + x1 - te.Width, Y + yq + (line * 4));
            te = g.TextExtents(lck);
            Text.ShadowedText(g, lck, X + x1 - te.Width, Y + yq + (line * 5));

            te = g.TextExtents(atk);
            Text.ShadowedText(g, atk, X + x1 - te.Width, Y + yr + (line * 0));
            te = g.TextExtents(atkp);
            Text.ShadowedText(g, atkp, X + x1 - te.Width, Y + yr + (line * 1));
            te = g.TextExtents(def);
            Text.ShadowedText(g, def, X + x1 - te.Width, Y + yr + (line * 2));
            te = g.TextExtents(defp);
            Text.ShadowedText(g, defp, X + x1 - te.Width, Y + yr + (line * 3));
            te = g.TextExtents(mat);
            Text.ShadowedText(g, mat, X + x1 - te.Width, Y + yr + (line * 4));
            te = g.TextExtents(mdf);
            Text.ShadowedText(g, mdf, X + x1 - te.Width, Y + yr + (line * 5));
            te = g.TextExtents(mdfp);
            Text.ShadowedText(g, mdfp, X + x1 - te.Width, Y + yr + (line * 6));

            #endregion Left

            #region Right

            MateriaSlots.Render(g, Party.Selected.Weapon, X + x9, Y + yi);
            MateriaSlots.Render(g, Party.Selected.Armor, X + x9, Y + yk);

            g.Color = Colors.TEXT_TEAL;
            g.MoveTo(X + x7, Y + yh);
            g.ShowText("Wpn.");
            g.MoveTo(X + x7, Y + yj);
            g.ShowText("Arm.");
            g.MoveTo(X + x7, Y + yl);
            g.ShowText("Acc.");
            g.Color = Colors.WHITE;

            Text.ShadowedText(g, Party.Selected.Weapon.Name, X + x8, Y + yh);
            Text.ShadowedText(g, Party.Selected.Armor.Name, X + x8, Y + yj);
            Text.ShadowedText(g, Party.Selected.Accessory.Name, X + x8, Y + yl);

            #endregion Right
        }
Example #20
0
        const int yc = yb + 25; // subrow 3

        #endregion Fields

        #region Methods

        public static void RenderCharacterStatus(Gdk.Drawable d, Cairo.Context g, Character c, int x, int y, bool showFurySadness = true)
        {
            TextExtents te;

            string lvl, hp, hpm, mp, mpm;

            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Normal);

            g.Color = Colors.TEXT_TEAL;
            g.MoveTo(x + x3, y + ya);
            g.ShowText("LV");
            g.MoveTo(x + x3, y + yb);
            g.ShowText("HP");
            g.MoveTo(x + x3, y + yc);
            g.ShowText("MP");
            g.Color = Colors.WHITE;

            if (showFurySadness)
            {
                if (c.Fury)
                {
                    Text.ShadowedText(g, Colors.TEXT_MAGENTA, "[Fury]", x + x7, y);
                }
                else if (c.Sadness)
                {
                    Text.ShadowedText(g, Colors.TEXT_MAGENTA, "[Sadness]", x + x7, y);
                }
            }

            Color namec = Colors.WHITE;

            if (c.Death)
            {
                namec = Colors.TEXT_RED;
            }
            else if (c.NearDeath)
            {
                namec = Colors.TEXT_YELLOW;
            }

            Text.ShadowedText(g, namec, c.Name, x + x3, y);

            lvl = c.Level.ToString();
            te = g.TextExtents(lvl);
            Text.ShadowedText(g, lvl, x + x4 - te.Width, y + ya);

            hp = c.HP.ToString() + "/";
            te = g.TextExtents(hp);
            Text.ShadowedText(g, hp, x + x5 - te.Width, y + yb);

            hpm = c.MaxHP.ToString();
            te = g.TextExtents(hpm);
            Text.ShadowedText(g, hpm, x + x6 - te.Width, y + yb);

            mp = c.MP.ToString() + "/";
            te = g.TextExtents(mp);
            Text.ShadowedText(g, mp, x + x5 - te.Width, y + yc);

            mpm = c.MaxMP.ToString();
            te = g.TextExtents(mpm);
            Text.ShadowedText(g, mpm, x + x6 - te.Width, y + yc);
        }
		protected override void PaintWidget (Cairo.Context ctx, int w, int h) {
			ctx.SetFill (0.0d, 0.0d, 0.0d);
			ctx.Rectangle (0.0d, Offset, w, h - Offset);
			ctx.Fill ();
			ctx.SetFill (BlueprintStyle.BluePrint);
			ctx.Rectangle (0.0d, 0.0d, w, Offset);
			ctx.Fill ();
			double wr = w - 2.0d * Offset;
			double ew = wr / (max - min + 1 + shaft * (max - min));
			this.flapWidth = ew;
			double xc = Offset;
			for (int i = min; i <= max; i++) {
				if (i != current) {
					ctx.Rectangle (xc, Offset, ew, h - 2.0d * Offset);
				}
				xc += (1.0d + shaft) * ew;
			}
			ctx.FillPreserve ();
			LinearGradient p = new LinearGradient (0.0d, Offset, 0.0d, Offset + 10.0d);
			double fctr = 0.5d;
			for (double y = 0.0d; y <= 1.0d; y += 0.1d) {
				p.AddColorStopRgb (y, new Color (fctr * BlueprintStyle.BluePrintShadow.R, fctr * BlueprintStyle.BluePrintShadow.G, fctr * BlueprintStyle.BluePrintShadow.B));
				fctr += 0.05d;
			}
			ctx.SetFill (p);
			ctx.Fill ();
			ctx.Rectangle (Offset + (1.0d + shaft) * ew * (current - min), Offset, ew, h - 2.0d * Offset);
			ctx.SetFill (BlueprintStyle.BluePrint);
			ctx.Fill ();
			xc = Offset;
			ctx.SetFill (BlueprintStyle.HardWhite);
			ctx.MoveTo (0.0d, Offset);
			ctx.LineTo (Offset, Offset);
			for (int i = min; i <= max; i++) {
				ctx.LineTo (xc, h - Offset);
				ctx.LineTo (xc + ew, h - Offset);
				ctx.LineTo (xc + ew, Offset);
				xc += (1.0d + shaft) * ew;
				if (i < max) {
					ctx.LineTo (xc, Offset);
				}
			}
			ctx.LineTo (w - Offset, Offset);
			ctx.LineTo (w, Offset);
			ctx.MoveTo (Offset, Offset);
			ctx.LineTo (Offset + (1.0d + shaft) * ew * (current - min), Offset);
			ctx.MoveTo (w - Offset, Offset);
			ctx.LineTo (w - Offset + (1.0d + shaft) * ew * (current - max), Offset);
			ctx.Stroke ();
			xc = Offset + 0.5d * ew;
			IEnumerable<string> namei = this.names.Skip (this.min);
			IEnumerator<string> enume = namei.GetEnumerator ();
			for (int i = min; i <= max && enume.MoveNext (); i++) {
				string name = enume.Current;
				if (name != null) {
					#if PANGO
					Pango.Layout pglay = Pango.CairoHelper.CreateLayout (ctx);
					pglay.SetText (name);
					Pango.Rectangle ra, rb;
					pglay.GetExtents (out ra, out rb);
					double tew = rb.Width / 1024.0d;
					double teh = rb.Height / 1024.0d;
					#else
					TextExtents te = ctx.TextExtents (name);
					double tew = te.Width;
					double teh = te.Height;
					#endif
					ctx.MoveTo (xc - 0.5d * tew, 0.5d * (h + teh));
					ctx.ShowText (name);
					xc += (1.0d + shaft) * ew;
				}
			}
		}
Example #22
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            #region Left

            int atk, atkp, def, defp, mat, mdf, mdfp;

            atk = Ally.Attack(MenuState.Party.Selected);
            atkp = Ally.AttackPercent(MenuState.Party.Selected);
            def = Ally.Defense(MenuState.Party.Selected);
            defp = Ally.DefensePercent(MenuState.Party.Selected);
            mat = Ally.MagicAttack(MenuState.Party.Selected);
            mdf = Ally.MagicDefense(MenuState.Party.Selected);
            mdfp = Ally.MagicDefensePercent(MenuState.Party.Selected);

            Cairo.Color greenish = Colors.TEXT_TEAL;

            Text.ShadowedText(g, greenish, "Attack", X + x0, Y + yr + (line * 0));
            Text.ShadowedText(g, greenish, "Attack %", X + x0, Y + yr + (line * 1));
            Text.ShadowedText(g, greenish, "Defense", X + x0, Y + yr + (line * 2));
            Text.ShadowedText(g, greenish, "Defense %", X + x0, Y + yr + (line * 3));
            Text.ShadowedText(g, greenish, "Magic", X + x0, Y + yr + (line * 4));
            Text.ShadowedText(g, greenish, "Magic def", X + x0, Y + yr + (line * 5));
            Text.ShadowedText(g, greenish, "Magic def %", X + x0, Y + yr + (line * 6));

            te = g.TextExtents(atk.ToString());
            Text.ShadowedText(g, atk.ToString(), X + x1 - te.Width, Y + yr + (line * 0));
            te = g.TextExtents(atkp.ToString());
            Text.ShadowedText(g, atkp.ToString(), X + x1 - te.Width, Y + yr + (line * 1));
            te = g.TextExtents(def.ToString());
            Text.ShadowedText(g, def.ToString(), X + x1 - te.Width, Y + yr + (line * 2));
            te = g.TextExtents(defp.ToString());
            Text.ShadowedText(g, defp.ToString(), X + x1 - te.Width, Y + yr + (line * 3));
            te = g.TextExtents(mat.ToString());
            Text.ShadowedText(g, mat.ToString(), X + x1 - te.Width, Y + yr + (line * 4));
            te = g.TextExtents(mdf.ToString());
            Text.ShadowedText(g, mdf.ToString(), X + x1 - te.Width, Y + yr + (line * 5));
            te = g.TextExtents(mdfp.ToString());
            Text.ShadowedText(g, mdfp.ToString(), X + x1 - te.Width, Y + yr + (line * 6));

            if (MenuState.EquipList.IsControl)
            {
                int t_atk, t_atkp, t_def, t_defp, t_mat, t_mdf, t_mdfp;

                IInventoryItem temp;

                switch (MenuState.EquipTop.Option)
                {
                    case 0:
                        temp = MenuState.Party.Selected.Weapon;
                        MenuState.Party.Selected.Weapon = (Weapon)MenuState.EquipList.Selection;
                        break;
                    case 1:
                        temp = MenuState.Party.Selected.Armor;
                        MenuState.Party.Selected.Armor = (Armor)MenuState.EquipList.Selection;
                        break;
                    case 2:
                        temp = MenuState.Party.Selected.Accessory;
                        MenuState.Party.Selected.Accessory = (Accessory)MenuState.EquipList.Selection;
                        break;
                    default:
                        temp = MenuState.Party.Selected.Weapon;
                        break;
                }

                t_atk = Ally.Attack(MenuState.Party.Selected);
                t_atkp = Ally.AttackPercent(MenuState.Party.Selected);
                t_def = Ally.Defense(MenuState.Party.Selected);
                t_defp = Ally.DefensePercent(MenuState.Party.Selected);
                t_mat = Ally.MagicAttack(MenuState.Party.Selected);
                t_mdf = Ally.MagicDefense(MenuState.Party.Selected);
                t_mdfp = Ally.MagicDefensePercent(MenuState.Party.Selected);

                switch (MenuState.EquipTop.Option)
                {
                    case 0:
                        MenuState.Party.Selected.Weapon = (Weapon)temp;
                        break;
                    case 1:
                        MenuState.Party.Selected.Armor = (Armor)temp;
                        break;
                    case 2:
                        MenuState.Party.Selected.Accessory = (Accessory)temp;
                        break;
                    default: break;
                }

                Color c;

                Text.ShadowedText(g, ">", X + x2, Y + yr + (line * 0));
                Text.ShadowedText(g, ">", X + x2, Y + yr + (line * 1));
                Text.ShadowedText(g, ">", X + x2, Y + yr + (line * 2));
                Text.ShadowedText(g, ">", X + x2, Y + yr + (line * 3));
                Text.ShadowedText(g, ">", X + x2, Y + yr + (line * 4));
                Text.ShadowedText(g, ">", X + x2, Y + yr + (line * 5));
                Text.ShadowedText(g, ">", X + x2, Y + yr + (line * 6));

                te = g.TextExtents(t_atk.ToString());
                if (t_atk < atk) c = Colors.TEXT_RED;
                else if (t_atk > atk) c = Colors.TEXT_YELLOW;
                else c = Colors.WHITE;
                Text.ShadowedText(g, c, t_atk.ToString(), X + x3 - te.Width, Y + yr + (line * 0));

                te = g.TextExtents(t_atkp.ToString());
                if (t_atkp < atkp) c = Colors.TEXT_RED;
                else if (t_atkp > atkp) c = Colors.TEXT_YELLOW;
                else c = Colors.WHITE;
                Text.ShadowedText(g, c, t_atkp.ToString(), X + x3 - te.Width, Y + yr + (line * 1));

                te = g.TextExtents(t_def.ToString());
                if (t_def < def) c = Colors.TEXT_RED;
                else if (t_def > def) c = Colors.TEXT_YELLOW;
                else c = Colors.WHITE;
                Text.ShadowedText(g, c, t_def.ToString(), X + x3 - te.Width, Y + yr + (line * 2));

                te = g.TextExtents(t_defp.ToString());
                if (t_defp < defp) c = Colors.TEXT_RED;
                else if (t_defp > defp) c = Colors.TEXT_YELLOW;
                else c = Colors.WHITE;
                Text.ShadowedText(g, c, t_defp.ToString(), X + x3 - te.Width, Y + yr + (line * 3));

                te = g.TextExtents(t_mat.ToString());
                if (t_mat < mat) c = Colors.TEXT_RED;
                else if (t_mat > mat) c = Colors.TEXT_YELLOW;
                else c = Colors.WHITE;
                Text.ShadowedText(g, c, t_mat.ToString(), X + x3 - te.Width, Y + yr + (line * 4));

                te = g.TextExtents(t_mdf.ToString());
                if (t_mdf < mdf) c = Colors.TEXT_RED;
                else if (t_mdf > mdf) c = Colors.TEXT_YELLOW;
                else c = Colors.WHITE;
                Text.ShadowedText(g, c, t_mdf.ToString(), X + x3 - te.Width, Y + yr + (line * 5));

                te = g.TextExtents(t_mdfp.ToString());
                if (t_mdfp < mdfp) c = Colors.TEXT_RED;
                else if (t_mdfp > mdfp) c = Colors.TEXT_YELLOW;
                else c = Colors.WHITE;
                Text.ShadowedText(g, c, t_mdfp.ToString(), X + x3 - te.Width, Y + yr + (line * 6));

            }

            #endregion Left
        }
Example #23
0
		void DrawAlphaBetaMarker (Cairo.Context c, ref Cairo.PointD bottomRight, string text)
		{
			c.SelectFontFace (SplashFontFamily, Cairo.FontSlant.Normal, Cairo.FontWeight.Bold);
			c.SetFontSize (SplashFontSize);
			
			// Create a rectangle larger than the text so we can have a nice border
			var extents = c.TextExtents (text);
			var x = bottomRight.X - extents.Width * 1.3;
			var y = bottomRight.Y - extents.Height * 1.5;
			var rectangle = new Cairo.Rectangle (x, y, bottomRight.X - x, bottomRight.Y - y);
			
			// Draw the background color the text will be overlaid on
			DrawRoundedRectangle (c, rectangle);
			
			// Calculate the offset the text will need to be at to be centralised
			// in the border
			x = x + extents.XBearing + (rectangle.Width - extents.Width) / 2;
			y = y - extents.YBearing + (rectangle.Height - extents.Height) / 2;
			c.MoveTo (x, y);
			
			// Draw the text
			c.Color = new Cairo.Color (1, 1, 1);
			c.ShowText (text);
			
			bottomRight.Y -= rectangle.Height - 2;
		}
Example #24
0
 private void DrawText(Cairo.Context g, string text, int top, int left)
 {
     g.SetSourceRGB(0, 0, 0);
     g.SetFontSize(cellHeight / 1.5);
     FontExtents fe = g.FontExtents;
     TextExtents te = g.TextExtents(text);
     g.MoveTo(left * cellWidth +(cellWidth - te.Width) / 2, top * cellHeight + (cellHeight + te.YBearing + fe.Height) / 2);
     g.ShowText(text);
 }
Example #25
0
        private void DrawAllyStatus(Gdk.Drawable d, Cairo.Context g, Ally a, int y)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            string hp, hpmax, mp, mpmax, limit, time;

            TextExtents te;

            Color color;

            // slashes

            color = Colors.WHITE;

            te = g.TextExtents(SLASH);
            Text.ShadowedText(g, color, SLASH, X + x_hp_slash - te.Width, Y + y);
            Text.ShadowedText(g, color, SLASH, X + x_mp_slash - te.Width, Y + y);

            // HP

            if (a.Death)
            {
                color = Colors.TEXT_RED;
            }
            else if (a.NearDeath)
            {
                color = Colors.TEXT_YELLOW;
            }

            hp = a.HP.ToString();
            te = g.TextExtents(hp);
            Text.ShadowedText(g, color, hp, X + x_hp - te.Width, Y + y);

            // MP

            color = Colors.WHITE;

            if (a.Death)
            {
                color = Colors.TEXT_RED;
            }
            else if (a.MP <= a.MaxMP / 8)
            {
                color = Colors.TEXT_YELLOW;
            }

            mp = a.MP.ToString();
            te = g.TextExtents(mp);
            Text.ShadowedText(g, mp, X + x_mp - te.Width, Y + y);

            // HP MAX / MP MAX

            color = a.Death ? Colors.TEXT_RED : Colors.WHITE;

            hpmax = a.MaxHP.ToString();
            te = g.TextExtents(hpmax);
            Text.ShadowedText(g, color, hpmax, X + x_hpmax - te.Width, Y + y);

            mpmax = a.MaxMP.ToString();
            te = g.TextExtents(mpmax);
            Text.ShadowedText(g, mpmax, X + x_mpmax - te.Width, Y + y);

            // LIMIT

            color = Colors.WHITE;

            limit = "0%";

            te = g.TextExtents(limit);
            Text.ShadowedText(g, limit, X + x_limit - te.Width + te.XBearing, Y + y);

            // TURN TIMER

            time = a.TurnTimer.PercentComplete + "%";

            te = g.TextExtents(time);
            Text.ShadowedText(g, time, X + x_time - te.Width + te.XBearing, Y + y);
        }
Example #26
0
    public override void Draw(Cairo.Context cr)
    {
        int dir = X1 > X0 ? 1 : -1;

        cr.Save();

        cr.SetFontSize(8);
        if(arrow_kind == ArrowKind.Return)
        {
            double[] returnDash = new double[]{ 3.0, 3.0 };
            cr.SetDash(returnDash, 0);
        }

        cr.MoveTo(X0, Y0);
        cr.LineTo(X1, Y1);
        cr.Stroke();

        cr.MoveTo(X1 - dir*7, Y1 - 3);
        cr.LineTo(X1, Y1);
        cr.LineTo(X1 - dir*7, Y1 + 3);
        if(arrow_kind == ArrowKind.Async)
        {
            cr.Stroke();
        }
        else
        {
            cr.MoveTo(X1 - dir*7, Y1 - 3);
            cr.Fill();
        }

        if((text != null) && !text.Equals(""))
        {
            if(dir > 0)
            {
                cr.MoveTo(XText + 5, Y0 - 5);
                cr.ShowText(text);
            }
            else
            {
                TextExtents te = cr.TextExtents(text);
                cr.MoveTo(XText - 5 - te.Width, Y0 - 5);
                cr.ShowText(text);
            }
        }
        cr.Restore();
    }
        public void DrawIcon(TextEditor editor, Cairo.Context cr, DocumentLine lineSegment, int lineNumber, double x, double y, double width, double height)
        {
            if (BookmarkService.Instance.CheckLineForBookmark (editor.FileName, lineSegment.LineNumber)) {
                Cairo.Color color1 = editor.ColorStyle.Bookmarks.Color;
                Cairo.Color color2 = editor.ColorStyle.Bookmarks.SecondColor;

                if (Bookmark.BookmarkType == BookmarkType.Local)
                    DrawRoundRectangle (cr, x + 1, y + 1, 8, width - 4, height - 4);
                else
                    DrawCircle (cr, x + (width / 2), y + (height / 2), 6);

                using (var pat = new Cairo.LinearGradient (x + width / 4, y, x + width / 2, y + height - 4)) {
                    pat.AddColorStop (0, color1);
                    pat.AddColorStop (1, color2);
                    cr.Pattern = pat;
                    cr.FillPreserve ();
                }

                using (var pat = new Cairo.LinearGradient (x, y + height, x + width, y)) {
                    pat.AddColorStop (0, color2);
                    //pat.AddColorStop (1, color1);
                    cr.Pattern = pat;
                    cr.Stroke ();
                }

                cr.Color = new Cairo.Color (0, 0, 0);
                cr.SelectFontFace (DesktopService.DefaultMonospaceFont, Cairo.FontSlant.Normal, Cairo.FontWeight.Bold);
                cr.SetFontSize (12);
                var te = cr.TextExtents (Bookmark.Number.ToString ());
                cr.MoveTo (x + 5, y + 1 + te.Height);
                cr.ShowText (Bookmark.Number.ToString ());
            }
        }
Example #28
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            int j = Math.Min(_rows + _topRow, Inventory.INVENTORY_SIZE);

            for (int i = _topRow; i < j; i++)
            {
                IInventoryItem item = BattleState.Party.Inventory.GetItem(i);

                if (item != null)
                {
                    int count = BattleState.Party.Inventory.GetCount(i);
                    te = g.TextExtents(count.ToString());

                    Color textColor = item.CanUseInBattle ? Colors.WHITE : Colors.GRAY_4;

                    Text.ShadowedText(g, textColor, item.Name,
                            X + x1, Y + (i - _topRow + 1) * y);
                    Text.ShadowedText(g, textColor, count.ToString(),
                            X + x2 - te.Width, Y + (i - _topRow + 1) * y);
                }
            }

            if (IsControl)
            {
                Shapes.RenderCursor(g, X + cx, Y + cy + (_option - _topRow) * y);
            }
        }
Example #29
0
        protected void DrawTextAt(Cairo.Context gr, double x, double y, string text, bool HCenter = false, bool VCenter = false)
        {
            TextExtents extents = gr.TextExtents(text);

            if (HCenter)
            {
                x = (this.WidthRequest / 2) - (extents.Width / 2);
            }
            if (VCenter)
            {
                y = (this.HeightRequest / 2) + (extents.Height / 2);
            }

            gr.MoveTo(this._x + x, this._y + y);
            gr.ShowText(text);
        }
Example #30
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            if (SelectedEquipment != null)
            {
                MateriaSlots.Render(g, SelectedEquipment, X + x1, Y + y_slots, false);

                Text.ShadowedText(g, Colors.TEXT_TEAL, "Slot", X + x0, Y + ya);
                Text.ShadowedText(g, Colors.TEXT_TEAL, "Growth", X + x0, Y + yb);

                string growth = SelectedEquipment.Growth.ToString();

                te = g.TextExtents(growth);

                Text.ShadowedText(g, growth, X + x1, Y + yb);
            }
        }