public void Initialize(RenderContext context) { //SplashScreen should always fill the screen of thw game correctly if (SplashScreen != null) { m_bIsStarting = true; SplashScreen.Scale(context.ViewPortSize.X / SplashScreen.Width, context.ViewPortSize.Y / SplashScreen.Height); } if (BackgroundScreen != null) { BackgroundScreen.Scale(context.ViewPortSize.X / BackgroundScreen.Width, context.ViewPortSize.Y / BackgroundScreen.Height); } }
public HealthBar(RenderContext context) { for (int i = 0; i < m_Amount; i++) { m_Health = new GameSprite("Textures/GUI/Health_GUI", context); m_Health.Scale(0.5f); m_HealthBar.Add(m_Health); } }
public HealthBar(RenderContext context) { for (int i = 0; i < m_Amount; i++) { m_Health = new GameSprite("Textures/GUI/Health_GUI",context); m_Health.Scale(0.5f); m_HealthBar.Add(m_Health); } }
protected override void LoadContent() { //MENU //*************** m_MenuManager = new MenuManager(m_RenderContext.ViewPortSize / 2); m_MenuManager.AddItem(new GUIButton("Textures/GUI/Buttons/StartNormal", "Textures/GUI/Buttons/StartOnHover", ButtonName.Start, m_RenderContext)); m_MenuManager.AddItem(new GUIButton("Textures/GUI/Buttons/ExitNormal", "Textures/GUI/Buttons/ExitOnHover", ButtonName.Exit, m_RenderContext)); m_MenuManager.AddItem(new GUIButton("Textures/GUI/Buttons/RestartNormal", "Textures/GUI/Buttons/RestartOnHover", ButtonName.Restart, m_RenderContext)); m_MenuManager.AddItem(new GUIButton("Textures/GUI/Buttons/ToggleFullscreenNormal", "Textures/GUI/Buttons/ToggleFullscreenOnHover", ButtonName.Fullscreen, m_RenderContext)); //Set the splash screen and hit screen m_MenuManager.BackgroundScreen = new GameSprite("Textures/GUI/BackgroundStartScreen", m_RenderContext); m_MenuManager.SplashScreen = new GameSprite("Textures/GUI/DAEScreen_GUI", m_RenderContext); m_MenuManager.Initialize(m_RenderContext); m_LostMenu = new MenuManager(m_RenderContext.ViewPortSize / 2); m_LostMenu.AddItem(new GUIButton("Textures/GUI/Buttons/ExitNormal", "Textures/GUI/Buttons/ExitOnHover", ButtonName.Exit, m_RenderContext)); m_LostMenu.AddItem(new GUIButton("Textures/GUI/Buttons/RestartNormal", "Textures/GUI/Buttons/RestartOnHover", ButtonName.Restart, m_RenderContext)); m_LostMenu.Initialize(m_RenderContext); //SOUND //***** SoundManager.AddSound("Background", m_RenderContext); // SoundManager.AddSound("ButtonClick", m_RenderContext); //POST PROCESSING //*************** m_BloomPP = new BloomPostProcessing(this); m_RenderContext.Component.Add(m_BloomPP); m_Particles = new WindParticleSystem(m_RenderContext, 7); // m_RenderContext.Component.Add(m_Particles); //GAMESCENE //********* MainScene = new GameScene(); m_Texture = Content.Load <Texture2D>("Textures/Models/D_Default"); m_Sprite = new GameSprite("Textures/Models/D_Default", m_RenderContext); m_Sprite.Scale(0.5f); }
void Draw2D(RenderContext context, bool before3D) { //DRAW SPRITES BEFORE THE 3D //************************* if (before3D) { //Parallaxing m_BgManager.DrawBefore(context); m_LevelManager.Draw2D(context); //Hit overlays if (PlayerHit) { m_HitOpacity = 1; PlayerHit = false; } HitScreen.Scale(context.ViewPortSize.X / HitScreen.Width, context.ViewPortSize.Y / HitScreen.Height); if (HitScreen != null) { HitScreen.DrawAsGUI(context, m_HitOpacity); } if (m_HitOpacity > 0) { m_HitOpacity -= 0.01f; } if (m_HitOpacity < 0) { m_HitOpacity = 0; } if (PickupHit) { m_PickOpacity = 1; PickupHit = false; } PickScreen.Scale(context.ViewPortSize.X / HitScreen.Width, context.ViewPortSize.Y / HitScreen.Height); if (PickScreen != null) { PickScreen.DrawAsGUI(context, m_PickOpacity); } if (m_PickOpacity > 0) { m_PickOpacity -= 0.01f; } if (m_PickOpacity < 0) { m_PickOpacity = 0; } //Use For text TextRenderer.DrawText("Distance Traveled: " + (int)(m_TotalDistanceTraveled * 0.02f) + "\nHighest score: " + m_Data.HighestDistance, m_ViewPort.Width * 0.45f, m_ViewPort.Height * 0.02f, Color.White, context); #if (DEBUG) if (m_bEnableDebug) { m_MonoDebug.RenderDebugData(context.Camera.Projection, context.Camera.View); m_Player.DisplaySettings(context); } #endif } else if (!before3D) { m_BgManager.DrawAfter(context); } }
protected override void LoadContent() { //MENU //*************** m_MenuManager = new MenuManager(m_RenderContext.ViewPortSize / 2); m_MenuManager.AddItem(new GUIButton("Textures/GUI/Buttons/StartNormal", "Textures/GUI/Buttons/StartOnHover", ButtonName.Start, m_RenderContext)); m_MenuManager.AddItem(new GUIButton("Textures/GUI/Buttons/ExitNormal", "Textures/GUI/Buttons/ExitOnHover", ButtonName.Exit, m_RenderContext)); m_MenuManager.AddItem(new GUIButton("Textures/GUI/Buttons/RestartNormal", "Textures/GUI/Buttons/RestartOnHover", ButtonName.Restart, m_RenderContext)); m_MenuManager.AddItem(new GUIButton("Textures/GUI/Buttons/ToggleFullscreenNormal", "Textures/GUI/Buttons/ToggleFullscreenOnHover", ButtonName.Fullscreen, m_RenderContext)); //Set the splash screen and hit screen m_MenuManager.BackgroundScreen = new GameSprite("Textures/GUI/BackgroundStartScreen", m_RenderContext); m_MenuManager.SplashScreen = new GameSprite("Textures/GUI/DAEScreen_GUI", m_RenderContext); m_MenuManager.Initialize(m_RenderContext); m_LostMenu = new MenuManager(m_RenderContext.ViewPortSize / 2); m_LostMenu.AddItem(new GUIButton("Textures/GUI/Buttons/ExitNormal", "Textures/GUI/Buttons/ExitOnHover", ButtonName.Exit, m_RenderContext)); m_LostMenu.AddItem(new GUIButton("Textures/GUI/Buttons/RestartNormal", "Textures/GUI/Buttons/RestartOnHover", ButtonName.Restart, m_RenderContext)); m_LostMenu.Initialize(m_RenderContext); //SOUND //***** SoundManager.AddSound("Background", m_RenderContext); // SoundManager.AddSound("ButtonClick", m_RenderContext); //POST PROCESSING //*************** m_BloomPP = new BloomPostProcessing(this); m_RenderContext.Component.Add(m_BloomPP); m_Particles = new WindParticleSystem(m_RenderContext, 7); // m_RenderContext.Component.Add(m_Particles); //GAMESCENE //********* MainScene = new GameScene(); m_Texture = Content.Load<Texture2D>("Textures/Models/D_Default"); m_Sprite = new GameSprite("Textures/Models/D_Default", m_RenderContext); m_Sprite.Scale(0.5f); }
public void Initialize(RenderContext context) { //SplashScreen should always fill the screen of thw game correctly SplashScreen.Scale(context.ViewPortSize.X / SplashScreen.Width, context.ViewPortSize.Y / SplashScreen.Height); }