Beispiel #1
0
        protected override void Initialize()
        {
#if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
#endif

            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point;

            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);

            GlobalContent.Initialize();

            GameSpecificInitialization();


            FlatRedBall.Screens.ScreenManager.Start(typeof(TileAdventure.Screens.GameScreen));

            base.Initialize();
        }
Beispiel #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, this.graphics);

            bool runAsFastAsPossible = false;

            if (runAsFastAsPossible)
            {
                this.IsFixedTimeStep = false;
                graphics.SynchronizeWithVerticalRetrace = false;
            }
            else
            {
                this.TargetElapsedTime = TimeSpan.FromSeconds(.05f);
            }

            Form form = Form.FromHandle(FlatRedBallServices.WindowHandle) as Form;

            form.Resize += HandleResize;


            // Since the application will be using the FlatRedBall GUI the
            // mouse needs to be visible and the GUI needs to be enabled.
            IsMouseVisible = true;

            EditorData.Initialize();

            EditorData.ProcessCommandLineArguments(mCommandLineArguments);

            base.Initialize();
        }
Beispiel #3
0
        protected override void Initialize()
        {
            #if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            #endif

            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            // R:
            //  pixel perfect rendering
            //FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point;
            // show mouse cursor
            FlatRedBallServices.Game.IsMouseVisible = true;

            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            GlobalContent.Initialize();
            FlatRedBall.Screens.ScreenManager.Start(typeof(TestBed.Screens.ScreenMain));

            base.Initialize();
        }
Beispiel #4
0
        protected override void Initialize()
        {
            #if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            #endif

            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            GlobalContent.Initialize();
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            FlatRedBall.Screens.ScreenManager.Start(typeof(Shiprekt.Screens.MainMenu));
            //FlatRedBall.Screens.ScreenManager.Start(typeof(Shiprekt.Screens.TestScreen));

            FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point;

            Camera.Main.BackgroundColor = Color.Black;

            //glueControlManager = new GlueControlManager(8021);
            //glueControlManager.Start();

            base.Initialize();
        }
Beispiel #5
0
        protected override void Initialize()
        {
#if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
#endif
            Custom.GameSettings.Initialize();

            Custom.Item.Initialize();
            Custom.Weapon.Initialize();


            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            GlobalContent.Initialize();
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);

            FlatRedBallServices.GraphicsOptions.ResolutionWidth  = 1200;
            FlatRedBallServices.GraphicsOptions.ResolutionHeight = 300;

            FlatRedBall.Screens.ScreenManager.Start(typeof(Pirates.Screens.MainMenuScreen));

            FlatRedBallServices.GraphicsOptions.TextureFilter = Microsoft.Xna.Framework.Graphics.TextureFilter.Point;



            base.Initialize();
        }
Beispiel #6
0
        protected override void Initialize()
        {
            // Create a timer that will simulate the gameloop
            _timer          = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromSeconds(1 / 60);
            _timer.Tick    += TimerTick;
            _timer.Start();

            // Create the graphics options and initialize FRB with them
            var graphicsOptions = new GraphicsOptions(this, Graphics);

            graphicsOptions.SuspendDeviceReset();
            graphicsOptions.ResolutionWidth  = RenderWidth;
            graphicsOptions.ResolutionHeight = RenderHeight;
            graphicsOptions.ResumeDeviceReset();
            FlatRedBallServices.InitializeFlatRedBall(this, Graphics, graphicsOptions);
            FlatRedBall.Screens.ScreenManager.Start(typeof(FlatRedBallWpf.Screens.MainScreen));

            if (false)
            {
                // Don't run this because we want the game's camera setup to run
                // Put if(false) so that it doesn't get re-generated
                CameraSetup.SetupCamera(SpriteManager.Camera, this.Graphics);
            }
            GlobalContent.Initialize();
            Mouse.ModifyMouseState += HandleModifyMouseState;

            FlatRedBall.Gui.GuiManager.Cursor.CustomIsActive = HandleCustomIsActive;

            base.Initialize();
        }
Beispiel #7
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            Renderer.UseRenderTargets = false;
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            this.IsFixedTimeStep = false;
            mFormMethods         = new EditorObjects.FormMethods();

            EditorData.Initialize();

            LightManager.AddAmbientLight(Color.White);

            GuiData.Initialize();

            IsMouseVisible = true;

            // Uncomment the following line and add your Screen's fully qualified name
            // if using Screens in your project.  If not, or if you don't know what it means,
            // just ignore the following line for now.
            // For more information on Screens see the Screens wiki article on FlatRedBall.com.
            //Screens.ScreenManager.Start(typeof(AIEditor.Screens.TestScreen).FullName);


            foreach (string s in Environment.GetCommandLineArgs())
            {
                ProcessCommandLineArgument(s);
            }

            base.Initialize();
        }
Beispiel #8
0
        public GameWindow()
        {
            FileManager.RelativeDirectory = System.Windows.Forms.Application.StartupPath + "/";

            FlatRedBall.IO.FileManager.CurrentDirectory = FlatRedBall.IO.FileManager.StartupPath;

            this.ClientSize  = new System.Drawing.Size(800, 600);
            this.MinimizeBox = true;

            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;

            this.AllowDrop = true;

            this.Activated += new EventHandler(GameForm_Activated);


            FlatRedBallServices.InitializeFlatRedBall(this);


            //this.FormBorderStyle = FormBorderStyle.None;
            //this.TopMost = true;
            SpriteManager.Camera.FixAspectRatioYConstant();

            TopLeftPixel.X = -SpriteManager.Cameras[0].XEdge;
            TopLeftPixel.Y = SpriteManager.Cameras[0].YEdge;
            OnResize(true);
        }
Beispiel #9
0
        /// <summary>
        /// Initialize the manager.
        /// </summary>
        protected override void Initialize()
        {
            //Initialize engine
            #region Engine initialization
            m_SpriteBatch = new SpriteBatch(GraphicsDevice);
            FlatRedBallServices.InitializeFlatRedBall(this, m_Device);

            //Initialize GUI manager
            Global.GUIManager.Initialize();
            Global.GUIManager.RenderTarget = new RenderTarget2D(
                GraphicsDevice,
                m_Device.PreferredBackBufferWidth,
                m_Device.PreferredBackBufferHeight,
                1,
                SurfaceFormat.Color,
                Global.GUIManager.RenderTargetUsage);
            Global.GUIManager.TargetFrames = GAME_FPS;

            //Initialize sound manager
            Global.SoundManager.Initialize();

            //Logging
            Global.Logger.AddLine("Engine initialized.");
            #endregion

            //Goes to starting state
            Global.StateManager.GoTo(m_StartState, m_StartParameters);

            //Initialize game class.
            base.Initialize();
        }
Beispiel #10
0
        public override void Initialize()
        {
            hasInitializeBeenCalled = true;

            var graphicsDeviceManager =
                // This seems to only be supported on MonoGame, not XNA
                //Game.Services.GetService<IGraphicsDeviceManager>() as GraphicsDeviceManager;
                Game.Services.GetService(typeof(IGraphicsDeviceManager)) as GraphicsDeviceManager;

            FlatRedBallServices.InitializeFlatRedBall(Game, graphicsDeviceManager);

            global::RenderingLibrary.SystemManagers.Default =
                new global::RenderingLibrary.SystemManagers();
            global::RenderingLibrary.SystemManagers.Default.Initialize(graphicsDeviceManager.GraphicsDevice);

            global::RenderingLibrary.SystemManagers.Default.Renderer.Camera.CameraCenterOnScreen =
                global::RenderingLibrary.CameraCenterOnScreen.TopLeft;

            global::RenderingLibrary.Content.LoaderManager.Self.ContentLoader = new global::RenderingLibrary.Content.ContentLoader();

            // We do this to help the programmer find missing files
            Wireframe.GraphicalUiElement.MissingFileBehavior = Wireframe.MissingFileBehavior.ThrowException;

            // Hide component outlines:
            Wireframe.GraphicalUiElement.ShowLineRectangles = false;

            // Hide the render boundary bool which controls whether we draw a green outline around text objects
            global::RenderingLibrary.Graphics.Text.RenderBoundaryDefault = false;
        }
Beispiel #11
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            gameConfiguration = new GameConfiguration("config.xml");
            if (gameConfiguration.fullscreen)
            {
                graphics.ToggleFullScreen();
                graphics.PreferredBackBufferWidth  = 1920;
                graphics.PreferredBackBufferHeight = 1080;
            }
            else
            {
                graphics.PreferredBackBufferWidth  = 1024;
                graphics.PreferredBackBufferHeight = 768;
            }

            graphics.ApplyChanges();

            Window.Title   = "MinGH";
            IsMouseVisible = true;
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            ScreenManager.Start(typeof(MainMenu).FullName);

            // Feels sloppy, but is how event listeners/handlers are set
            EventBus <ScreenChange> .EventHandler screenChange =
                new EventBus <ScreenChange> .EventHandler(ChangeGameState);

            EventBus <ScreenChange> .instance.Event += screenChange;

            base.Initialize();
        }
Beispiel #12
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, this.graphics);


            //FlatRedBallServices.GraphicsOptions.SetResolution(320, 240);
            // Uncomment the following line and add your Screen's fully qualified name
            // if using Screens in your project.  If not, or if you don't know what it means,
            // just ignore the following line for now.
            // For more information on Screens see the Screens wiki article on FlatRedBall.com.
            //Screens.ScreenManager.Start(typeof(CodeGenerator.Screens.TestScreen).FullName);

            GenerationCategories whatToGenerate = GenerationCategories.WindowSaveClasses;

            switch (whatToGenerate)
            {
            case GenerationCategories.WindowSaveClasses:

                GuiCollectionCodeGenerator.CreateGuiSaveClasses();
                break;

            case GenerationCategories.CollisionMethods:
                ShapeCollectionCollisionCodeGenerator.CreateShapeCollectionCollisionFile();
                break;

            case GenerationCategories.ContentPipeline:
                ContentPipelineGenerator.CreateContentPipelineFiles();
                break;
            }
        }
Beispiel #13
0
        protected override void Initialize()
        {
            #if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            #endif

            IsMouseVisible = true;

            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point;

            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            GlobalContent.Initialize();
            FlatRedBall.Screens.ScreenManager.Start(typeof(TownRaiser.Screens.MainMenu));

            //Setup a custom
            CustomCursorGraphicController.Initialize(this);

            base.Initialize();
        }
Beispiel #14
0
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            //ScreenManager.Start(typeof(SomeScreen).FullName);

            base.Initialize();
        }
Beispiel #15
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            InitializeIoc();

            this.TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);

            mToolForm       = new ToolForm();
            mToolForm.Owner = (Form)(Form.FromHandle(FlatRedBallServices.WindowHandle));
            mToolForm.ItemCollapsedOrExpanded += HandleToolFormItemCollapsedOrExpanded;
            Plugin.PluginManager.Initialize();

            IsMouseVisible = true;

            IsFixedTimeStep = false;

            GuiData.Initialize();

            RegisterAdditionalAssemblies();

            AvailableAssetTypes.Self.Initialize(FileManager.RelativeDirectory);

            #region Set up resizing

            mFormMethods = new FormMethods(0, 0, 0, 0);

            #endregion

            SpriteManager.Camera.BackgroundColor = Color.Gray;
            FlatRedBall.Math.Geometry.Polygon.TolerateEmptyPolygons = true;
            ExposedVariableManager.Initialize();

            try
            {
                RemotingServer.SetupPort(8686);
                RemotingServer.SetupInterface <FlatRedBall.Glue.SelectionInterface>();
                RemotingServer.SetupInterface <RegisterInterface>();
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show("GlueView could not start, please make sure GlueView is not already running on your computer \n \n Exception: \n" + e.ToString());
                FlatRedBall.FlatRedBallServices.Game.Exit();
            }

            mToolForm.Show();

            GluxManager.ContentManagerName = "GlueView";


            EditorLogic.Initialize();

            CommandLineManager.Self.ProcessCommandLineArgs(this.mToolForm);

            mainForm         = Form.FromHandle(FlatRedBallServices.WindowHandle) as Form;
            mainForm.Resize += HandleResize;
            base.Initialize();
        }
Beispiel #16
0
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            GlobalContent.Initialize();

            FlatRedBall.Screens.ScreenManager.Start(typeof(Pokamen.Screens.GameScreen));

            base.Initialize();
        }
Beispiel #17
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, this.graphics);

            //FlatRedBallServices.GraphicsOptions.SetResolution(320, 240);
            // Uncomment the following line and add your Screen's fully qualified name
            // if using Screens in your project.  If not, or if you don't know what it means,
            // just ignore the following line for now.
            // For more information on Screens see the Screens wiki article on FlatRedBall.com.
            //Screens.ScreenManager.Start(typeof(FlatRedBallAddOns.Screens.TestScreen).FullName);
        }
Beispiel #18
0
        protected override void Initialize()
        {
            IsMouseVisible = true;

            Renderer.UseRenderTargets = false;
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            ScreenManager.Start(typeof(ObjectContainerScreen));

            base.Initialize();
        }
Beispiel #19
0
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            GlobalContent.Initialize();

            FlatRedBall.Screens.ScreenManager.Start(typeof(FrbTicTacToe.Screens.FrbSplashScreen));

            IsMouseVisible = true;
            base.Initialize();
        }
Beispiel #20
0
        protected override void Initialize()
        {
            Renderer.UseRenderTargets = false;
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            GlobalContent.Initialize();
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);

            Screens.ScreenManager.Start(typeof(PlatformerSample.Screens.GameScreen).FullName);

            base.Initialize();
        }
Beispiel #21
0
        protected override void Initialize()
        {
            Renderer.UseRenderTargets = false;
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            GlobalContent.Initialize();
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);

            FlatRedBall.Screens.ScreenManager.Start(typeof(DemoProject.Screens.TutorialScreen));

            base.Initialize();
        }
Beispiel #22
0
        protected override void Initialize()
        {
            // Initialize the timer
            mTimer    = Stopwatch.StartNew();
            mLastStop = mTimer.Elapsed;

            // Intialize FlatRedBall
            FlatRedBallServices.InitializeFlatRedBall(this.graphicsDeviceService, this.Handle);

            Application.Idle += delegate { Invalidate(); };
            this.Resize      += new EventHandler(FRBPanel_Resize);
        }
Beispiel #23
0
        /// <summary>
        /// Performs FlatRedBall initialization tasks.
        /// </summary>
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            FlatRedBallServices.GraphicsOptions.SetResolution(640, 480);
            FlatRedBall.Debugging.Debugger.NumberOfLinesInCommandLine = 1;


            this.IsMouseVisible = true;
            Camera.Main.UsePixelCoordinates(false, 640, 480);
            Camera.Main.BackgroundColor = Color.CornflowerBlue;

            base.Initialize();
        }
Beispiel #24
0
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            CustomPreGlobalContentInitialize();
            GlobalContent.Initialize();

            LocalizationManager.CurrentLanguage = 1;

            CustomInitialize();

            FlatRedBall.Screens.ScreenManager.Start(typeof(GlueTestProject.Screens.FirstScreen));

            base.Initialize();
        }
        public EditorWindow()
        {
            LastInstance = this;

            FileManager.RelativeDirectory = System.Windows.Forms.Application.StartupPath + "/";

            FlatRedBall.IO.FileManager.CurrentDirectory = FlatRedBall.IO.FileManager.StartupPath;

            #region Set the window size

            // See if the RuntimeOptions file is valid

            this.ClientSize = new System.Drawing.Size(800, 600);


            #endregion


            FlatRedBallServices.InitializeFlatRedBall(this);

            this.MinimizeBox = true;

            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;

            this.MinimumSize = new System.Drawing.Size(
                MinimumSize.Width, 40);


            #region Set the Activated, Closing, and DragEnter events

            this.Activated += new EventHandler(GameForm_Activated);
            this.Closing   += new System.ComponentModel.CancelEventHandler(GameForm_Closing);
            this.AllowDrop  = true;
            this.DragEnter += new System.Windows.Forms.DragEventHandler(GameForm_DragDrop);

            #endregion

            #region Prepare the camera and TopLeftPixel for resizing

            SpriteManager.Camera.FixAspectRatioYConstant();
            SpriteManager.Camera.FarClipPlane = 7000;

            TopLeftPixel.X = -SpriteManager.Cameras[0].XEdge;
            TopLeftPixel.Y = SpriteManager.Cameras[0].YEdge;


            #endregion
        }
Beispiel #26
0
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            GlobalContent.Initialize();

            FlatRedBallServices.GraphicsOptions.BackgroundColor = Color.Black;

            FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point;
            //FlatRedBallServices.GraphicsOptions.UseMultiSampling = true;
            FlatRedBallServices.GraphicsOptions.TextureLoadingColorKey = Color.Black;

            FlatRedBall.Screens.ScreenManager.Start(typeof(LudumDare29.Screens.SplashScreen));

            base.Initialize();
        }
Beispiel #27
0
        protected override void Initialize()
        {
                        #if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
                        #endif

            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            //ScreenManager.Start(typeof(SomeScreen).FullName);

            base.Initialize();
        }
Beispiel #28
0
        protected override void Initialize()
        {
            #if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            #endif

            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            GlobalContent.Initialize();

            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            Type startScreenType = typeof(Soccer.Screens.Test2);

            var commandLineArgs = Environment.GetCommandLineArgs();
            if (commandLineArgs.Length > 0)
            {
                var thisAssembly = this.GetType().Assembly;
                // see if any of these are screens:
                foreach (var item in commandLineArgs)
                {
                    var type = thisAssembly.GetType(item);

                    if (type != null)
                    {
                        startScreenType = type;
                        break;
                    }
                }
            }

            if (startScreenType != null)
            {
                FlatRedBall.Screens.ScreenManager.Start(startScreenType);
            }

            GeneratedInitialize();

            FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point;

            base.Initialize();
        }
Beispiel #29
0
        protected override void Initialize()
        {
            #if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            #endif

            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            GlobalContent.Initialize();
            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            FlatRedBall.Screens.ScreenManager.Start(typeof(SpaceGame.Screens.StartMenu));

            base.Initialize();


            //Template to create empty save
            save1.Data.m1p1_2 = false;
            save1.Data.m1p1_3 = false;
            save1.Data.m1p3_4 = false;
            save1.Data.m1p3_5 = false;
            save1.Data.m1p5_6 = false;
            save1.Data.m1p2_6 = false;

            save2.Data.m1p1_2 = false;
            save2.Data.m1p1_3 = false;
            save2.Data.m1p3_4 = false;
            save2.Data.m1p3_5 = false;
            save2.Data.m1p5_6 = false;
            save2.Data.m1p2_6 = false;

            save2.Data.m1p1_2 = false;
            save2.Data.m1p1_3 = false;
            save2.Data.m1p3_4 = false;
            save2.Data.m1p3_5 = false;
            save2.Data.m1p5_6 = false;
            save2.Data.m1p2_6 = false;

            save1.Load();
            save2.Load();
            save3.Load();
        }
Beispiel #30
0
        protected override void Initialize()
        {
            #if IOS
            var bounds       = UIKit.UIScreen.MainScreen.Bounds;
            var nativeScale  = UIKit.UIScreen.MainScreen.Scale;
            var screenWidth  = (int)(bounds.Width * nativeScale);
            var screenHeight = (int)(bounds.Height * nativeScale);
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            #endif

            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            CameraSetup.SetupCamera(SpriteManager.Camera, graphics);
            GlobalContent.Initialize();
            FlatRedBall.Screens.ScreenManager.Start(typeof(GlueView2.Screens.MainScreen));

            base.Initialize();
        }