コード例 #1
0
ファイル: LoadingScreen.cs プロジェクト: nian0601/MobileGame
        //This function is to be used when we want to use a loadingscreen
        public static void Load(ScreenManager screenManager, bool loadingIsSlow, params GameScreen[] screensToLoad)
        {
            //Tell all screens to transition off
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            //Create the loadingscreen
            LoadingScreen loadingScreen = new LoadingScreen(screenManager, loadingIsSlow, screensToLoad);

            //and finally activate the loadingscreen
            screenManager.AddScreen(loadingScreen);
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: nian0601/MobileGame
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            screenManager = new ScreenManager(this);
            screenManager.SpriteBatch = spriteBatch;
            screenManager.Font = Content.Load<SpriteFont>("GUI Textures/Fonts/DejaVuSans_20");
            screenManager.BlankTexture = Content.Load<Texture2D>("GUI Textures/BlankTexture");
            //screenManager.TraceEnabled = true;

            screenManager.AddScreen(new BackgroundScreen());
            screenManager.AddScreen(new MainMenuScreen());

            Camera.Initialize(GraphicsDevice);
            Camera.Limits = new Rectangle(0, 0, 800, 600);
            Camera.LoadStuff(Content);
            // TODO: use this.Content to load your game content here

            var pp = GraphicsDevice.PresentationParameters;
            ShaderTarget = new RenderTarget2D(GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight);
            MainTarget = new RenderTarget2D(GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight);
        }
コード例 #3
0
ファイル: Game1.cs プロジェクト: nian0601/MobileGame
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            screenManager = new ScreenManager(this);
            screenManager.SpriteBatch = spriteBatch;
            screenManager.Font = Content.Load<SpriteFont>("Fonts/DejaVuSans_20");
            screenManager.BlankTexture = Content.Load<Texture2D>("BlankTexture");

            screenManager.AddScreen(new EditorScreen());

            // TODO: use this.Content to load your game content here
        }