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(); }
void renderPlayerRoot(Blitter b) { Character c = (mainMenuNavigator.submenuAt(0) as CharacterMenu).character; b.PushWindow(); wr.render(b, new Rectangle(0, 0, 200, 66), WindowRenderer.Mode.Light); cabedge.font_v3_2_black.Render(b, 25, 12, c.name); cabedge.font_v3_1_black.Render(b, 25, 32, string.Format("{0} / {1}", c.hp, c.baseStats.mhp + c.bonusStats.mhp)); cabedge.font_v3_1_black.Render(b, 25, 42, c.classname); Image portrait = c.getPortrait(); if(portrait != null) b.Blit(portrait, 160, 10); b.PopWindow(); }
void renderPartyRoot(Blitter b, bool selActive) { b.PushWindow(); wr.render(b, new Rectangle(0, 0, 200, 66), WindowRenderer.Mode.Light); cabedge.font_v3_2_black.Render(b, 25, 15, "XP"); cabedge.font_v3_2_black.Render(b, 25, 35, "GP"); cabedge.font_v3_2_black.Render(b, 55, 15, string.Format("{0}/{1}",cabedge.party.xp,cabedge.party.xpt)); cabedge.font_v3_2_black.Render(b, 55, 35, cabedge.party.gp.ToString()); cabedge.font_v3_1_black.RenderRight(b, 192, 10, "Level"); cabedge.font_v3_3_black.RenderRight(b, 192, 20, cabedge.party.level.ToString()); b.OffsetWindow(0,66); renderItemList(b, partyRoot.items, mainMenuNavigator.selectionAt(1), selActive, 190); b.PopWindow(); }
void renderEnhancementsMenu(Blitter b) { //render the tooltip Enhancement selEnh = null; if(mainMenuNavigator.submenuAt(2) != null) selEnh = (mainMenuNavigator.submenuAt(2) as EnhancementSubMenu).enh; if(selEnh != null) { b.PushWindow(); int targetWidth = 140; V3Sysfont.StringLayoutInfo sli = cabedge.font_v3_1_black.layoutRectangle(targetWidth-25, -1, selEnh.tooltip); b.OffsetWindow(140+1, 33 + locateSubmenu(b.window, mainMenuNavigator.selectionAt(2), 16, sli.size.Height + 20)); wr.render(b, new Rectangle(0, 0, 25+sli.size.Width+10, 10+sli.size.Height+10), WindowRenderer.Mode.Light); cabedge.font_v3_1_black.renderLayout(b, 25, 10, sli); b.PopWindow(); } b.PushWindow(); wr.render(b, new Rectangle(0, 0, 140, 33), WindowRenderer.Mode.Light); cabedge.font_v3_2_black.Render(b, 25, 10, "Equipped"); b.OffsetWindow(0, 33); renderItemList(b, partyRoot.enhancements.items, mainMenuNavigator.selectionAt(2), selEnh != null, 130); b.PopWindow(); }
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(); //---------------- }
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(); }