public override void RenderTop(float xTopLeft, float yTopLeft, Batch wallTopsBatch) { int tileSpacing = mapMgr.GetTileSpacing(); Vector2D SEpos = new Vector2D(); if (_dir == Direction.East) { topSpriteNW.SetPosition((float)bounds.X - xTopLeft - 12f, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft); SEpos += topSpriteNW.Position + new Vector2D(tileSpacing, 0f); } else { topSpriteNW.SetPosition((float)bounds.X - xTopLeft, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft - 12f); SEpos += topSpriteNW.Position + new Vector2D(0f, tileSpacing); } topSpriteSE.SetPosition(SEpos.X, SEpos.Y); topSpriteNW.Color = Color.White; topSpriteSE.Color = Color.White; topSprite.Color = Color.White; topSprite.SetPosition((float)bounds.X - xTopLeft, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft); wallTopsBatch.AddClone(topSprite); wallTopsBatch.AddClone(topSpriteNW); wallTopsBatch.AddClone(topSpriteSE); }
public override void Render(float xTopLeft, float yTopLeft, Batch batch) { Sprite.SetPosition((float)bounds.X - xTopLeft, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft); Sprite.Color = Color.White; batch.AddClone(Sprite); if (_dir == Direction.East) { if ((surroundDirsNW & 8) == 0) { if ((surroundDirsNW & 1) != 0) { wallEndW.SetPosition((float)bounds.X - xTopLeft - 12f, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft); batch.AddClone(wallEndW); } } if ((surroundDirsSE & 2) == 0) { if ((surroundDirsSE & 1) != 0) { wallEndE.SetPosition((float)bounds.X - xTopLeft + Sprite.Width, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft); batch.AddClone(wallEndE); } } } }
public virtual void RenderGas(float xTopLeft, float yTopLeft, int tileSpacing, Batch gasBatch) { if (Visible && gasAmounts.Count > 0) { bool spritepositionset = false; foreach (var gasAmount in gasAmounts) { if (gasAmount.Value <= 1) { continue; } if (!spritepositionset) { gasSprite.SetPosition(Position.X - xTopLeft, Position.Y - yTopLeft); spritepositionset = true; } //int opacity = (int)Math.Floor(((double)gasAmount.Value / 15) * 255); // Commenting this out for now as it just makes some gas invisible until there's a shit load of it int opacity = 255; switch (gasAmount.Key) { case GasType.Toxin: gasSprite.Color = Color.FromArgb(opacity, Color.Orange); break; case GasType.WVapor: gasSprite.Color = Color.FromArgb(opacity, Color.LightBlue); break; } gasBatch.AddClone(gasSprite); } } }
public virtual void Render(float xTopLeft, float yTopLeft, Batch batch) { Sprite.Color = Color.White; Sprite.SetPosition((float)Position.X - xTopLeft, (float)Position.Y - yTopLeft); batch.AddClone(Sprite); }
public void Draw(float xTopLeft, float yTopLeft, int tileSpacing, Batch decalBatch) { //Need to find a way to light it. sprite.SetPosition(tile.Position.X - xTopLeft + position.X, tile.Position.Y - yTopLeft + position.Y); decalBatch.AddClone(sprite); }
public virtual void RenderGas(float xTopLeft, float yTopLeft, int tileSpacing, Batch gasBatch) { if (Visible && gasAmounts.Count > 0) { bool spritepositionset = false; foreach (var gasAmount in gasAmounts) { if (gasAmount.Value <= 1) continue; if (!spritepositionset) { gasSprite.SetPosition(Position.X - xTopLeft, Position.Y - yTopLeft); spritepositionset = true; } //int opacity = (int)Math.Floor(((double)gasAmount.Value / 15) * 255); // Commenting this out for now as it just makes some gas invisible until there's a shit load of it int opacity = 255; switch (gasAmount.Key) { case GasType.Toxin: gasSprite.Color = Color.FromArgb(opacity, Color.Orange); break; case GasType.WVapor: gasSprite.Color = Color.FromArgb(opacity, Color.LightBlue); break; } gasBatch.AddClone(gasSprite); } } }
public override void Render(float xTopLeft, float yTopLeft, Batch batch) { Sprite.SetPosition((float)bounds.X - xTopLeft, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft); Sprite.Color = Color.White; batch.AddClone(Sprite); if(_dir == Direction.East) { if ((surroundDirsNW & 8) == 0) { if((surroundDirsNW & 1) != 0) { wallEndW.SetPosition((float)bounds.X - xTopLeft - 12f, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft); batch.AddClone(wallEndW); } } if ((surroundDirsSE & 2) == 0) { if ((surroundDirsSE & 1) != 0) { wallEndE.SetPosition((float)bounds.X - xTopLeft + Sprite.Width, (float)bounds.Y - (Sprite.Height - bounds.Height) - yTopLeft); batch.AddClone(wallEndE); } } } }