public UiButton(Vector2 position, int width, int height, Color normalColor, Color survoledColor, WhenPressed action, Texture2D texture = null) : base(position) { _bounds = new Rectangle((int)position.X, (int)position.Y, width, height); this._normalColor = normalColor; this._survoledColor = survoledColor; this._action = action; if (texture != null) { this._texture = texture; } else { _texture = Utils.CreateTexture(width, height, normalColor); } }
public UiButton(Vector2 position, int width, int height, WhenPressed action, Color color) : base(position) { _texture = Utils.CreateTexture(width, height, color); _bounds = new Rectangle((int)position.X, (int)position.Y, width, height); this._action = action; }
public UiButton(Vector2 position, WhenPressed action, Texture2D texture) : base(position) { _action = action; _texture = texture; _bounds = new Rectangle((int)position.X, (int)position.Y, _texture.Width, _texture.Height); }