Ejemplo n.º 1
0
            public void renderMainMenu(Blitter b)
            {
                //title safe area offsets
                int mxofs = 20;
                int myofs = 20;

                int listwidth = 100;
                int rootMenuHeight = 66;

                listwidth++; //leave a gap before the next menus

                //title safe area
                b.ApplyWindow(mxofs, myofs, 640-mxofs*2, 480-myofs*2);

                //identify location of root menu
                int rootMenuVertOfs = locateSubmenu(b.window, mainMenuNavigator.selectionAt(0), 22, rootMenuHeight);

                //top-level party menu
                if(mainMenuNavigator.submenuAt(0) is PartyRootMenu) {
                    b.PushWindow();
                    b.OffsetWindow(listwidth, rootMenuVertOfs);

                    bool selectionA = false;
                    //if(mainMenuNavigator.menuAt(2) != null) {
                    if(mainMenuNavigator.selectionAt(1) == 1) {
                        selectionA = true;
                        int submenuOffset = 200+1;
                        b.PushWindow();
                        b.OffsetWindow(submenuOffset, rootMenuHeight + locateSubmenu(b.window, mainMenuNavigator.selectionAt(1), 16, 33));
                        renderEnhancementsMenu(b);
                        b.PopWindow();
                    }

                    renderPartyRoot(b, selectionA);
                    b.PopWindow();
                } else {
                    b.PushWindow();
                    b.OffsetWindow(listwidth, rootMenuVertOfs);
                    renderPlayerRoot(b);
                    b.PopWindow();
                }

                //--------------
                //main list

                //party item in main list
                if(mainMenuNavigator.submenuAt(0) is PartyRootMenu)
                    wr.render(b, new Rectangle(0, 0, 100+SelectionOverhang, 22), WindowRenderer.Mode.BigSelected);
                else
                    wr.render(b, new Rectangle(0, 0, 100, 22), WindowRenderer.Mode.Medium);

                string partyText = string.Format("P A R T Y  Lv. {0}",cabedge.party.level);
                cabedge.font_v3_1_black.Render(b, 7, 8, partyText);

                int level = Lib.TimerSin((int)DateTime.Now.Ticks, 12000, 8) + 8;

                int yofs = 22;
                for(int i=0;i<cabedge.party.chars.Count;i++) {
                    clr.render(b, new Point(0, yofs), i+1==mainMenuNavigator.selectionAt(0), level, cabedge.party.chars[i].name);
                    yofs+=22;
                }

                b.PopWindow();
                //----------------
            }
Ejemplo n.º 2
0
                public void render(Blitter b, Point pt, bool selected, int level, string name)
                {
                    int width = 100;
                    int nameWidth = 89;
                    int meterWidth = 11;
                    int nameStart = meterWidth;
                    int height = 22;

                    b.ApplyWindow(pt.X, pt.Y);
                    mr.render(b, new Rectangle(0, 0, meterWidth, height), level);
                    if(selected)
                        wr.render(b, new Rectangle(nameStart, 0, nameWidth+SelectionOverhang, height), WindowRenderer.Mode.BigSelected);
                    else
                        wr.render(b, new Rectangle(nameStart, 0, nameWidth, height), WindowRenderer.Mode.Dark);
                    cabedge.font_v3_1_black.Render(b, nameStart+6, 8, name);
                    b.PopWindow();
                }
Ejemplo n.º 3
0
        void init(int scale, Color color, bool dropDown, bool dropRight, Color dropShadowColor)
        {
            int numchars = smal_tbl.Length;
            _ge = GameEngine.Game;
            _scale = scale;
            _color = color;
            //images = new Image[numchars];
            rects = new Rectangle[numchars];

            //figure out the character layout
            int px=0, py=0;
            int ih = 7 * scale;
            if(dropDown) ih++;
            int maxw = 0;
            for(int i = 0; i < numchars; i++) {
                int cw = smal_tbl[i][0];
                int iw = cw * scale;
                if(dropRight) iw++;

                if(px + iw > 2048) {
                    py += ih;
                    px = 0;
                }

                Rectangle r = new Rectangle(px, py, iw, ih);
                rects[i] = r;
                px += iw;
                maxw = Math.Max(maxw,px);
            }

            //now generate the image
            image = _ge.NewImage(maxw, py+ih);
            Blitter b = new Blitter(image);
            b.Clear(Color.Transparent);
            for(int i = 0;i < numchars;i++) {

                Rectangle rect = rects[i];

                //draw the dropshadows
                if(dropDown) {
                    rect.Y++;
                    rect.Height--;

                    b.ApplyWindow(rect);
                    print_char(b, i, dropShadowColor);
                    b.PopWindow();

                    rect.Y--;
                }

                if(dropRight) {
                    rect.X++;
                    rect.Width--;

                    b.ApplyWindow(rect);
                    print_char(b, i, dropShadowColor);
                    b.PopWindow();

                    rect.X--;
                }

                if(dropRight && dropDown) {
                    rect.X++;
                    rect.Y++;
                    b.ApplyWindow(rect);
                    print_char(b, i, dropShadowColor);
                    b.PopWindow();
                    rect.X--;
                    rect.Y--;
                }

                //draw the main character:
                b.ApplyWindow(rect);
                print_char(b, i, color);
                b.PopWindow();

            }
            image.Cache();
        }