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); }
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)); }
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 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; }