Inheritance: FlxGroup
Ejemplo n.º 1
0
        /// <summary>
        /// Initiate all the things needed by the engine
        /// </summary>
        internal static void init()
        {
            FlxG.defaultWholeScreenViewport = FlxG.viewport;
            FlxG.cameras   = new List <FlxCamera>();
            FlxG.viewports = new List <Viewport>();
            //FlxG.width = FlxG.graphics.PreferredBackBufferWidth;
            //FlxG.height = FlxG.graphics.PreferredBackBufferHeight;
            FlxG.bgColor     = Color.Black;
            FlxG.mute        = false;
            FlxG.sounds      = new FlxGroup();
            FlxG.console     = new FlxConsole();
            FlxG.worldBounds = new FlxRect();
            FlxG.defaultFont = FlxG.content.Load <SpriteFont>("ConsoleFont");
            //FlxG.zoom = 1f;
            FlxG.rotation = 0f;
            FlxG.pad1     = new FlxGamepad(PlayerIndex.One);
            FlxG.pad2     = new FlxGamepad(PlayerIndex.Two);
            FlxG.pad3     = new FlxGamepad(PlayerIndex.Three);
            FlxG.pad4     = new FlxGamepad(PlayerIndex.Four);
            FlxG.keys     = new FlxKeyboard();
            FlxG.mouse    = new FlxMouse();
            FlxG.safeZone = new FlxRect(FlxG.graphicsDevice.Viewport.TitleSafeArea.X, FlxG.graphicsDevice.Viewport.TitleSafeArea.Y, FlxG.graphicsDevice.Viewport.TitleSafeArea.Width, FlxG.graphicsDevice.Viewport.TitleSafeArea.Height);
            FlxCamera defaultCam = new FlxCamera(0, 0, FlxG.width, FlxG.height, FlxG.zoom);

            FlxG.addCamera(defaultCam);

            //Thread tCreate = new Thread(FlxG.state.create);
            //tCreate.Start();

            //create state last
            FlxG.state.create();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initiate all the things needed by the engine
        /// </summary>
        internal static void init()
        {
            FlxG.defaultWholeScreenViewport = FlxG.viewport;
            FlxG.cameras = new List<FlxCamera>();
            FlxG.viewports = new List<Viewport>();
            //FlxG.width = FlxG.graphics.PreferredBackBufferWidth;
            //FlxG.height = FlxG.graphics.PreferredBackBufferHeight;
            FlxG.bgColor = Color.Black;
            FlxG.mute = false;
            FlxG.sounds = new FlxGroup();
            FlxG.console = new FlxConsole();
            FlxG.worldBounds = new FlxRect();
            FlxG.defaultFont = FlxG.content.Load<SpriteFont>("ConsoleFont");
            //FlxG.zoom = 1f;
            FlxG.rotation = 0f;
            FlxG.pad1 = new FlxGamepad(PlayerIndex.One);
            FlxG.pad2 = new FlxGamepad(PlayerIndex.Two);
            FlxG.pad3 = new FlxGamepad(PlayerIndex.Three);
            FlxG.pad4 = new FlxGamepad(PlayerIndex.Four);
            FlxG.keys = new FlxKeyboard();
            FlxG.mouse = new FlxMouse();
            FlxG.safeZone = new FlxRect(FlxG.graphicsDevice.Viewport.TitleSafeArea.X, FlxG.graphicsDevice.Viewport.TitleSafeArea.Y, FlxG.graphicsDevice.Viewport.TitleSafeArea.Width, FlxG.graphicsDevice.Viewport.TitleSafeArea.Height);
            FlxCamera defaultCam = new FlxCamera(0, 0, FlxG.width, FlxG.height, FlxG.zoom);
            FlxG.addCamera(defaultCam);

            //Thread tCreate = new Thread(FlxG.state.create);
            //tCreate.Start();

            //create state last
            FlxG.state.create();
        }