Exemple #1
0
        /// <summary>
        /// Draws a highlight on the tile at the specified location.
        /// Adapted from <see cref="StardewValley.Object.drawPlacementBounds(SpriteBatch, GameLocation)"/>
        /// </summary>
        /// <param name="x">The x position of the tile.</param>
        /// <param name="y">The y position of the tile.</param>
        /// <param name="spriteIndex">Index of the sprite.</param>
        /// <param name="tint">The color to shade the texture with.</param>
        public static void DrawSprite(Vector2 tile, SpriteInfo sprite)
        {
            Vector2 viewportLocation   = new Vector2(Game1.viewport.X, Game1.viewport.Y);
            Vector2 tileScreenLocation = (tile * Game1.tileSize) - viewportLocation;

            Game1.spriteBatch.Draw(
                Game1.mouseCursors,
                tileScreenLocation,
                sprite.spriteBounds,
                sprite.tint, 0.0f, Vector2.Zero,
                Game1.pixelZoom, SpriteEffects.None,
                0.01f);
        }