public override bool Draw(Batcher2D batcher, int x, int y) { Vector3 hue = Vector3.Zero; ShaderHuesTraslator.GetHueVector(ref hue, Hue, IsPartial, Alpha); if (ScaleTexture) { if (Texture is ArtTexture artTexture) { int w = Width; int h = Height; if (artTexture.ImageRectangle.Width < Width) { w = artTexture.ImageRectangle.Width; x += Width / 2 - w / 2; } if (artTexture.ImageRectangle.Height < Height) { h = artTexture.ImageRectangle.Height; y += Height / 2 - h / 2; } var r = artTexture.ImageRectangle; return(batcher.Draw2D(Texture, x, y, w, h, r.X, r.Y, r.Width, r.Height, hue)); } return(batcher.Draw2D(Texture, x, y, Width, Height, 0, 0, Texture.Width, Texture.Height, hue)); } return(batcher.Draw2D(Texture, x, y, hue)); }
public override bool Draw(Batcher2D batcher, int x, int y) { Vector3 vec = ShaderHuesTraslator.GetHueVector(Hue, IsPartial, Alpha, false); if (ScaleTexture) { if (Texture is ArtTexture artTexture) { //var rect = new Rectangle(position.X, position.Y, Width, Height); int w = Width; int h = Height; if (artTexture.ImageRectangle.Width < Width) { w = artTexture.ImageRectangle.Width; } if (artTexture.ImageRectangle.Height < Height) { h = artTexture.ImageRectangle.Height; } var r = artTexture.ImageRectangle; return(batcher.Draw2D(Texture, x, y, w, h, r.X, r.Y, r.Width, r.Height, vec)); } return(batcher.Draw2D(Texture, x, y, Width, Height, 0, 0, Texture.Width, Texture.Height, vec)); } return(batcher.Draw2D(Texture, x, y, vec)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { base.Draw(batcher, position, hue); batcher.Draw2D(_line, new Rectangle(position.X + 30, position.Y + 50, 260, 1), ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, new Rectangle(position.X + 95, position.Y + 50, 1, 200), ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, new Rectangle(position.X + 245, position.Y + 50, 1, 200), ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, new Rectangle(position.X + 30, position.Y + 250, 260, 1), ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); return(true); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { Vector3 vec = ShaderHuesTraslator.GetHueVector(Hue, IsPartial, Alpha, false); if (ScaleTexture) { return(batcher.Draw2D(Texture, new Rectangle(position.X, position.Y, Width, Height), new Rectangle(0, 0, Texture.Width, Texture.Height), vec)); } return(batcher.Draw2D(Texture, position, vec)); }
public override bool Draw(Batcher2D batcher, int x, int y) { Vector3 huev = ShaderHuesTraslator.GetHueVector(MouseIsOver && HighlightOnMouseOver ? 0x0035 : Item.Hue, Item.ItemData.IsPartialHue, 0, false); batcher.Draw2D(Texture, x, y, huev); if (Item.Amount > 1 && Item.ItemData.IsStackable && Item.DisplayedGraphic == Item.Graphic) { batcher.Draw2D(Texture, x + 5, y + 5, huev); } return(base.Draw(batcher, x, y)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { Vector3 color = IsTransparent ? ShaderHuesTraslator.GetHueVector(0, false, Alpha, true) : Vector3.Zero; int middleWidth = Width - _gumpTexture[0].Width - _gumpTexture[2].Width; batcher.Draw2D(_gumpTexture[0], position, color); batcher.Draw2DTiled(_gumpTexture[1], new Rectangle(position.X + _gumpTexture[0].Width, position.Y, middleWidth, _gumpTexture[1].Height), color); batcher.Draw2D(_gumpTexture[2], new Point(position.X + Width - _gumpTexture[2].Width, position.Y), color); return(base.Draw(batcher, position, hue)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { Vector3 huev = ShaderHuesTraslator.GetHueVector(MouseIsOver && HighlightOnMouseOver ? 0x0035 : Item.Hue, Item.ItemData.IsPartialHue, 0, false); batcher.Draw2D(Texture, position, huev); if (Item.Amount > 1 && Item.ItemData.IsStackable && Item.DisplayedGraphic == Item.Graphic) { batcher.Draw2D(Texture, new Point(position.X + 5, position.Y + 5), huev); } return(base.Draw(batcher, position, huev)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { Vector3 vec = new Vector3(0, 0, Alpha); if (ScaleTexture) { return(batcher.Draw2D(Texture, new Rectangle(position.X, position.Y, Width, Height), new Rectangle(0, 0, Texture.Width, Texture.Height), vec)); } else { return(batcher.Draw2D(Texture, position, vec)); } }
public override bool Draw(Batcher2D batcher, int x, int y) { if (_gumpTexture == null || _gumpTexture.IsDisposed || IsDisposed) { return(false); } batcher.Draw2D(_gumpTexture, x, y, Vector3.Zero); CreateMiniMapTexture(); batcher.Draw2D(_mapTexture, x, y, Vector3.Zero); if (_draw) { if (_playerIndicator == null) { _playerIndicator = new Texture2D(batcher.GraphicsDevice, 1, 1); _playerIndicator.SetData(new uint[1] { 0xFFFFFFFF }); _mobilesIndicator = new Texture2D(batcher.GraphicsDevice, 1, 1); _mobilesIndicator.SetData(new [] { Color.White }); } int w = Width >> 1; int h = Height >> 1; foreach (Mobile mob in World.Mobiles.Where(s => s != World.Player)) { int xx = mob.X - World.Player.X; int yy = mob.Y - World.Player.Y; int gx = xx - yy; int gy = xx + yy; Vector3 hue = Vector3.Zero; ShaderHuesTraslator.GetHueVector(ref hue, Notoriety.GetHue(mob.NotorietyFlag)); batcher.Draw2D(_mobilesIndicator, x + w + gx, y + h + gy, 2, 2, hue); } //DRAW DOT OF PLAYER batcher.Draw2D(_playerIndicator, x + w, y + h, 2, 2, Vector3.Zero); } return(base.Draw(batcher, x, y)); }
public override bool Draw(Batcher2D batcher, int x, int y) { // draw regular world batcher.Draw2D(_scene.ViewportTexture, x, y, Width, Height, Vector3.Zero); // draw lights batcher.SetBlendState(_blend); batcher.Draw2D(_scene.Darkness, x, y, Width, Height, Vector3.Zero); batcher.SetBlendState(null); // draw overheads _scene.DrawOverheads(batcher, x, y); return(base.Draw(batcher, x, y)); }
public override bool Draw(Batcher2D batcher, int x, int y) { Vector3 hue = Vector3.Zero; ShaderHuesTraslator.GetHueVector(ref hue, 0, false, Alpha); return(batcher.Draw2D(CheckerTrans.TransparentTexture, x, y, Width, Height, hue)); }
public override bool Draw(Batcher2D batcher, int x, int y) { Vector3 hue = Vector3.Zero; ShaderHuesTraslator.GetHueVector(ref hue, 0, false, 1.0f - (_alpha / 255f)); return(batcher.Draw2D(Texture, x, y, hue)); }
public override bool Draw(Batcher2D batcher, int x, int y) { Vector3 hue = Vector3.Zero; ShaderHuesTraslator.GetHueVector(ref hue, MouseIsOver && HighlightOnMouseOver ? 0x0035 : Item.Hue, Item.ItemData.IsPartialHue, 0); return(batcher.Draw2D(Texture, x, y, Width, Height, _point.X, _point.Y, _originalSize.X, _originalSize.Y, hue)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { if (_gumpTexture == null || _gumpTexture.IsDisposed || IsDisposed) { return(false); } batcher.Draw2D(_gumpTexture, position, Vector3.Zero); CreateMiniMapTexture(); batcher.Draw2D(_mapTexture, position, Vector3.Zero); if (_draw) { if (_playerIndicator == null) { _playerIndicator = new Texture2D(batcher.GraphicsDevice, 1, 1); _playerIndicator.SetData(new uint[1] { 0xFFFFFFFF }); _mobilesIndicator = new Texture2D(batcher.GraphicsDevice, 1, 1); _mobilesIndicator.SetData(new [] { Color.White }); } int w = Width >> 1; int h = Height >> 1; foreach (Mobile mob in World.Mobiles.Where(s => s != World.Player)) { int x = mob.X - World.Player.X; int y = mob.Y - World.Player.Y; int gx = x - y; int gy = x + y; batcher.Draw2D(_mobilesIndicator, new Rectangle(position.X + w + gx, position.Y + h + gy, 2, 2), ShaderHuesTraslator.GetHueVector(Notoriety.GetHue(mob.NotorietyFlag))); } //DRAW DOT OF PLAYER batcher.Draw2D(_playerIndicator, new Rectangle(position.X + w, position.Y + h, 2, 2), Vector3.Zero); } return(base.Draw(batcher, position, hue)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { base.Draw(batcher, position, hue); batcher.Draw2D(_line, new Rectangle(position.X + 30, position.Y + 50, 260, 1), ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, new Rectangle(position.X + 95, position.Y + 50, 1, 200), ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, new Rectangle(position.X + 245, position.Y + 50, 1, 200), ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, new Rectangle(position.X + 30, position.Y + 250, 260, 1), ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); if (_edge == null) { _edge = new Texture2D(batcher.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); _edge.SetData(new Color[] { Color.Gray }); } batcher.DrawRectangle(_edge, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero); return(true); }
public override bool Draw(Batcher2D batcher, int x, int y) { base.Draw(batcher, x, y); batcher.Draw2D(_line, x + 30, y + 50, 260, 1, ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, x + 95, y + 50, 1, 200, ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, x + 245, y + 50, 1, 200, ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); batcher.Draw2D(_line, x + 30, y + 250, 260, 1, ShaderHuesTraslator.GetHueVector(0, false, .5f, false)); if (_edge == null) { _edge = new Texture2D(batcher.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); _edge.SetData(new Color[] { Color.Gray }); } batcher.DrawRectangle(_edge, x, y, Width, Height, Vector3.Zero); return(true); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { if (IsDisposed) { return(false); } return(batcher.Draw2D(Texture, position, ShaderHuesTraslator.GetHueVector(Item.Hue & 0x3FFF, _isPartialHue, Alpha, false))); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { if (IsDisposed) { return(false); } return(batcher.Draw2D(Texture, position, ShaderHuesTraslator.GetHueVector(Item.Hue & 0x3FFF, TileData.IsPartialHue(Item.ItemData.Flags), _isTransparent ? .5f : 0, false))); }
public override bool Draw(Batcher2D batcher, int x, int y) { if (IsDisposed) { return(false); } return(batcher.Draw2D(Texture, x, y, ShaderHuesTraslator.GetHueVector(Item.Hue & 0x3FFF, _isPartialHue, Alpha, false))); }
public override bool Draw(Batcher2D batcher, int x, int y) { Vector3 hue = Vector3.Zero; ShaderHuesTraslator.GetHueVector(ref hue, Hue, _isPartial, 0); batcher.Draw2D(Texture, x, y, hue); return(base.Draw(batcher, x, y)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { _rect.X = position.X; _rect.Y = position.Y; _rect.Width = Width; _rect.Height = Height; batcher.Draw2D(_scene.ViewportTexture, _rect, Vector3.Zero); return(base.Draw(batcher, position, hue)); }
public override bool Draw(Batcher2D batcher, int x, int y) { if (IsDisposed) { return(false); } batcher.Draw2D(Texture, x, y, ShaderHuesTraslator.GetHueVector(Hue, IsPartialHue, Alpha, true)); return(base.Draw(batcher, x, y)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { if (IsDisposed) { return(false); } batcher.Draw2D(Texture, position, ShaderHuesTraslator.GetHueVector(Hue, IsPartialHue, Alpha, true)); return(base.Draw(batcher, position, hue)); }
public override bool Draw(Batcher2D batcher, int x, int y) { if (IsDisposed) { return(false); } Vector3 hue = Vector3.Zero; ShaderHuesTraslator.GetHueVector(ref hue, Item.Hue & 0x3FFF, _isPartialHue, Alpha); return(batcher.Draw2D(Texture, x, y, hue)); }
public override bool Draw(Batcher2D batcher, int x, int y) { int centerWidth = Width - _frame[0].Width - _frame[2].Width; int centerHeight = Height - _frame[0].Height - _frame[6].Height; int line2Y = y + _frame[0].Height; int line3Y = y + Height - _frame[6].Height; // top row batcher.Draw2D(_frame[0], x, y, Vector3.Zero); batcher.Draw2DTiled(_frame[1], x + _frame[0].Width, y, centerWidth, _frame[0].Height, Vector3.Zero); batcher.Draw2D(_frame[2], x + Width - _frame[2].Width, y, Vector3.Zero); // middle batcher.Draw2DTiled(_frame[3], x, line2Y, _frame[3].Width, centerHeight, Vector3.Zero); batcher.Draw2DTiled(_frame[4], x + _frame[3].Width, line2Y, centerWidth, centerHeight, Vector3.Zero); batcher.Draw2DTiled(_frame[5], x + Width - _frame[5].Width, line2Y, _frame[5].Width, centerHeight, Vector3.Zero); // bottom batcher.Draw2D(_frame[6], x, line3Y, Vector3.Zero); batcher.Draw2DTiled(_frame[7], x + _frame[6].Width, line3Y, centerWidth, _frame[6].Height, Vector3.Zero); batcher.Draw2D(_frame[8], x + Width - _frame[8].Width, line3Y, Vector3.Zero); return(base.Draw(batcher, x, y)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { int centerWidth = Width - _frame[0].Width - _frame[2].Width; int centerHeight = Height - _frame[0].Height - _frame[6].Height; int line2Y = position.Y + _frame[0].Height; int line3Y = position.Y + Height - _frame[6].Height; // top row batcher.Draw2D(_frame[0], position, Vector3.Zero); batcher.Draw2DTiled(_frame[1], new Rectangle(position.X + _frame[0].Width, position.Y, centerWidth, _frame[0].Height), Vector3.Zero); batcher.Draw2D(_frame[2], new Point(position.X + Width - _frame[2].Width, position.Y), Vector3.Zero); // middle batcher.Draw2DTiled(_frame[3], new Rectangle(position.X, line2Y, _frame[3].Width, centerHeight), Vector3.Zero); batcher.Draw2DTiled(_frame[4], new Rectangle(position.X + _frame[3].Width, line2Y, centerWidth, centerHeight), Vector3.Zero); batcher.Draw2DTiled(_frame[5], new Rectangle(position.X + Width - _frame[5].Width, line2Y, _frame[5].Width, centerHeight), Vector3.Zero); // bottom batcher.Draw2D(_frame[6], new Point(position.X, line3Y), Vector3.Zero); batcher.Draw2DTiled(_frame[7], new Rectangle(position.X + _frame[6].Width, line3Y, centerWidth, _frame[6].Height), Vector3.Zero); batcher.Draw2D(_frame[8], new Point(position.X + Width - _frame[8].Width, line3Y), Vector3.Zero); return(base.Draw(batcher, position, hue)); }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { //batcher.SetBlendState(_checkerBlend.Value); //batcher.SetStencil(_checkerStencil.Value); //batcher.Draw2D(TransparentTexture, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero /*ShaderHuesTraslator.GetHueVector(0, false, 0.5f, false)*/); //batcher.SetBlendState(null); //batcher.SetStencil(null); //return true; return(batcher.Draw2D(TransparentTexture, new Rectangle(position.X, position.Y, Width, Height), ShaderHuesTraslator.GetHueVector(0, false, .5f, false))); }
public void Draw(Batcher2D batcher, int x, int y) { if (_texture != null) { X = x - Width / 2; Y = y - Height / 2; batcher.SetBlendState(_checkerBlend.Value); batcher.SetStencil(_stencil.Value); batcher.Draw2D(_texture, X, Y, new Vector3(20, 1, 0)); batcher.SetBlendState(null); batcher.SetStencil(null); } }
public void Draw(Batcher2D batcher, int x, int y) { if (_texture != null) { X = x - Width / 2; Y = y - Height / 2; //batcher.GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer | ClearOptions.Stencil, new Vector4(0, 0, 0, 1), 0, 0); batcher.Begin(); batcher.SetStencil(_stencil.Value); //batcher.SetBlendState(_checkerBlend.Value); BlendState.AlphaBlend.ColorWriteChannels = ColorWriteChannels.Alpha; batcher.Draw2D(_texture, X, Y, Vector3.Zero); BlendState.AlphaBlend.ColorWriteChannels = ColorWriteChannels.All; //batcher.SetBlendState(null); batcher.SetStencil(null); batcher.End(); } }
public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null) { Vector3 huev = ShaderHuesTraslator.GetHueVector(MouseIsOver && HighlightOnMouseOver ? 0x0035 : Item.Hue, Item.ItemData.IsPartialHue, 0, false); return(batcher.Draw2D(Texture, new Rectangle(position.X, position.Y, Width, Height), new Rectangle(_point.X, _point.Y, _originalSize.X, _originalSize.Y), huev)); }