public AbstractHoverButton(Texture2D buttonImage, Vector2 position, float scale, SelectAnimation selectAnimation) { this.scale = scale; this.buttonImage = buttonImage; this.position = position; this.selectAnimation = selectAnimation; hotArea = new Rectangle((int)position.X, (int)position.Y, buttonImage.Width, buttonImage.Height); }
public SubMenu(Dictionary<String, AbstractHoverButton.ButtonClickedHandler> buttonHandlers, ScreenManager screenManager, String name) { background = new Sprite(screenManager.Content.Load<Texture2D>("notebook")); Texture2D animationTexture = screenManager.Content.Load<Texture2D>("Common/AnimationStrip"); SelectAnimation selectAnimation = new SelectAnimation(1500, new Vector2(), animationTexture, 0.3f); font = screenManager.Content.Load<SpriteFont>("Font"); int i = 0; this.buttons = new List<AbstractHoverButton>(); this.itemNames = new List<string>(); foreach (var pair in buttonHandlers) { itemNames.Add(pair.Key); AbstractHoverButton button = new AbstractHoverButton(screenManager.Content.Load<Texture2D>("Common/stick"), itemsPosition + new Vector2(30, -50 + i* offsetBetweenItems), 0.5f, new SelectAnimation(1500, new Vector2(), animationTexture, 0.3f)); button.buttonClicked += new AbstractHoverButton.ButtonClickedHandler(pair.Value); buttons.Add(button); i++; } this.name = name; }
public KinectHoverButton(Texture2D buttonImage, Vector2 position, SelectAnimation selectAnimation) : base(buttonImage, position, 1f, selectAnimation) { }