public BoundSizeControl(double zoom, double width, double height, double widthInf = 0.02, double widthSup = 0.3, double heightInf = 0.02, double heightSup = 0.3) { _startZoom = zoom; _sizeInf = new BoundSize() { Width = widthInf, Height = heightInf }; _sizeSup = new BoundSize() { Width = widthSup, Height = heightSup }; _startSize = new BoundSize() { Width = width, Height = height }; _zoom = _startZoom; setSizeByLimits(ref _startSize); }
private void setSizeByLimits(ref BoundSize size) { setWidthByLimits(ref size.Width); setHeightByLimits(ref size.Height); }
private void resetBoundSize() { _startSize = Size; _startZoom = _zoom; }
public void Draw(Point position, GraphicsData GraphicsData) { Bound = new Rectangle(position, BoundSize); GraphicsData.SpriteBatch.DrawRectangle(position.ToVector2(), BoundSize.ToVector2(), BoundColor); GraphicsData.SpriteBatch.DrawString(MessageFont, MessageText, position.ToVector2() + new Vector2(Padding), TextColor); }