Beispiel #1
0
        protected override void SetGui()
        {
            SnowButton              = new Button(ScreenManager.Res.X - 160, 10, 150, "Start Snow");
            SnowButton.LeftClicked += (s, e) => particleManager.AddParticleEmitters(new List <ParticleEmitter>()
            {
                new SnowEmitter(new Rectangle(0, 0, 1700, 768))
            });

            RainButton              = new Button(ScreenManager.Res.X - 160, 70, 150, "Start Rain");
            RainButton.LeftClicked += (s, e) => particleManager.AddParticleEmitters(new List <ParticleEmitter>()
            {
                new RainEmitter(new Rectangle(0, 0, 1700, 768))
            });

            ClearButton              = new Button(ScreenManager.Res.X - 160, 130, 150, "Clear Emitter");
            ClearButton.LeftClicked += (s, e) => particleManager.ClearParticleEmitters();

            BackButton              = new Button(10, ScreenManager.Res.Y - 60, 100, "Back");
            BackButton.LeftClicked += (s, e) => { ExitScreen(); };

            Gui.BaseScreen.AddControls(SnowButton, RainButton, ClearButton, BackButton);

            base.SetGui();
        }
Beispiel #2
0
        public override void LoadContent()
        {
            gui = new GuiManager(new TealThemeVisuals(ScreenManager));
            //TODO: FIX THIS WITH SCREEN RESOLUTION
            gui.BaseScreen.Bounds = new Rectangle(0, 0, ScreenManager.Res.X, ScreenManager.Res.Y);
            gui.BaseScreen.Hidden = true;
            labbell.Bounds.Height = labbell.Bounds.Width = 100;
            pannell.AddControls(buttonn);

            gui.BaseScreen.AddControls(labbell, pannell);

            part = new ParticleManager(ScreenManager.Game.Content.Load <Texture2D>("textures/particleSheet"));
            part.MaxParticleCount = 99999;

            part.AddParticleEmitters(new List <ParticleEmitter>()
            {
                new SnowEmitter(new Rectangle(0, -200, 1280 + 600, 720))
            });

            cam = new Camera(ScreenManager.Res.X, ScreenManager.Res.Y);
            cam.DestPosition = cam.TransPosition = new Vector2(500, 300);

            texturree        = ScreenManager.Game.Content.Load <Texture2D>("textures/darkThemeGuiSheet");
            sampleBackground = ScreenManager.Game.Content.Load <Texture2D>("mapOutside");
            e = ScreenManager.Game.Content.Load <Effect>("effect");

            TmxMap tmxMap = TmxMap.Load("Content/testMap.tmx");

            renderr = new RenderTarget2D(ScreenManager.GraphicsDevice, 1280, 720);

            vb = new VertexBuffer(ScreenManager.GraphicsDevice, typeof(VertexPositionColor), verts.Length, BufferUsage.WriteOnly);

            be       = new BasicEffect(ScreenManager.GraphicsDevice);
            be.World = Matrix.Identity;
            be.View  = Matrix.CreateLookAt(Vector3.Backward, Vector3.Forward, Vector3.Up);
            //be.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45), 1280 / 720f, 0.01f, 100f);
            be.Projection = Matrix.CreateOrthographic(1280, 720, -1, 1);
            //be.Projection = Matrix.CreateOrthographicOffCenter(-640f, 640f, -360f, 360f, -1000f, 1000f);
            be.VertexColorEnabled = true;

            base.LoadContent();
        }