示例#1
0
 /// <summary>
 /// Instantiates a new camera at the specified location, with the specified size and zoom level.
 /// </summary>
 /// <param name="X">X location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom.</param>
 /// <param name="Y">Y location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom.</param>
 /// <param name="Width">The width of the camera display in pixels.</param>
 /// <param name="Height">The height of the camera display in pixels.</param>
 /// <param name="Zoom">The initial zoom level of the camera.  A zoom level of 2 will make all pixels display at 2x resolution.</param>
 public FlxCamera(int X, int Y, int Width, int Height, float Zoom)
 {
     x      = X;
     y      = Y;
     width  = Width;
     height = Height;
     target = null;
     scroll = new Vector2();
     bounds = new Rectangle();
     screen = new FlxSprite();
     screen.createGraphic(0, 0, Color.Black);
     bgColor = FlxG.backColor;
     angle   = 0;
     color   = Color.White;
     zoom    = Zoom;
 }
示例#2
0
        public override void create()
        {
            base.create();

            FlxSprite bg = new FlxSprite(0, 0);

            bg.createGraphic(FlxG.width, FlxG.height, FlxG.splashBGColor);
            add(bg);

            _f         = null;
            _poweredBy = FlxG.Content.Load <Texture2D>("flixel/poweredby");
            _fSound    = FlxG.Content.Load <SoundEffect>(FlxG.splashAudioWaveFlixel);

            _initialsLogo = FlxG.Content.Load <Texture2D>(FlxG.splashLogo);

            //_logo = new FlxSprite();
            //_logo.loadGraphic(_initialsLogo, false, false, 216,24);
            //_logo.x = FlxG.width / 2 - 216 / 2;
            //_logo.y = FlxG.height / 2 - 24;
            //add(_logo);

            logoParts = new FlxGroup();

            for (int i = 0; i < 18; i++)
            {
                for (int j = 0; j < 2; j++)
                {
                    _logo = new FlxLogoSprite(i, j);
                    _logo.loadGraphic(_initialsLogo, false, false, 12, 12);
                    _logo.x = (FlxG.width / 2 - 216 / 2) + (i * 12);
                    _logo.y = (FlxG.height / 2 - 24) + (j * 12);
                    _logo.addAnimation("bugs", new int[] { 0, 1, 2, FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24),
                                                           (j * 18) + i }, FlxU.randomInt(12, 18), false);

                    _logo.addAnimation("bugs2", new int[] { 0, 1, 2, FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24), FlxU.randomInt(0, 24),
                                                            0 }, FlxU.randomInt(18, 24), false);

                    _logo.play("bugs");
                    logoParts.add(_logo);

                    float offset = 25.0f;
                    if (j >= 1)
                    {
                        offset *= -1.0f;
                    }
                    _logo.t = new Tweener((float)(_logo.y + offset), (float)_logo.y, 0.25f + (i / 18.0f), XNATweener.Quadratic.EaseInOut);
                    _logo.t.Start();
                }
            }
            add(logoParts);


            _logoTweener = new Tweener(-150, FlxG.height / 2 - 24, TimeSpan.FromSeconds(0.9f), Bounce.EaseOut);

            SndTag = FlxG.splashAudioWave;
            //FlxG.play(SndTag,1.0f);



            debugMode         = new FlxText(10, 90, 200, "DEBUG MODE!");
            debugMode.visible = false;
            add(debugMode);

            Console.WriteLine(" !!! Type {0} To Enter Debug Mode !!! ", FlxGlobal.titleScreenDebugMode);
        }