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.
Implements
Inherited Members
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
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 |
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
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. |