コード例 #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="type">Linear interpolation or cosine</param>
        /// <param name="frames">Number of frames until the picture completely changes to the second one, then goes back to the first one</param>
        public TransitioningImage(Texture first, Texture second, TransitionType type, int frames, bool animateFirstAlpha = true)
        {
            First = new TexturedRectangle(first);
            Second = new TexturedRectangle(second);
            Type = type;
            Frames = frames;
            AnimateFirstImageAlpha = animateFirstAlpha;

            AddChild(First);
            AddChild(Second);
        }
コード例 #2
0
ファイル: TexturedButton.cs プロジェクト: LukaHorvat/Electric
        public TexturedButton(Texture button)
        {
            var up = new TexturedRectangle(button);

            var down = new TexturedRectangle(button);
            var shadow = new ColoredRectangle(0, 0, button.Width, button.Height, 0, 0, 0, 0.1F);
            down.AddChild(shadow);

            var hover = new TexturedRectangle(button);
            var light = new ColoredRectangle(0, 0, button.Width, button.Height, 1, 1, 1, 0.1F);
            hover.AddChild(light);

            var skin = new ButtonSkin(up, down, hover);

            Initialize(button.Width, button.Height);
        }