Search Results for

    Show / Hide Table of Contents

    Class GrassyAutoTile

    A grassy auto-tile is a Tile that automatically displays a transition from itself to neighboring grass tiles. This class is used by dirt, paths and grass tiles to create a smooth transition between tiles.

    Inheritance
    System.Object
    Tile
    GrassyAutoTile
    Implements
    IPricedObject
    Inherited Members
    Tile.Tiles
    Tile.Width
    Tile.Height
    Tile.ReferencePrice
    Tile.BaseName
    Tile.Name
    Tile.Price
    Tile.ColorSchemes
    Tile.Colors
    Tile.CanBuy
    Tile.PathCostModifier
    Tile.Natural
    Tile.Icon
    Tile.DefaultColors
    Tile.TextureRegions
    Tile.DrawUi(Element, SpriteBatch, Single)
    Tile.GetPrice()
    Tile.GetVariationTexture(Direction2, Point)
    Tile.Register(String, Int32, TextureRegion, ColorScheme[], Single, Boolean, Boolean, TextureRegion, Func<Direction2, TextureRegion>, Int32[], Type)
    Tile.Register(String, Int32, TextureRegion[], ColorScheme[], Single, Boolean, Boolean, TextureRegion, Func<Direction2, TextureRegion[]>, Int32[], Type)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: TinyLife.World
    Assembly: Tiny Life.dll
    Syntax
    public class GrassyAutoTile : Tile, IPricedObject

    Constructors

    GrassyAutoTile(String, String, Int32, Dictionary<Direction2, TextureRegion[]>, ColorScheme[], Int32[], Boolean, Single, Boolean, TextureRegion, Int32[])

    Creates a new tile with the given settings. To create an instance of a custom tile class, use Register(String, Int32, TextureRegion, ColorScheme[], Single, Boolean, Boolean, TextureRegion, Func<Direction2, TextureRegion>, Int32[], Type).

    Declaration
    protected GrassyAutoTile(string baseName, string name, int price, Dictionary<Direction2, TextureRegion[]> textureRegions, ColorScheme[] colorSchemes, int[] colors, bool canBuy, float pathCostModifier, bool natural, TextureRegion icon, int[] defaultColors)
    Parameters
    Type Name Description
    System.String baseName
    System.String name
    System.Int32 price
    System.Collections.Generic.Dictionary<MLEM.Misc.Direction2, MLEM.Textures.TextureRegion[]> textureRegions
    ColorScheme[] colorSchemes
    System.Int32[] colors
    System.Boolean canBuy
    System.Single pathCostModifier
    System.Boolean natural
    MLEM.Textures.TextureRegion icon
    System.Int32[] defaultColors

    Methods

    Draw(Object, Map, Point, Vector2, Single, Single, ICollection<StaticSpriteBatch.Item>)

    Draws this tile at the given position in the world using a or MLEM.Graphics.StaticSpriteBatch

    Declaration
    public override void Draw(object batch, Map map, Point pos, Vector2 drawPos, float depth, float scale, ICollection<StaticSpriteBatch.Item> items = null)
    Parameters
    Type Name Description
    System.Object batch

    The sprite batch to use for drawing, which can either be a or a MLEM.Graphics.StaticSpriteBatch.

    Map map

    The map that the tile is on.

    Point pos

    The position that the tile is on.

    Vector2 drawPos

    The position, in screen space, to draw at.

    System.Single depth

    The depth to use for drawing.

    System.Single scale

    The scale to draw the tile with.

    System.Collections.Generic.ICollection<MLEM.Graphics.StaticSpriteBatch.Item> items

    The MLEM.Graphics.StaticSpriteBatch.Item collection that added items can optionally be added to.

    Overrides
    Tile.Draw(Object, Map, Point, Vector2, Single, Single, ICollection<StaticSpriteBatch.Item>)

    OnNeighborChanged(Map, Point, Point)

    A method that is called when a neighboring Tile on the Map changes. This method does nothing by default, but is overriden by GrassyAutoTile to notify neighboring tiles of changes.

    Declaration
    public override void OnNeighborChanged(Map map, Point pos, Point neighbor)
    Parameters
    Type Name Description
    Map map

    The map that the tile is on.

    Point pos

    The position that the tile is on.

    Point neighbor

    The position of the tile that changed.

    Overrides
    Tile.OnNeighborChanged(Map, Point, Point)

    Implements

    IPricedObject

    Extension Methods

    Extensions.JsonCopy<T>(T)
    ☀
    ☾
    In This Article
    Back to top
    © 2021-2022 Ellpeck – Impressum – Privacy – Status
    ☀
    ☾