public override void Update() { if (CollidesWithPlayer() && Keyboard.GetState().IsKeyDown(Keys.W)) { TextDialog.setUpDialog(dialog); } base.Update(); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { light.Position = player.getCenter(); GraphicsDevice.SetRenderTarget(rt); penumbra.Transform = cam.get_transformation(GraphicsDevice); penumbra.BeginDraw(); GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here spriteBatch.Begin(samplerState: SamplerState.PointWrap, transformMatrix: cam.get_transformation(GraphicsDevice)); world.drawBackground(spriteBatch); //world.drawOutlines(spriteBatch); // player.drawOutlines(spriteBatch); world.Draw(spriteBatch); player.Draw(spriteBatch); spriteBatch.End(); penumbra.Draw(gameTime); GraphicsDevice.SetRenderTarget(null); /* Bloom Pass Begin */ GraphicsDevice.SetRenderTarget(preBloomTarget); GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(samplerState: SamplerState.LinearClamp, transformMatrix: cam.get_transformation(GraphicsDevice)); world.drawIllumination(spriteBatch); player.drawIllumination(spriteBatch); spriteBatch.End(); GraphicsDevice.SetRenderTarget(null); bloomMipmap.generate(spriteBatch); // blurPass.blur(spriteBatch, bloomMipmap.getLevel(4), bloomMipmap.getLevel(4)); blurPass2.blur(spriteBatch, bloomMipmap.getLevel(1), bloomMipmap.getLevel(1)); blurPass1.blur(spriteBatch, bloomMipmap.getLevel(3), bloomMipmap.getLevel(3)); blurPass.blur(spriteBatch, bloomMipmap.getLevel(4), bloomMipmap.getLevel(4)); /* Bloom Pass End */ spriteBatch.Begin(samplerState: SamplerState.PointClamp); spriteBatch.Draw(rt, new Rectangle(0, 0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height), new Color(0.8f, 0.8f, 0.8f, 1)); spriteBatch.End(); if (bloomEnabled) { spriteBatch.Begin(blendState: BlendState.Additive, samplerState: SamplerState.LinearClamp); spriteBatch.Draw(bloomMipmap.getLevel(1), new Rectangle(0, 0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height), Color.White); spriteBatch.Draw(bloomMipmap.getLevel(3), new Rectangle(0, 0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height), Color.White); spriteBatch.Draw(bloomMipmap.getLevel(4), new Rectangle(0, 0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height), Color.White); spriteBatch.End(); } guiBatch.Begin(); EditorGui.Draw(guiBatch); TextDialog.draw(guiBatch); guiBatch.End(); base.Draw(gameTime); }
public void setDialog(TextDialog dialog) { this.dialog = dialog; }
public Sign(ContentManager content, float x, float y, float width, float height, TextDialog dialog) : base(content, x, y, width, height) { textureTest = Game1.cManager.Load <Texture2D>("sign"); this.dialog = dialog; }
public static void setUpDialog(TextDialog dialog) { currentTextDialog = dialog; isInDialog = true; currentID = 0; }