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(Text.FONT_SIZE_LABEL);

            Text.ShadowedText(g, "Equip", X + 20, Y + 25);
        }
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);

            Text.ShadowedText(g, "Level Up!", X + xs, Y + ys);
        }
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;

            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 #4
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 #5
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);

            Text.ShadowedText(g, MenuState.ConfigScreen.Control.Info, X + 20, Y + 27);
        }
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);

            Text.ShadowedText(g, "Please Make a Party of Three", X + 50, Y + 25);
        }
Example #7
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 #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;

            te = g.TextExtents(AP);
            Text.ShadowedText(g, "AP", X + x1, Y + ys);
            Text.ShadowedText(g, AP, X + x2 - te.Width, Y + ys);
        }
Example #9
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 #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 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 #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;

            #region Character Status

            DrawCharacterStatus(d, g);

            #endregion Status
        }
Example #12
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 #13
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 #14
0
        public static void ShadowedText(Cairo.Context g, Cairo.Color c, string text, double x, double y, string font, int point)
        {
            g.Save();

            g.SelectFontFace(font, FontSlant.Normal, FontWeight.Normal);
            g.SetFontSize(point);

            g.MoveTo(x + SHADOW_SPACING, y + SHADOW_SPACING);
            g.Color = Colors.BLACK;
            g.ShowText(text);

            g.MoveTo(x, y);
            g.Color = c;
            g.ShowText(text);

            g.Restore();
        }
Example #15
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);
        }
        public static void Draw(Cairo.Context ctx, object backend, double x, double y)
        {
            var la = (LayoutBackend) backend;

            var text = la.Text;

            var h = ctx.FontExtents.Ascent;
            y += h;

            ctx.MoveTo (x, y);

            if (la.Font != null) {
                ctx.SelectFont (la.Font);
                ctx.SetFontSize (la.Font.Size);
            }

            if (la.Width == -1) {
                ctx.ShowText (text);
                return;
            }

            if (!la.Measured)
                Measure (backend);

            // Render word by word

            int lastStart = 0;

            for (int i=0; i < la.LineBreaks.Count; i++) {
                if (la.Heigth != -1 && h > la.Heigth)
                    break;

                var n = la.LineBreaks [i];
                string s = text.Substring (lastStart, n - lastStart).TrimEnd('\n','\r');
                ctx.ShowText (s);

                var lh = la.LineHeights [i];
                h += lh;
                y += lh;

                ctx.MoveTo (x, y);
                lastStart = n;
            }
        }
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(28);

            if (BattleState.Allies[0] != null)
            {
                DrawAllyStatus(g, BattleState.Allies[0], y0);
            }

            if (BattleState.Allies[1] != null)
            {
                DrawAllyStatus(g, BattleState.Allies[1], y1);
            }

            if (BattleState.Allies[2] != null)
            {
                DrawAllyStatus(g, BattleState.Allies[2], y2);
            }
        }
Example #18
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            if (PhsList.IsControl)
            {
                g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
                g.SetFontSize(24);

                #region Character

                Character c = PhsList.Selection;

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

                    Graphics.Stats.RenderCharacterStatus(d, g, c, X + x_stats, Y + y_stats, false);

                }
                #endregion Character
            }
        }
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;

            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 #20
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 #21
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 #22
0
	static void draw (Cairo.Context gr, int width, int height)
	{		
		gr.Scale (width, height);
		gr.LineWidth = 0.04;
		
		gr.SelectFontFace ("Sans", FontSlant.Normal, FontWeight.Bold);
		gr.SetFontSize (0.35);
		
		gr.MoveTo ( new PointD(0.04, 0.53) );
		gr.ShowText ("Hello");
		
		gr.MoveTo ( new PointD(0.27, 0.65) );
		gr.TextPath ("void");
		gr.ColorRgb = new Color (0.5, 0.5, 1, 0);
		gr.FillPreserve ();
		gr.ColorRgb = new Color (0, 0, 0, 0);
		gr.LineWidth =  0.01;
		gr.Stroke ();
		
		gr.Color = new Color (1,0.2,0.2, 0.6);
		gr.Arc (0.04, 0.53, 0.02, 0, 2*M_PI);
		gr.Arc (0.27, 0.65, 0.02, 0, 2*M_PI);
		gr.Fill ();				
	}
Example #23
0
File: Boot.cs Project: vdt/AtomOS
        private static unsafe void DrawTaskbar(GuiRequest *request, byte[] xData)
        {
            request->Type  = RequestType.NewWindow;
            request->Error = ErrorType.None;
            var taskbar = (NewWindow *)request;
            int height  = 30;

            taskbar->X      = 0;
            taskbar->Y      = 0;
            taskbar->Width  = VBE.Xres;
            taskbar->Height = height;

            Compositor.Server.Write(xData);

            SystemClient.Read(xData);
            if (request->Error != ErrorType.None)
            {
                Debug.Write("Error4: %d\n", (int)request->Error);
                return;
            }

            string HashCode = new string(taskbar->Buffer);
            var    aBuffer  = SHM.Obtain(HashCode, 0, false);
            int    winID    = taskbar->WindowID;

            Debug.Write("winID: %d\n", winID);

            uint surface = Cairo.ImageSurfaceCreateForData(VBE.Xres * 4, height, VBE.Xres, ColorFormat.ARGB32, aBuffer);
            uint cr      = Cairo.Create(surface);

            uint pattern = Cairo.PatternCreateLinear(height, 0, 0, 0);

            Cairo.PatternAddColorStopRgba(0.7, 0.42, 0.42, 0.42, 0, pattern);
            Cairo.PatternAddColorStopRgba(0.6, 0.36, 0.36, 0.36, 0.5, pattern);
            Cairo.PatternAddColorStopRgba(0.7, 0.42, 0.42, 0.42, 1, pattern);

            Cairo.SetOperator(Operator.Over, cr);
            Cairo.Rectangle(height, VBE.Xres, 0, 0, cr);
            Cairo.SetSource(pattern, cr);
            Cairo.Fill(cr);

            Cairo.Rectangle(2, VBE.Xres, height - 2, 0, cr);
            Cairo.SetSourceRGBA(0.7, 0.41, 0.41, 0.41, cr);
            Cairo.Fill(cr);

            Cairo.SetSourceRGBA(1, 1, 1, 1, cr);
            Cairo.SelectFontFace(FontWeight.Bold, FontSlant.Normal, Marshal.C_String(""), cr);
            Cairo.SetFontSize(20, cr);
            Cairo.MoveTo(20, 1215, cr);
            Cairo.ShowText(Marshal.C_String("20:10"), cr);

            Cairo.PatternDestroy(pattern);
            Cairo.Destroy(cr);
            Cairo.SurfaceDestroy(surface);

            request->Type = RequestType.Redraw;
            var req = (Redraw *)request;

            req->WindowID = winID;
            req->X        = 0;
            req->Y        = 0;
            req->Width    = VBE.Xres;
            req->Height   = height;
            Compositor.Server.Write(xData);
        }
Example #24
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);

            #region Slots

            MateriaSlots.Render(g, MenuState.Party.Selected.Weapon, X + x_slots, Y + y_slots_weapon);
            MateriaSlots.Render(g, MenuState.Party.Selected.Armor, X + x_slots, Y + y_slots_armor);

            #endregion

            #region Character Status

            Images.RenderProfile(d, X + xpic, Y + ypic, MenuState.Party.Selected);

            Graphics.Stats.RenderCharacterStatus(d, g, MenuState.Party.Selected, X + x_status, Y + y_status, false);

            #endregion Status

            #region Equipment

            g.Color = Colors.TEXT_TEAL;
            g.MoveTo(X + x_labels, Y + y_weapon);
            g.ShowText("Wpn.");
            g.MoveTo(X + x_labels, Y + y_armor);
            g.ShowText("Arm.");
            g.Color = Colors.WHITE;

            Text.ShadowedText(g, "Check", X + x_labels, Y + y_check);
            Text.ShadowedText(g, "Arr.", X + x_labels, Y + y_arrange);

            string weapon, armor;
            weapon = MenuState.Party.Selected.Weapon.Name;
            armor = MenuState.Party.Selected.Armor.Name;

            Text.ShadowedText(g, MenuState.Party.Selected.Weapon.Name, X + x_names, Y + y_weapon);
            Text.ShadowedText(g, MenuState.Party.Selected.Armor.Name, X + x_names, Y + y_armor);

            #endregion

            if (IsControl)
            {
                Shapes.RenderCursor(g, X + cx, Y + cy);
            }
        }
Example #25
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);

            int y_cursor = y_option0 + y_spacing * Option + y_displacement_cursor;

            Shapes.RenderCursor(g, X + x_cursor, Y + y_cursor);

            Text.ShadowedText(g, "Which save data?", X + x_prompt, Y + y_prompt);

            Text.ShadowedText(g, "New game", X + x_options, Y + y_option0);

            for (int option = 0; option < options - 1; option++)
            {
                Text.ShadowedText(g, "Save " + option.ToString(), X + x_options, Y + y_option0 + y_spacing * (option + 1));
            }
        }
Example #26
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;
		}
        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;

            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 #29
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);

            if (IsControl || MenuState.MateriaArrange.IsControl || MenuState.MateriaPrompt.IsControl)
            {
                int j = Math.Min(rows + topRow, Materiatory.MATERIATORY_SIZE);

                for (int i = topRow; i < j; i++)
                {
                    MateriaOrb orb = MenuState.Party.Materiatory.Get(i);
                    if (orb != null)
                    {
                        Shapes.RenderCircle(g, Colors.WHITE, 9, X + x1, Y + cy + (i - topRow) * y);
                        Shapes.RenderCircle(g, orb.Color, 7, X + x1, Y + cy + (i - topRow) * y);

                        Text.ShadowedText(g, orb.Name, X + x2, Y + (i - topRow + 1) * y);
                    }
                }
            }

            if (IsControl)
            {
                Shapes.RenderCursor(g, X + cx, Y + cy + (option - topRow) * y);
            }
        }
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.Color = Colors.WHITE;
            g.SetFontSize(24);

            int j = Math.Min(rows + _topRow, _equipment.Count);

            for (int i = _topRow; i < j; i++)
            {
                Text.ShadowedText(g, _equipment [i].Item.Name,
                                    X + x, Y + (i - _topRow + 1) * y);
            }

            if (IsControl)
            {
                Shapes.RenderCursor(g, X + cx, Y + cy + (_option - _topRow) * y);
            }
        }
Example #31
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);

            int j = Math.Min(_visibleRows + _topRow, _totalRows);

            for (int b = _topRow; b < j; b++)
            {
                for (int a = 0; a < COLUMNS; a++)
                {
                    Spell enemySkill = _spells[b, a];

                    if (enemySkill != null)
                    {
                        Text.ShadowedText(g, enemySkill.Name,
                            X + x1 + a * xs,
                            Y + (b - _topRow + 1) * ys);
                    }
                }
            }

            if (IsControl)
            {
                Shapes.RenderCursor(g,
                    X + x1 + cx + _xopt * xs,
                    Y + cy + (_yopt - _topRow + 1) * ys);
            }

            BattleState.Screen.EnemySkillInfo.Draw(d, g, width, height, screenChanged);
        }
Example #32
0
File: Boot.cs Project: vdt/AtomOS
        private static unsafe void DrawWindow(GuiRequest *request, byte[] xData)
        {
            request->Type  = RequestType.NewWindow;
            request->Error = ErrorType.None;
            var window = (NewWindow *)request;

            window->X      = 340;
            window->Y      = 159;
            window->Width  = 600;
            window->Height = 450;

            Compositor.Server.Write(xData);

            SystemClient.Read(xData);
            if (request->Error != ErrorType.None)
            {
                Debug.Write("Error5: %d\n", (int)request->Error);
                return;
            }

            string HashCode = new string(window->Buffer);
            var    aBuffer  = SHM.Obtain(HashCode, 0, false);
            int    winID    = window->WindowID;

            Debug.Write("winID: %d\n", winID);

            uint surface = Cairo.ImageSurfaceCreateForData(600 * 4, 450, 600, ColorFormat.ARGB32, aBuffer);
            uint cr      = Cairo.Create(surface);

            Cairo.SetOperator(Operator.Over, cr);

            Cairo.Rectangle(450, 600, 0, 0, cr);
            Cairo.SetSourceRGBA(1, 0.41, 0.41, 0.41, cr);
            Cairo.Fill(cr);
            Cairo.Rectangle(446, 596, 2, 2, cr);
            Cairo.SetSourceRGBA(1, 0.87, 0.87, 0.87, cr);
            Cairo.Fill(cr);
            Cairo.Rectangle(410, 580, 30, 10, cr);
            Cairo.SetSourceRGBA(1, 1, 1, 1, cr);
            Cairo.Fill(cr);

            Cairo.SetSourceRGBA(1, 0.41, 0.41, 0.41, cr);
            Cairo.SelectFontFace(FontWeight.Normal, FontSlant.Normal, Marshal.C_String(""), cr);
            Cairo.SetFontSize(15, cr);
            Cairo.MoveTo(18, 215, cr);
            Cairo.ShowText(Marshal.C_String("Atom OS : Installation Guide"), cr);

            Cairo.SelectFontFace(FontWeight.Bold, FontSlant.Normal, Marshal.C_String(""), cr);
            Cairo.MoveTo(18, 580, cr);
            Cairo.ShowText(Marshal.C_String("X"), cr);

            Cairo.SurfaceFlush(surface);
            Cairo.Destroy(cr);
            Cairo.SurfaceDestroy(surface);

            request->Type = RequestType.Redraw;
            var req = (Redraw *)request;

            req->WindowID = winID;
            req->X        = 0;
            req->Y        = 0;
            req->Width    = 600;
            req->Height   = 450;
            Compositor.Server.Write(xData);

            Debug.Write("Time: %d\n", Timer.TicksFromStart);
            while (true)
            {
                SystemClient.Read(xData);
                if (request->Error != ErrorType.None)
                {
                    continue;
                }
                if (request->Type != RequestType.MouseEvent)
                {
                    continue;
                }
                var mreq = (MouseEvent *)request;
                if (mreq->WindowID != winID)
                {
                    continue;
                }
                if ((mreq->Function & MouseFunction.Click) != 0)
                {
                    int x = mreq->Xpos;
                    int y = mreq->Ypos;
                    if (y < 40)
                    {
                        request->Type = RequestType.DragRequest;
                        var mv = (DragRequest *)request;
                        mv->WindowID = winID;
                        Compositor.Server.Write(xData);
                    }
                }
            }
        }