Exemplo n.º 1
0
        public InfoBox(Vector2 Position, Color LineColor, Color RectColor, SpriteFont Font, Color TextColor, string InfoText, GraphicsDevice GrDevice, float Layer = BasicSprite.DefaultLayer)
        {
            _Text = new BasicText(new Vector2(Position.X + 5, Position.Y + 2), InfoText, Font, TextColor, Layer - 0.0001f);
            var textwidth = _Text.Font.MeasureString(_Text.Text) * _Text.Scale;

            _Rect         = new SimpleRectangle(Position, textwidth + new Vector2(9, 3), LineColor, RectColor, GrDevice, Layer);
            this.Position = Position;
            Scale         = new Vector2(1);
            this.Layer    = Layer;
            iteration     = 0;
        }
Exemplo n.º 2
0
        public UI_Resource_Info(Vector2 Position, Color LineColor, Color RectColor, SpriteFont Font, Texture2D Icon, Color TextColor, Color AddTextColor, string MainText, string AddText, GraphicsDevice GrDevice, float Layer = BasicSprite.DefaultLayer)
        {
            _Icon     = new BasicSprite(new Vector2(Position.X + 5, Position.Y + 2), Icon, Layer - 0.0001f);
            _MainText = new BasicText(new Vector2(Position.X + 5 + Icon.Width, Position.Y + 2), MainText, Font, TextColor, Layer - 0.0001f);
            var textwidth = _MainText.Font.MeasureString(MainText) * _MainText.Scale + new Vector2(Icon.Width, 0);

            _AdditionalText = new BasicText(new Vector2(Position.X + 5 + textwidth.X, Position.Y + 2), AddText, Font, AddTextColor, Layer - 0.0001f);
            textwidth       = new Vector2(textwidth.X + _AdditionalText.Font.MeasureString(AddText).X *_AdditionalText.Scale.X, textwidth.Y);
            _Rect           = new SimpleRectangle(Position, textwidth + new Vector2(9, 3), LineColor, RectColor, GrDevice, Layer);
            intersect       = new Intersector(new Rectangle(_Rect.Position.ToPoint(), _Rect.WidthHeight.ToPoint()));
            this.Position   = Position;
            Scale           = new Vector2(1);
            this.Layer      = Layer;
            Visible         = true;
        }