//Constructor public MenuScreen(Game game) : base(game) { screenRect = new Rectangle(0, 0, 800, 600); shadeTexture = Game.Content.Load<Texture2D>("Media\\GUI\\Shade"); physicsSim = new PhysicsSimulator(new Vector2(0.0f, 2.2f)); //Load Menu screen content RigidEntity menuBottom = new RigidEntity("MenuBottom", Game.Content.Load<Texture2D>("Media\\Menus\\MainMenuBottom"), ref physicsSim, GeomType.Polygon); menuBottom.body.IsStatic = true; menuBottom.body.Position = new Vector2(menuBottom.Origin.X, 200+menuBottom.Origin.Y); RigidEntity EditorButton = new RigidEntity("BTN_Editor", Game.Content.Load<Texture2D>("Media\\Menus\\EditorButton"), ref physicsSim, GeomType.Circle); RigidEntity quitButton = new RigidEntity("BTN_Quit", Game.Content.Load<Texture2D>("Media\\Menus\\QuitButton"), ref physicsSim, GeomType.Circle); RigidEntity w1 = new RigidEntity("WALL1", ref physicsSim, new Vector2(-2.5f,300f), 5, 600); RigidEntity w2 = new RigidEntity("WALL2", ref physicsSim, new Vector2(802.5f, 300f), 5, 600); EditorButton.body.Position = new Vector2(200.0f, -220.0f); EditorButton.Friction = 1.0f; EditorButton.Restitution = 0.8f; menuBottom.Restitution = 0.3f; menuBottom.Friction = 0.8f; quitButton.body.Position = new Vector2(400.0f,-250.0f); quitButton.Friction = 1.0f; quitButton.Restitution = 0.4f; entityManager = new EntityManager(); entityManager.Add(menuBottom); entityManager.Add(EditorButton); entityManager.Add(quitButton); entityManager.Add(w1); entityManager.Add(w2); shadeOpacity = 0; }
public EditorScreen(Game game) : base(game) { physicsSim = new PhysicsSimulator(new Vector2(0f, 1.0f)); entityManager = new EntityManager(); guiManager = new GUIManager(); simView = new PhysicsSimulatorView(physicsSim); simView.LoadContent(Game.GraphicsDevice, Game.Content); //Build UI GUITextButton exitBtn = new GUITextButton(game, "BTN_EXIT", "POP", "Exit", 10, 10); guiManager.addObject(exitBtn); }