public static bool IsPointInStretchedLand(ref UltimaBatcher2D.YOffsets yOffsets, int x, int y) { //y -= 22; x += 22; int testX = TranslatedMousePositionByViewport.X - x; int testY = TranslatedMousePositionByViewport.Y; int y0 = -yOffsets.Top; int y1 = 22 - yOffsets.Left; int y2 = 44 - yOffsets.Bottom; int y3 = 22 - yOffsets.Right; return(testY >= testX * (y1 - y0) / -22 + y + y0 && testY >= testX * (y3 - y0) / 22 + y + y0 && testY <= testX * (y3 - y2) / 22 + y + y2 && testY <= testX * (y1 - y2) / -22 + y + y2); }
protected static void DrawLand ( UltimaBatcher2D batcher, ushort graphic, int x, int y, ref UltimaBatcher2D.YOffsets yOffsets, ref Vector3 nTop, ref Vector3 nRight, ref Vector3 nLeft, ref Vector3 nBottom, Vector3 hue, float depth ) { var texture = TexmapsLoader.Instance.GetLandTexture(TileDataLoader.Instance.LandData[graphic].TexID, out var bounds); if (texture != null) { batcher.DrawStretchedLand ( texture, new Vector2(x, y), bounds, ref yOffsets, ref nTop, ref nRight, ref nLeft, ref nBottom, hue, depth + 0.5f ); } else { DrawStatic ( batcher, graphic, x, y, hue, depth ); } }
protected static void DrawLand ( UltimaBatcher2D batcher, ushort graphic, int x, int y, ref UltimaBatcher2D.YOffsets yOffsets, ref Vector3 nTop, ref Vector3 nRight, ref Vector3 nLeft, ref Vector3 nBottom, ref Vector3 hue ) { UOTexture texture = TexmapsLoader.Instance.GetTexture(TileDataLoader.Instance.LandData[graphic].TexID); if (texture != null) { texture.Ticks = Time.Ticks; batcher.DrawSpriteLand ( texture, x, y, ref yOffsets, ref nTop, ref nRight, ref nLeft, ref nBottom, ref hue ); } else { DrawStatic ( batcher, graphic, x, y, ref hue ); } }