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>
        /// Called by <code>FlxGame</code> to set up <code>FlxG</code> during <code>FlxGame</code>'s constructor.
        /// </summary>
        internal static void init(FlxGame game, int width, int height, float zoom)
        {
            FlxG._game = game;
            FlxG.width = width;
            FlxG.height = height;

            FlxG.mute = false;
            FlxG.volume = 1.0f;
            FlxG.sounds = new FlxGroup();
            FlxG.volumeHandler = delegate { };

            //FlxG.clearBitmapCache();

            //if(flashGfxSprite == null)
            //{
            //    flashGfxSprite = new Sprite();
            //    flashGfx = flashGfxSprite.graphics;
            //}

            FlxCamera.DefaultZoom = zoom;
            //FlxG._cameraRect = new Rectangle();
            FlxG.cameras = new List<FlxCamera>();
            //FlxG.UseBufferLocking = false;

            FlxG.plugins = new List<FlxBasic>();
            //addPlugin(new DebugPathDisplay());
            //addPlugin(new TimerManager());

            FlxG.mouse = new FlxMouse();
            FlxG.keys = new FlxKeyboard();
            //FlxG.mobile = false;

            FlxG.levels = null;
            FlxG.scores = null;
            FlxG.visualDebug = false;

            // flx# stuff

            FlxG.cameras = new List<FlxCamera>();

            //FlxG.width = FlxG.graphics.PreferredBackBufferWidth;
            //FlxG.height = FlxG.graphics.PreferredBackBufferHeight;
            FlxG.bgColor = Color.Black;
            FlxG.mute = false;
            FlxG.sounds = new FlxGroup();
            FlxG.worldBounds = new FlxRect();
            FlxG.defaultFont = FlxS.ContentManager.Load<SpriteFont>("ConsoleFont");
            //FlxG.zoom = 1f;
            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();
            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.º 3
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();
        }