public void DrawStep9(Camera2D camera, RenderStep step, GameTime gameTime) { if (!LevelEV.SAVE_FRAMES) { camera.Draw(m_shadowRenderTarget, Vector2.Zero, Color.White); } else { camera.Draw(m_shadowRenderTarget, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, new Vector2(2f, 2f), SpriteEffects.None, 1f); } }
public void Draw(RenderTarget2D srcTexture, Camera2D Camera, RenderTarget2D mask = null) { if (effect == null) { throw new InvalidOperationException("GaussianBlur.fx effect not loaded."); } Camera.GraphicsDevice.SetRenderTarget(m_renderHolder); m_offsetParameters.SetValue(TextureOffsetsX); if (mask != null) { Camera.GraphicsDevice.Textures[1] = mask; Camera.GraphicsDevice.SamplerStates[1] = SamplerState.LinearClamp; } Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.LinearClamp, null, null, effect); if (LevelEV.SAVE_FRAMES) { Camera.Draw(srcTexture, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, new Vector2(0.5f, 0.5f), SpriteEffects.None, 1f); } else { Camera.Draw(srcTexture, Vector2.Zero, Color.White); } Camera.End(); if (LevelEV.SAVE_FRAMES) { Camera.GraphicsDevice.SetRenderTarget(m_renderHolder2); m_offsetParameters.SetValue(TextureOffsetsY); if (mask != null) { Camera.GraphicsDevice.Textures[1] = mask; } Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, null, null, null, effect); Camera.Draw(m_renderHolder, Vector2.Zero, Color.White); Camera.End(); Camera.GraphicsDevice.SetRenderTarget(srcTexture); Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.PointClamp, null, null); Camera.Draw(m_renderHolder2, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, new Vector2(2f, 2f), SpriteEffects.None, 1f); Camera.End(); return; } Camera.GraphicsDevice.SetRenderTarget(srcTexture); m_offsetParameters.SetValue(TextureOffsetsY); if (mask != null) { Camera.GraphicsDevice.Textures[1] = mask; } Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, null, null, null, effect); Camera.Draw(m_renderHolder, Vector2.Zero, Color.White); Camera.End(); }
public override void Draw(Camera2D camera) { m_mountain1.X = camera.TopLeftCorner.X * 0.5f; m_mountain2.X = m_mountain1.X + 2640f; base.Draw(camera); camera.Draw(Game.GenericTexture, new Rectangle(0, 0, 2640, 720), Color.Black * 0.6f); foreach (var current in m_rainFG) { current.Draw(camera); } if (m_inSecondPart) { camera.Draw(Game.GenericTexture, new Rectangle(1650, 0, 3000, 720), Color.Black); } }
public void DrawStep2(Camera2D camera, RenderStep step, GameTime gameTime) { if (!m_enemiesPaused) { camera.Draw(m_bgRenderTarget, Vector2.Zero, Color.White); } }
/// <summary> /// Draws the level. /// </summary> public void Draw() { this.background.Update(); this.background.Draw(); if (this.StartPosition != Vector2.Zero) { Camera2D.Draw(this.startSprite, this.StartPosition, 0.0f); } if (this.ExitPosition != Vector2.Zero) { Camera2D.Draw(this.exitSprite, this.ExitPosition, 0.0f); } SceneryRenderer.DrawTerrain(this.spriteBatch, this.rockyTerrain, this.floorEdgePoints, this.screenDimensions.Y * 1.5f); foreach (PlatformDescription platformDescription in this.platformDescriptions) { this.DrawPlatform(platformDescription); } foreach (InteractiveEntityDescription entityDescription in this.interactiveEntityDescriptions) { this.DrawInteractiveEntity(entityDescription); } }
public override void Draw(Camera2D camera) { if (this.ShowTerrain && CollisionMath.Intersects(this.Bounds, camera.Bounds) || base.ForceDraw) { camera.Draw(Game.GenericTexture, base.Position, new Rectangle(0, 0, this.Width, this.Height), base.TextureColor, MathHelper.ToRadians(base.Rotation), Vector2.Zero, 1f, SpriteEffects.None, 0f); } }
/// <summary> /// Draws a platform. /// </summary> /// <param name="position">The centre position of the platform.</param> private void DrawPlatform(Vector2 position) { Camera2D.Draw(this.platformSprite, position, 0.0f); if (this.platformWidth > this.platformSprite.Width) { int count = 0; // Useable area on middle sprites (removing rounded ends) float offset = this.platformSprite.Width - this.platformSprite.Height; float halfLeftOver = (this.platformWidth - offset) * 0.5f; // Leftover greater than useable area on end sprites while (halfLeftOver > this.platformSprite.Width - (this.platformSprite.Height / 2.0f)) { count++; Camera2D.Draw(this.platformSprite, new Vector2(position.X + (offset * count), position.Y), 0.0f); Camera2D.Draw(this.platformSprite, new Vector2(position.X - (offset * count), position.Y), 0.0f); halfLeftOver -= offset; } // Fill in ends if (halfLeftOver > 0.0f) { Camera2D.Draw(this.platformSprite, position + new Vector2((this.platformWidth / 2.0f) - (this.platformSprite.Width / 2.0f), 0.0f), 0.0f); Camera2D.Draw(this.platformSprite, position + new Vector2(-(this.platformWidth / 2.0f) + (this.platformSprite.Width / 2.0f), 0.0f), 0.0f); } } }
/// <summary> /// Draws the stick man to the screen. /// </summary> public void Draw() { switch (this.state) { case PlayerState.standing: Camera2D.Draw(this.standingSprite, this.Position, this.fullBody.Rotation); break; case PlayerState.crouching: Camera2D.Draw(this.crouchingSprite, this.Position, this.smallBody.Rotation); break; case PlayerState.jumping: Camera2D.Draw(this.jumpingSprite, this.Position, this.fullBody.Rotation); break; case PlayerState.running: Camera2D.Draw(this.runningSprite, this.Position, this.fullBody.Rotation); break; case PlayerState.falling: Camera2D.Draw(this.jumpingSprite, this.Position, this.fullBody.Rotation); break; case PlayerState.dead: Camera2D.Draw(this.dyingSprite, this.Position, 0.0f); break; default: break; } }
public override void Draw(Camera2D camera) { if ((this.ShowTerrain && CollisionMath.Intersects(this.Bounds, camera.Bounds)) || base.ForceDraw) { camera.Draw(Game.GenericTexture, base.Position, new Rectangle?(new Rectangle(0, 0, this.Width, this.Height)), base.TextureColor, MathHelper.ToRadians(base.Rotation), Vector2.Zero, 1f, SpriteEffects.None, 0f); } }
public override void Draw(Camera2D camera) { if ((ShowTerrain && CollisionMath.Intersects(Bounds, camera.Bounds)) || ForceDraw) { camera.Draw(Game.GenericTexture, Position, new Rectangle(0, 0, Width, Height), TextureColor, MathHelper.ToRadians(Rotation), Vector2.Zero, 1f, SpriteEffects.None, 0f); } }
/// <summary> /// Draws a platform. /// </summary> public void Draw() { Vector2 position = ConvertUnits.ToDisplayUnits(this.body.Position); foreach (Vector2 offset in this.spriteOffsets) { Camera2D.Draw(this.sprite, position + offset, 0.0f); } }
/// <summary> /// Draws the background, tiled across the screen. /// </summary> public void Draw() { Vector2 cameraPos = Camera2D.OffsetPosition; foreach (Vector2 tilePosition in this.tilePositions) { Camera2D.Draw(this.tileSprite, tilePosition, 0.0f, Color.White, 1.0f, SpriteEffects.None, this.layerDepth); } }
/// <summary> /// Draws an interactive entity. /// </summary> /// <param name="entityDescription">The entity's description.</param> private void DrawInteractiveEntity(InteractiveEntityDescription entityDescription) { switch (entityDescription.Name) { case EntityConstants.FireName: Camera2D.Draw(this.fireSprite, entityDescription.Position, 0.0f); break; case EntityConstants.SpikeName: Camera2D.Draw(this.spikeSprite, entityDescription.Position, 0.0f); break; case EntityConstants.RockName: Camera2D.Draw(this.rockSprite, entityDescription.Position, 0.0f); break; case EntityConstants.InvincibleName: Camera2D.Draw(this.invincibleSprite, entityDescription.Position, 0.0f); break; case EntityConstants.HealthName: Camera2D.Draw(this.healthSprite, entityDescription.Position, 0.0f); break; case EntityConstants.SpeedName: Camera2D.Draw(this.speedSprite, entityDescription.Position, 0.0f); break; case EntityConstants.JumpName: Camera2D.Draw(this.jumpSprite, entityDescription.Position, 0.0f); break; case EntityConstants.CoinName: Camera2D.Draw(this.coinSprite, entityDescription.Position, 0.0f); break; case EntityConstants.DiamondName: Camera2D.Draw(this.diamondSprite, entityDescription.Position, 0.0f); break; case EntityConstants.RubyName: Camera2D.Draw(this.rubySprite, entityDescription.Position, 0.0f); break; case EntityConstants.Switch: Camera2D.Draw(this.switchSprite, entityDescription.Position, 0.0f); break; case EntityConstants.CartBody: Camera2D.Draw(this.cartSprite, entityDescription.Position, 0.0f); break; default: break; } }
public override void Draw(Camera2D camera) { this.m_mountain1.X = camera.TopLeftCorner.X * 0.5f; this.m_mountain2.X = this.m_mountain1.X + 2640f; base.Draw(camera); camera.Draw(Game.GenericTexture, new Rectangle(0, 0, 2640, 720), Color.Black * 0.6f); foreach (RaindropObj current in this.m_rainFG) { current.Draw(camera); } if (this.m_inSecondPart) { camera.Draw(Game.GenericTexture, new Rectangle(1650, 0, 3000, 720), Color.Black); } }
/// <summary> /// Draws the interactive entity. /// </summary> public virtual void Draw() { if (this.PhysicsBody.UserData == null || ((InteractiveEntityUserData)this.PhysicsBody.UserData).IsActive != true) { if (!this.destroyed) { this.destroyed = true; AudioManager.PlayEffect(this.Sound); } } else { Camera2D.Draw(this.Sprite, ConvertUnits.ToDisplayUnits(this.PhysicsBody.Position), this.PhysicsBody.Rotation); } }
public override void Draw(Camera2D camera) { m_mountain1.X = camera.TopLeftCorner.X * 0.5f; m_mountain2.X = m_mountain1.X + 2640f; base.Draw(camera); if (m_isRaining) { camera.Draw(Game.GenericTexture, new Rectangle(0, 0, 2640, 720), Color.Black * 0.3f); } if (m_screenShakeCounter > 0f) { camera.X += CDGMath.RandomPlusMinus(); camera.Y += CDGMath.RandomPlusMinus(); m_screenShakeCounter -= (float)camera.GameTime.ElapsedGameTime.TotalSeconds; } if (SmithyAvailable) { m_blacksmithBoard.Draw(camera); m_blacksmith.Draw(camera); m_blacksmithIcon.Draw(camera); } if (EnchantressAvailable) { m_tent.Draw(camera); m_enchantress.Draw(camera); m_enchantressIcon.Draw(camera); } if (ArchitectAvailable) { m_screw.Draw(camera); m_architect.Draw(camera); m_architectIcon.Draw(camera); } if (TollCollectorAvailable) { m_tollCollector.Draw(camera); m_tollCollectorIcon.Draw(camera); } m_blacksmithNewIcon.Draw(camera); m_enchantressNewIcon.Draw(camera); if (m_isRaining) { foreach (var current in m_rainFG) { current.Draw(camera); } } }
/// <summary> /// Draws the floor to the screen. /// </summary> private void DrawFloor() { Vector2 startPoint = Vector2.Zero; foreach (Vector2 point in this.floorEdgePoints) { if (startPoint != Vector2.Zero) { Vector2 direction = point - startPoint; direction.Normalize(); Camera2D.Draw(this.edgeSprite, (startPoint + point) / 2.0f, (float)Math.Asin(direction.Y)); } startPoint = point; } }
public void DrawStep7(Camera2D camera, RenderStep step, GameTime gameTime) { camera.Draw(Game.GenericTexture, new Rectangle((int)camera.TopLeftCorner.X, (int)camera.TopLeftCorner.Y, 1320, 720), Color.Black * BackBufferOpacity); if (!m_player.IsKilled) { m_player.Draw(camera); } if (!LevelEV.CREATE_RETAIL_VERSION) { DebugTextObj.Position = new Vector2(camera.X, camera.Y - 300f); DebugTextObj.Draw(camera); } m_itemDropManager.Draw(camera); m_impactEffectPool.Draw(camera); }
public override void Draw(Camera2D camera) { m_moon.X = m_moonPos.X - camera.TopLeftCorner.X * 0.01f; m_moon.Y = m_moonPos.Y - camera.TopLeftCorner.Y * 0.01f; camera.GraphicsDevice.Clear(new Color(4, 29, 86)); camera.Draw(Game.GenericTexture, new Rectangle(-10, -10, 1400, 800), Color.SkyBlue * MorningOpacity); m_moon.Opacity = 1f - MorningOpacity; m_silhouette.Opacity = 1f - MorningOpacity; m_differenceCloud.Opacity = 1f - MorningOpacity; m_differenceCloud2.Opacity = 1f - MorningOpacity; m_differenceCloud3.Opacity = MorningOpacity; m_moon.Draw(camera); m_differenceCloud.Draw(camera); m_differenceCloud2.Draw(camera); m_differenceCloud3.Draw(camera); m_silhouette.Draw(camera); base.Draw(camera); }
public override void Draw(Camera2D camera) { this.m_moon.X = this.m_moonPos.X - camera.TopLeftCorner.X * 0.01f; this.m_moon.Y = this.m_moonPos.Y - camera.TopLeftCorner.Y * 0.01f; camera.GraphicsDevice.Clear(new Color(4, 29, 86)); camera.Draw(Game.GenericTexture, new Rectangle(-10, -10, 1400, 800), Color.SkyBlue * this.MorningOpacity); this.m_moon.Opacity = 1f - this.MorningOpacity; this.m_silhouette.Opacity = 1f - this.MorningOpacity; this.m_differenceCloud.Opacity = 1f - this.MorningOpacity; this.m_differenceCloud2.Opacity = 1f - this.MorningOpacity; this.m_differenceCloud3.Opacity = this.MorningOpacity; this.m_moon.Draw(camera); this.m_differenceCloud.Draw(camera); this.m_differenceCloud2.Draw(camera); this.m_differenceCloud3.Draw(camera); this.m_silhouette.Draw(camera); base.Draw(camera); }
/// <summary> /// Draws a floor edge. /// </summary> private void DrawFloorEdge() { Vector2 position = Vector2.Zero; float angle = 0.0f; if (this.lastFloorPoint == Vector2.Zero) { position = new Vector2(this.edgeSprite.Width / 2.0f, this.cursorPosition.Y); } else if (this.currentFloorPoint != this.lastFloorPoint) { position = (this.lastFloorPoint + this.currentFloorPoint) / 2.0f; Vector2 direction = this.currentFloorPoint - this.lastFloorPoint; direction.Normalize(); angle = (float)Math.Asin(direction.Y); } Camera2D.Draw(this.edgeSprite, position, angle); }
public override void Draw(Camera2D camera) { if (Visible) { camera.End(); camera.GraphicsDevice.Textures[1] = m_alphaMaskRT; camera.GraphicsDevice.SamplerStates[1] = SamplerState.LinearClamp; camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, Game.MaskEffect); if (!DrawNothing) { camera.Draw(m_mapScreenRT, Vector2.Zero, Color.White); } camera.End(); camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null); if (DrawNothing) { m_playerSprite.Draw(camera); } } }
public void DrawStep6(Camera2D camera, RenderStep step, GameTime gameTime) { camera.Draw(m_bgRenderTarget, Vector2.Zero, Color.White); }
/// <summary> /// Draws the level editor's world. /// </summary> public void Draw() { this.levelToEdit.Draw(); switch (this.EntitySelected) { case ModifiableEntity.Floor: this.DrawFloorEdge(); break; case ModifiableEntity.StartPosition: Camera2D.Draw(this.startSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.ExitPosition: Camera2D.Draw(this.exitSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Platform: this.DrawPlatform(this.cursorPosition); break; case ModifiableEntity.Invincible: Camera2D.Draw(this.invincibleSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Speed: Camera2D.Draw(this.speedSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Jump: Camera2D.Draw(this.jumpSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Health: Camera2D.Draw(this.healthSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Fire: Camera2D.Draw(this.fireSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Rock: Camera2D.Draw(this.rockSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Spike: Camera2D.Draw(this.spikeSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Cart: Camera2D.Draw(this.cartSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Switch: Camera2D.Draw(this.switchSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Coin: Camera2D.Draw(this.coinSprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Ruby: Camera2D.Draw(this.rubySprite, this.cursorPosition, 0.0f); break; case ModifiableEntity.Diamond: Camera2D.Draw(this.diamondSprite, this.cursorPosition, 0.0f); break; default: break; } if (this.placeCommandActive) { Camera2D.Draw(this.placementFeedbackSprite, this.cursorPosition, 0.0f); } }
public override void Draw(Camera2D camera) { if (base.Visible) { camera.End(); camera.GraphicsDevice.Textures[1] = this.m_alphaMaskRT; camera.GraphicsDevice.SamplerStates[1] = SamplerState.LinearClamp; camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, Game.MaskEffect); if (!this.DrawNothing) { camera.Draw(this.m_mapScreenRT, Vector2.Zero, Color.White); } camera.End(); camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null); if (this.DrawNothing) { this.m_playerSprite.Draw(camera); } } }
public override void Draw(Camera2D camera) { base.Draw(camera); camera.Draw(Game.GenericTexture, new Rectangle((int)X, (int)Y, Width, Height), Color.White * BackBufferOpacity); }
public void DrawStep12(Camera2D camera, RenderStep step, GameTime gameTime) { camera.Draw(m_finalRenderTarget, Vector2.Zero, new Color(180, 150, 80)); m_creditsText.Draw(camera); m_creditsTitleText.Draw(camera); }
public override void Draw(Camera2D camera) { camera.Draw(m_texture, Position, new Rectangle(0, 0, (int)(Width / 60f * 64f), Height), TextureColor, MathHelper.ToRadians(Rotation), Vector2.Zero, Scale, SpriteEffects.None, 1f); }
public void DrawStep3(Camera2D camera, RenderStep step, GameTime gameTime) { camera.Draw(CurrentRoom.BGRender, camera.TopLeftCorner, Color.White); }
/// <summary> /// Draws a cart entity. /// </summary> public void Draw() { Camera2D.Draw(this.cartSprite, ConvertUnits.ToDisplayUnits(this.cartBody.Position), this.cartBody.Rotation); Camera2D.Draw(this.wheelSprite, ConvertUnits.ToDisplayUnits(this.wheelBodyLeft.Position), this.wheelBodyLeft.Rotation); Camera2D.Draw(this.wheelSprite, ConvertUnits.ToDisplayUnits(this.wheelBodyRight.Position), this.wheelBodyRight.Rotation); }
public override void Draw(Camera2D camera) { var texture2D = BorderTexture; if (Game.PlayerStats.Traits.X == 32f || Game.PlayerStats.Traits.Y == 32f) { TextureOffset = Vector2.Zero; texture2D = NeoTexture; } if (BorderBottom) { camera.Draw(texture2D, new Vector2(Bounds.Right - CornerTexture.Width + TextureOffset.X, Bounds.Bottom - TextureOffset.Y), new Rectangle(0, 0, (int)(Width / TextureScale.X) - CornerTexture.Width * 2, texture2D.Height), TextureColor, MathHelper.ToRadians(180f), Vector2.Zero, TextureScale, SpriteEffects.None, 0f); } if (BorderLeft) { camera.Draw(texture2D, new Vector2(X + TextureOffset.Y, Bounds.Bottom - CornerTexture.Width - TextureOffset.X), new Rectangle(0, 0, (int)(Height / TextureScale.Y) - CornerTexture.Width * 2, texture2D.Height), TextureColor, MathHelper.ToRadians(-90f), Vector2.Zero, TextureScale, SpriteEffects.None, 0f); } if (BorderRight) { camera.Draw(texture2D, new Vector2(Bounds.Right - TextureOffset.Y, Y + CornerTexture.Width + TextureOffset.X), new Rectangle(0, 0, (int)(Height / TextureScale.Y) - CornerTexture.Width * 2, texture2D.Height), TextureColor, MathHelper.ToRadians(90f), Vector2.Zero, TextureScale, SpriteEffects.None, 0f); } if (BorderTop) { if (Rotation == 0f) { camera.Draw(texture2D, new Vector2(X + CornerTexture.Width + TextureOffset.X, Y + TextureOffset.Y), new Rectangle(0, 0, (int)(Width / TextureScale.X) - CornerTexture.Width * 2, texture2D.Height), TextureColor, MathHelper.ToRadians(Rotation), Vector2.Zero, TextureScale, SpriteEffects.None, 0f); } else { var position = CollisionMath.UpperLeftCorner(new Rectangle((int)X, (int)Y, _width, _height), Rotation, Vector2.Zero); var position2 = CollisionMath.UpperRightCorner( new Rectangle((int)X, (int)Y, _width, _height), Rotation, Vector2.Zero); if (Rotation > 0f && Rotation < 80f) { CornerTexture.Flip = SpriteEffects.FlipHorizontally; CornerTexture.Position = position; CornerTexture.Rotation = 0f; CornerTexture.Draw(camera); CornerTexture.Flip = SpriteEffects.None; CornerTexture.Position = new Vector2(position2.X - CornerTexture.Width / 2f, position2.Y); CornerTexture.Rotation = 0f; CornerTexture.Draw(camera); } if (Rotation < 0f && Rotation > -80f) { CornerTexture.Flip = SpriteEffects.FlipHorizontally; CornerTexture.Position = position; CornerTexture.X += CornerTexture.Width / 2f; CornerTexture.Rotation = 0f; CornerTexture.Draw(camera); CornerTexture.Flip = SpriteEffects.None; CornerTexture.Position = position2; CornerTexture.Rotation = 0f; CornerTexture.Draw(camera); } camera.Draw(texture2D, new Vector2( X + TextureOffset.X - (float)Math.Sin(MathHelper.ToRadians(Rotation)) * TextureOffset.Y, Y + (float)Math.Cos(MathHelper.ToRadians(Rotation)) * TextureOffset.Y), new Rectangle(0, 0, (int)(Width / TextureScale.X), texture2D.Height), TextureColor, MathHelper.ToRadians(Rotation), Vector2.Zero, TextureScale, SpriteEffects.None, 0f); } } base.Draw(camera); }
public void DrawDetectionRadii(Camera2D camera) { camera.Draw(this.m_engageRadiusTexture, new Vector2(base.Position.X - (float)this.EngageRadius, base.Position.Y - (float)this.EngageRadius), Color.Red * 0.5f); camera.Draw(this.m_projectileRadiusTexture, new Vector2(base.Position.X - (float)this.ProjectileRadius, base.Position.Y - (float)this.ProjectileRadius), Color.Blue * 0.5f); camera.Draw(this.m_meleeRadiusTexture, new Vector2(base.Position.X - (float)this.MeleeRadius, base.Position.Y - (float)this.MeleeRadius), Color.Green * 0.5f); }
/// <summary> /// Draws a switch entity. /// </summary> public void Draw() { Camera2D.Draw(this.sprite, ConvertUnits.ToDisplayUnits(this.physicsBody.Position), 0.0f); }
public override void Draw(Camera2D camera) { base.Draw(camera); camera.Draw(Game.GenericTexture, new Rectangle((int)base.X, (int)base.Y, this.Width, this.Height), Color.White * this.BackBufferOpacity); }
public override void Draw(Camera2D camera) { Texture2D texture2D = this.BorderTexture; if (Game.PlayerStats.Traits.X == 32f || Game.PlayerStats.Traits.Y == 32f) { this.TextureOffset = Vector2.Zero; texture2D = this.NeoTexture; } if (this.BorderBottom) { camera.Draw(texture2D, new Vector2((float)(this.Bounds.Right - this.CornerTexture.Width) + this.TextureOffset.X, (float)this.Bounds.Bottom - this.TextureOffset.Y), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Width / this.TextureScale.X) - this.CornerTexture.Width * 2, texture2D.Height)), base.TextureColor, MathHelper.ToRadians(180f), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f); } if (this.BorderLeft) { camera.Draw(texture2D, new Vector2(base.X + this.TextureOffset.Y, (float)(this.Bounds.Bottom - this.CornerTexture.Width) - this.TextureOffset.X), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Height / this.TextureScale.Y) - this.CornerTexture.Width * 2, texture2D.Height)), base.TextureColor, MathHelper.ToRadians(-90f), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f); } if (this.BorderRight) { camera.Draw(texture2D, new Vector2((float)this.Bounds.Right - this.TextureOffset.Y, base.Y + (float)this.CornerTexture.Width + this.TextureOffset.X), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Height / this.TextureScale.Y) - this.CornerTexture.Width * 2, texture2D.Height)), base.TextureColor, MathHelper.ToRadians(90f), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f); } if (this.BorderTop) { if (base.Rotation == 0f) { camera.Draw(texture2D, new Vector2(base.X + (float)this.CornerTexture.Width + this.TextureOffset.X, base.Y + this.TextureOffset.Y), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Width / this.TextureScale.X) - this.CornerTexture.Width * 2, texture2D.Height)), base.TextureColor, MathHelper.ToRadians(base.Rotation), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f); } else { Vector2 position = CollisionMath.UpperLeftCorner(new Rectangle((int)base.X, (int)base.Y, this._width, this._height), base.Rotation, Vector2.Zero); Vector2 position2 = CollisionMath.UpperRightCorner(new Rectangle((int)base.X, (int)base.Y, this._width, this._height), base.Rotation, Vector2.Zero); if (base.Rotation > 0f && base.Rotation < 80f) { this.CornerTexture.Flip = SpriteEffects.FlipHorizontally; this.CornerTexture.Position = position; this.CornerTexture.Rotation = 0f; this.CornerTexture.Draw(camera); this.CornerTexture.Flip = SpriteEffects.None; this.CornerTexture.Position = new Vector2(position2.X - (float)this.CornerTexture.Width / 2f, position2.Y); this.CornerTexture.Rotation = 0f; this.CornerTexture.Draw(camera); } if (base.Rotation < 0f && base.Rotation > -80f) { this.CornerTexture.Flip = SpriteEffects.FlipHorizontally; this.CornerTexture.Position = position; this.CornerTexture.X += (float)this.CornerTexture.Width / 2f; this.CornerTexture.Rotation = 0f; this.CornerTexture.Draw(camera); this.CornerTexture.Flip = SpriteEffects.None; this.CornerTexture.Position = position2; this.CornerTexture.Rotation = 0f; this.CornerTexture.Draw(camera); } camera.Draw(texture2D, new Vector2(base.X + this.TextureOffset.X - (float)Math.Sin((double)MathHelper.ToRadians(base.Rotation)) * this.TextureOffset.Y, base.Y + (float)Math.Cos((double)MathHelper.ToRadians(base.Rotation)) * this.TextureOffset.Y), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Width / this.TextureScale.X), texture2D.Height)), base.TextureColor, MathHelper.ToRadians(base.Rotation), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f); } } base.Draw(camera); }
public void Draw(RenderTarget2D srcTexture, Camera2D Camera, RenderTarget2D mask = null) { if (this.effect == null) { throw new InvalidOperationException("GaussianBlur.fx effect not loaded."); } Camera.GraphicsDevice.SetRenderTarget(this.m_renderHolder); this.m_offsetParameters.SetValue(this.offsetsHoriz); if (mask != null) { Camera.GraphicsDevice.Textures[1] = mask; Camera.GraphicsDevice.SamplerStates[1] = SamplerState.LinearClamp; } Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.LinearClamp, null, null, this.effect); if (LevelEV.SAVE_FRAMES) { Camera.Draw(srcTexture, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, new Vector2(0.5f, 0.5f), SpriteEffects.None, 1f); } else { Camera.Draw(srcTexture, Vector2.Zero, Color.White); } Camera.End(); if (LevelEV.SAVE_FRAMES) { Camera.GraphicsDevice.SetRenderTarget(this.m_renderHolder2); this.m_offsetParameters.SetValue(this.offsetsVert); if (mask != null) { Camera.GraphicsDevice.Textures[1] = mask; } Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, null, null, null, this.effect); Camera.Draw(this.m_renderHolder, Vector2.Zero, Color.White); Camera.End(); Camera.GraphicsDevice.SetRenderTarget(srcTexture); Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.PointClamp, null, null); Camera.Draw(this.m_renderHolder2, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, new Vector2(2f, 2f), SpriteEffects.None, 1f); Camera.End(); return; } Camera.GraphicsDevice.SetRenderTarget(srcTexture); this.m_offsetParameters.SetValue(this.offsetsVert); if (mask != null) { Camera.GraphicsDevice.Textures[1] = mask; } Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, null, null, null, this.effect); Camera.Draw(this.m_renderHolder, Vector2.Zero, Color.White); Camera.End(); }