Beispiel #1
0
        public Overlay()
        {
            _instance = this;
            Font = ContentHelper.LoadFont("Fonts/splashNumber");

            _heart = new Heart(new Vector2(40, 40));
            _coin = new Coin(new Vector2(40, 120));

            //Black corners of the screen
            _blackCorners.Texture = ContentHelper.LoadTexture("Backgrounds/ui_whiteCorners");
            _blackCorners.Rectangle = new Rectangle(0, 0, Main.UserResWidth, Main.UserResHeight);

            _blackScreen.Texture = ContentHelper.LoadTexture("Tiles/black");
            _blackScreen.Rectangle = new Rectangle(0, 0, Main.UserResWidth, Main.UserResHeight);
        }
Beispiel #2
0
        protected override void Initialize()
        {
            Camera = new Camera(GraphicsDevice.Viewport);
            _menu = new Menu(this);
            _gameWorld = new GameWorld(this);
            Player = new Player.Player(this);
            _overlay = new Overlay();
            _cutscene = new Cutscene();
            Dialog = new Dialog();
            ObjectiveTracker = new ObjectiveTracker();
            MessageBox = new MessageBox();
            TextInputBox = new TextInputBox();

            DefaultTexture = ContentHelper.LoadTexture("Tiles/temp tile");
            GraphicsDeviceInstance = _graphics.GraphicsDevice;

            //Initialize the game render target
            _mainRenderTarget = new RenderTarget2D(GraphicsDevice, DefaultResWidth, DefaultResHeight, false,
                GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24,
                GraphicsDevice.PresentationParameters.MultiSampleCount, RenderTargetUsage.PreserveContents);
            _lightingRenderTarget = new RenderTarget2D(GraphicsDevice, DefaultResWidth, DefaultResHeight, false,
                GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24,
                GraphicsDevice.PresentationParameters.MultiSampleCount, RenderTargetUsage.PreserveContents);

            SpriteBatch = new SpriteBatch(GraphicsDevice);

            _lightBlendState = new BlendState
            {
                AlphaSourceBlend = Blend.DestinationColor,
                ColorSourceBlend = Blend.DestinationColor,
                ColorDestinationBlend = Blend.Zero
            };

            base.Initialize();
        }