public void RunThemeUpdate() { UIThemeToolTip tipTheme = UIHandler.theme.tooltips; this.SetWidth(tipTheme.ItemWidth); //this.SetRelativePosition(tipTheme.xOffset, tipTheme.yOffset, tipTheme.xRel, tipTheme.yRel); }
public void UpdatePosition() { UIThemeToolTip theme = UIHandler.theme.tooltips; int posX = Cursor.MouseX; int posY = Cursor.MouseY; switch (dir) { case UIPrimaryDirection.Top: posX -= (short)(this.width / 2f); posY -= (this.height + theme.CursorGap); break; case UIPrimaryDirection.Left: posX -= (this.width + theme.CursorGap); posY -= (short)(this.height / 2f); break; case UIPrimaryDirection.Right: posX += theme.CursorGap; posY += (short)(this.height / 2f); break; case UIPrimaryDirection.Bottom: posX -= (short)(this.width / 2f); posY += theme.CursorGap; break; } // Limit to Screen if (posX < 10) { posX = 10; } else if (posX > Systems.screen.viewWidth - this.width - 10) { posX = Systems.screen.viewWidth - this.width - 10; } if (posY < 10) { posY = 10; } else if (posY > Systems.screen.viewHeight - this.height - 10) { posY = Systems.screen.viewHeight - this.height - 10; } // Set Position this.SetRelativePosition((short)posX, (short)posY); }