Exemplo n.º 1
0
        public override void Draw(Scene scene)
        {
            var ui = SpriteLoader.Instance.AddSprite("content/ui_box");

            int offset        = (scene.Viewport.Width - Width) / 2;
            int widthInterior = Width - CardWidth;
            int segmentWidth  = widthInterior / (Actions.Length - 1);

            for (int i = 0; i < Actions.Length; i++)
            {
                var action = Actions[i];
                if (action == null)
                {
                    continue;
                }
                int height = Height;
                if (!action.Enabled())
                {
                    height = height * 4 / 5;
                }
                height += (int)MathHelper.Lerp(0, 30, (float)LerpHelper.QuadraticOut(0, 1, action.HoverFrame.Slide));
                int x = offset + i * segmentWidth;
                int y = scene.Viewport.Height - (int)MathHelper.Lerp(0, height, (float)LerpHelper.ElasticOut(0, 1, action.Frame.Slide));
                CardUIs[i].Draw(FontRenderer, x, y, 1);
                //DrawLabelledUI(scene, ui, ui, new Rectangle(x, y, CardWidth, height + 40), action.Name);
                //scene.DrawText(action.Description, new Vector2(x, y), Alignment.Center, new TextParameters().SetColor(Color.White, Color.Black).SetConstraints(CardWidth, height));
            }
        }