static void Initialize() { bInitialize = false; Texture2D guiTex = Game1.contentManager.Load <Texture2D>(@"Graphics\GUI\Inventory_sheet_4096x4096"); source = new TexPanel(guiTex, new Rectangle(0, 0, 64, 64), new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); }
static void Initialize() { bInitialize = false; Texture2D guiTex = Game1.contentManager.Load <Texture2D>(@"Graphics\GUI\Inventory_sheet_4096x4096"); sourcePanel = new TexPanel(guiTex, new Rectangle(0, 0, 200, 200), new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); font = Game1.contentManager.Load <SpriteFont>(@"Fonts\Design\BGUI\test25"); //20,25,32,48 }
public TalentNode(Point p) { if (bInitialize) { Initialize(); } nodePos = p; pos = new Rectangle(new Point(nodePos.X * nodeSize + nodePos.X * nodeSpace, nodePos.Y * nodeSize + nodePos.Y * nodeSpace), new Point(nodeSize)); tp = source.positionCopy(pos); }
internal SelectableButton(Rectangle pos, String bs = "") : base() { if (bInitialize) { Initialize(); } ButtonText = bs; elementLoc = pos; position = pos.Location; buttonPanel = source.positionCopy(pos); bFocusOnSelect = true; }
private void Initialize(Rectangle position) { font = Game1.contentManager.Load <SpriteFont>(@"Fonts\Design\BGUI\test25"); guiTex = Game1.contentManager.Load <Texture2D>(@"Graphics\GUI\Inventory_sheet_4096x4096"); vertSpacing = 10; horSpacing = 10; itemsPerPage = 3; vertHeight = (position.Height - horSpacing * 4 - (itemsPerPage - 1) * vertSpacing) / itemsPerPage; renderSize = new Point(position.Width - horSpacing * 2, vertHeight + vertSpacing * 2); panelPosition = new Rectangle(horSpacing, vertSpacing, renderSize.X - 2 * horSpacing, vertHeight); panel = new TexPanel(guiTex, panelPosition, new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); }
private void Initialize() { bInitialize = true; font = BattleGUI.testSF48; //fix guiTex = Game1.contentManager.Load <Texture2D>(@"Graphics\GUI\Inventory_sheet_4096x4096"); offSetBg = 50; offSetRender = 2; renderDrawPos = new Vector2(offSetBg + offSetRender); bgPosition = new Rectangle(offSetBg, offSetBg, 1366 - offSetBg * 2, 768 - offSetBg * 2); bigBG = new TexPanel(guiTex, bgPosition, new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); render = new RenderTarget2D(Game1.graphics.GraphicsDevice, 1366 - (offSetBg + offSetRender) * 2, 768 - (offSetBg + offSetRender) * 2); CompleteRender = new RenderTarget2D(Game1.graphics.GraphicsDevice, 1366, 768); }
public KeyRebindDesign(Point p, int w, int h, int wOS, Actions a) : base() { if (bInitialize) { Initialize(); } keyAction = a; bFocusOnSelect = true; position = p; totalW = w; widthText = (w - 3 * wOS) / 2; widthPrompts = (w - 3 * wOS) / 2 / 3; textBGPanel = sourcePanel.positionCopy(new Rectangle(p, new Point(widthText, h))); prompt1Panel = sourcePanel.positionCopy(new Rectangle(p + new Point(widthText + wOS, 0), new Point(widthPrompts, h))); prompt2Panel = sourcePanel.positionCopy(new Rectangle(p + new Point(widthText + wOS * 2 + widthPrompts, 0), new Point(widthPrompts, h))); prompt3Panel = sourcePanel.positionCopy(new Rectangle(p + new Point(widthText + wOS * 3 + 2 * widthPrompts, 0), new Point(widthPrompts, h))); elementLoc = new Rectangle(p, new Point(w, h)); }
static void Initialize() { bInitialize = false; render = new RenderTarget2D(Game1.graphics.GraphicsDevice, 1366, 768); titleFont = Game1.contentManager.Load <SpriteFont>(@"Fonts\Design\BGUI\test48");//48,32,25 guiTex = GameMenuHandler.menuTextureSheet; rightPanelPosition = new Rectangle(700, 300, 616, 418); leftPanelPosition = new Rectangle(67, 50, 1232, 668); int offset = 2; leftPanelRenderLoc = new Rectangle(leftPanelPosition.X + offset, leftPanelPosition.Y + offset, leftPanelPosition.Width - offset * 2, leftPanelPosition.Height - offset * 2); rightTexPanel = new TexPanel(guiTex, rightPanelPosition, new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); leftTexPanel = new TexPanel(guiTex, leftPanelPosition, new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); }
internal void DrawNode(SpriteBatch sb, Color c = default(Color)) { if (pos == default(Rectangle)) { if (bInitialize) { Initialize(); } pos = new Rectangle(new Point(nodePos.X * nodeSize + nodePos.X * nodeSpace, nodePos.Y * nodeSize + nodePos.Y * nodeSpace), new Point(nodeSize)); tp = source.positionCopy(pos); } Color dc = Color.White; if (c != default(Color)) { dc = c; } tp.Draw(sb, dc); }
internal AbilitySelectDescription(BaseCharacter bc, BasicAbility ba, Rectangle screenPos) { if (bInitialize) { Initialize(); } parent = ba; // GameProcessor.gcDB drawOnScreen = screenPos; pos = new Rectangle(new Point(), screenPos.Size); render = new RenderTarget2D(Game1.graphics.GraphicsDevice, pos.Width, pos.Height); panel = new TexPanel(guiTex, pos, new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); startUpTimer = new TimingUtility(16, true, StartUpTimer); startUpTimer.SetStepTimer(startUpStepTimer); titleBox = new Rectangle(offsetPanel, offsetPanel, render.Width - 2 * offsetPanel, titleBoxHeight); descriptionBox = new Rectangle(titleBox.Location + new Point(0, titleBoxHeight + offsetBoxes), new Point(render.Width - 2 * offsetPanel)); aoeBox = new Rectangle(new Point(0, descriptionBox.Y + descriptionBox.Height + offsetBoxes), new Point(render.Width - 2 * offsetPanel)); potencyText = ba.GetEstimatedPotency(bc); }
private void Initialize() { bInitialize = true; TitleFont = BattleGUI.testSF48; guiTex = GameMenuHandler.menuTextureSheet; rightPanelPosition = new Rectangle(700, 300, 616, 418); rightPanelAbilityLineup = new Rectangle(710, 368, 596, 340); rightPanelTitlePosition = new Rectangle(710, 310, 596, 48); rightPanelTitle = new GameText(); rightPanelTitle.AddText("Equipped abilities: ", GameText.Language.English); leftPanelPosition = new Rectangle(50, 300, 616, 418); leftPanelAbilityLineup = new Rectangle(60, 368, 596, 340); leftPanelTitlePosition = new Rectangle(60, 310, 596, 48); leftPanelTitle = new GameText(); leftPanelTitle.AddText("Available abilities: ", GameText.Language.English); bgPanelRight = new TexPanel(guiTex, rightPanelPosition, new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); bgPanelLeft = new TexPanel(guiTex, leftPanelPosition, new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64)); }
private void GeneratePanel() { int offset = 6; int itemWidth = widthScrollPanel - 18 - 3 * offset; int startX = offset; int startY = offset; itemPositions = new Rectangle[items.Length]; itemPanels = new TexPanel[items.Length]; wheel = new ScrollWheel(new Point(2 * offset + itemWidth, offset), heightScrollPanel - 2 * offset); int h = 0; for (int i = 0; i < items.Length; i++) { itemPositions[i] = new Rectangle(startX, startY + itemHeight * i + itemOffSetVertical * i, itemWidth, itemHeight); // itemPositions[i].Location += drawPos; itemPanels[i] = sourcePanel.positionCopy(itemPositions[i]); h += startY + itemHeight * i + itemOffSetVertical * i; } if (h + 2 * offset < heightScrollPanel) { bNeedsScrollbarActive = false; } else { bNeedsScrollbarActive = true; } bg = sourcePanel.positionCopy(new Rectangle(new Point(0), new Point(widthScrollPanel, heightScrollPanel))); renderDrawPos = new Rectangle(new Point(0), new Point(widthScrollPanel - 2 * offset, heightScrollPanel - offset)); scrollRender = new RenderTarget2D(Game1.graphics.GraphicsDevice, renderDrawPos.Width, renderDrawPos.Height); completeRenderPos = new Rectangle(drawPos, new Point(widthScrollPanel, heightScrollPanel)); completeRender = new RenderTarget2D(Game1.graphics.GraphicsDevice, completeRenderPos.Width, completeRenderPos.Height); elementLoc = completeRenderPos; }
public TexPanel positionCopy(Rectangle finalPos) { TexPanel tp = new TexPanel(this.tex, finalPos, this.upperMiddleCenter, this.lowerMiddleCenter, this.leftMiddleCenter, this.rightMiddleCenter, this.upperLeftCorner, this.upperRightCorner, this.lowerLeftCorner, this.lowerRightCorner, this.middle); return(tp); }