/// <summary>
        /// construct new menu
        /// </summary>
        public GameChooserMenu()
        {
            ActiveInState         = new StateBrowsingMenu();
            panel                 = new GardenGamesPanel(this);
            panel.Motion.Position = new Vector2(0.0f, 0.0f);

            // get the items to display
            gamesList = GardenGame.Instance.GameLib.GetList();

            // background
            Spritelet bg = new Spritelet("parc-by-gadl.png");

            bg.Motion.Position     = new Vector2(0.66667f, 0.22f);
            bg.DrawInfo.LayerDepth = 1f;
            //bg.DrawInfo.DrawColor = new Color(0.3f, 0.3f, 0.3f, 0.3f);
            // bg color 169, 157, 241
            bg.Motion.Add(new MyFuncyModifier(delegate(float v) { return(v / 70.0f); }, "Rotate"));
            bg.Motion.Add(new MyFuncyModifier(delegate(float v) { return(0.45f + 0.75f * (float)Math.Sqrt(v / 430.0)); }, "Scale"));
            bg.Motion.TargetPos      = new Vector2(0.66667f, 0.9f);
            bg.Motion.TargetPosSpeed = 0.004f;
            Add(bg);
            background = bg;

            // logo
            Spritelet logo = new Spritelet("igglogo");

            Add(logo);
            logo.DrawInfo.Alpha  = 0.7f;
            logo.Motion.Scale    = 0.55f;
            logo.Motion.Position = new Vector2(Screen.AspectRatio - 0.24f, 0.04f);
            ColorChangeBehavior fadeIn = new ColorChangeBehavior();

            logo.Add(fadeIn);
            fadeIn.Intensity = 0f;
            fadeIn.FadeToTarget(0.9344f, 6f);
            logo.Motion.Add(new SineModifier("ScaleModifier", 0.03124f, 0.07344f, 1.0f));

            // set my panel and games list
            Add(panel);
            panel.OnUpdateList(gamesList);
        }
        /// <summary>
        /// construct new menu
        /// </summary>
        public GameChooserMenu()
        {
            ActiveInState = new StateBrowsingMenu();
            panel = new GardenGamesPanel(this);
            panel.Motion.Position = new Vector2(0.0f, 0.0f);

            // get the items to display
            gamesList = GardenGame.Instance.GameLib.GetList();

            // background
            Spritelet bg = new Spritelet("parc-by-gadl.png");
            bg.Motion.Position = new Vector2(0.66667f, 0.22f);
            bg.DrawInfo.LayerDepth = 1f;
            //bg.DrawInfo.DrawColor = new Color(0.3f, 0.3f, 0.3f, 0.3f);
            // bg color 169, 157, 241
            bg.Motion.Add(new MyFuncyModifier( delegate(float v) { return v/70.0f; }, "Rotate"));
            bg.Motion.Add(new MyFuncyModifier(delegate(float v) { return (0.45f + 0.75f * (float) Math.Sqrt(v/430.0)); }, "Scale"));
            bg.Motion.TargetPos = new Vector2(0.66667f, 0.9f);
            bg.Motion.TargetPosSpeed = 0.004f;
            Add(bg);
            background = bg;

            // logo
            Spritelet logo = new Spritelet("igglogo");
            Add(logo);
            logo.DrawInfo.Alpha = 0.7f;
            logo.Motion.Scale = 0.55f;
            logo.Motion.Position = new Vector2(Screen.AspectRatio - 0.24f, 0.04f);
            ColorChangeBehavior fadeIn = new ColorChangeBehavior();
            logo.Add(fadeIn);
            fadeIn.Intensity = 0f;
            fadeIn.FadeToTarget(0.9344f, 6f);
            logo.Motion.Add(new SineModifier("ScaleModifier", 0.03124f, 0.07344f, 1.0f));

            // set my panel and games list
            Add(panel);
            panel.OnUpdateList(gamesList);
        }
示例#3
0
 protected void TestRotatingBall()
 {
     Spritelet b = new Spritelet("ball-supernova2");
     b.Position = new Vector2(0.6f, 0.5f);
     b.LayerDepth = 0.91f;
     b.Add(new MyFuncyModifier(delegate(float t) { b.RotateModifier += t / 10f; }));
     gameletsRoot.Add(b);
 }