SmartboyDevelopments.Haxxit.MonoGame.GameStates.ButtonHover.ButtonHover C# (CSharp) Method

ButtonHover() public method

public ButtonHover ( DrawableRectangle rectangle, Microsoft.Xna.Framework.Graphics.Texture2D white_pixel, SpriteFont tooltip_font, string tooltip_text ) : System
rectangle DrawableRectangle
white_pixel Microsoft.Xna.Framework.Graphics.Texture2D
tooltip_font Microsoft.Xna.Framework.Graphics.SpriteFont
tooltip_text string
return System
        public ButtonHover(DrawableRectangle rectangle, Texture2D white_pixel, SpriteFont tooltip_font, string tooltip_text)
        {
            button_hover = new DrawableRectangle(rectangle.texture, rectangle.Area, Color.White * 0.5f);
            this.tooltip_font = tooltip_font;
            this.tooltip_text = tooltip_text;
            Vector2 tooltip_text_size = tooltip_font.MeasureString(tooltip_text);
            Rectangle tooltip_rect = new Rectangle(0, button_hover.Area.Y, (int)Math.Ceiling(tooltip_text_size.X), (int)Math.Ceiling(tooltip_text_size.Y));
            tooltip_rect = tooltip_rect.LeftAlignOn(button_hover.Area).OffsetBy(0, -1 * tooltip_rect.Height - 6);
            tooltip_text_position = tooltip_rect.GetPosition();
            tooltip_rect = tooltip_rect.BufferBy(8);
            tooltip_box = new DrawableRectangle(white_pixel, tooltip_rect, Color.White, 2, Color.Black);
        }