示例#1
0
 public SceneParent()
 {
     g = Game1.graphics.GraphicsDevice;
     render = new RenderTarget2D(
         g,
         (int)g.PresentationParameters.BackBufferWidth,
         (int)g.PresentationParameters.BackBufferHeight,
     false,
     g.PresentationParameters.BackBufferFormat,
     g.PresentationParameters.DepthStencilFormat
     );
     camera = new Camera(Game1.graphics);
 }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            camera = new Camera(graphics);

            Resources.Init(Content);
            DrawSys.InitSpriteBatch(spriteBatch);

            //ladataan textuurit

            Resources.LoadTexture2D("Ship");
            Resources.LoadTexture2D("Bullet");
            Resources.LoadTexture2D("Enemy");
            Resources.LoadTexture2D("StarWars");

            Resources.LoadTexture2D("Button");

            Resources.LoadFont("CSfont");
            Resources.LoadFont("CSfont2");

            SceneSys.ChangeScene(new GameScene());

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