Otter
0.9.8.91
2d Game Development Framework based on SFML.Net
|
Graphic used for loading and rendering a tilemap. Renders tiles using a vertex array. More...
Inherits Otter.Graphic.
Public Member Functions | |
Tilemap (string source, int width, int height, int tileWidth, int tileHeight) | |
Create a new Tilemap using the path of a texture. More... | |
Tilemap (string source, int size, int tileSize) | |
Create a new Tilemap using the path of a texture. More... | |
Tilemap (Texture texture, int width, int height, int tileWidth, int tileHeight) | |
Create a new Tilemap using a Texture. More... | |
Tilemap (Texture texture, int size, int tileSize) | |
Create a new Tilemap using a Texture. More... | |
Tilemap (AtlasTexture texture, int width, int height, int tileWidth, int tileHeight) | |
Create a new Tilemap using an AtlasTexture. More... | |
Tilemap (AtlasTexture texture, int size, int tileSize) | |
Create a new Tilemap using an AtlasTexture. More... | |
Tilemap (int width, int height, int tileWidth, int tileHeight) | |
Create a new Tilemap without any texture. Tiles will be solid colors instead. More... | |
Tilemap (int size, int tileSize) | |
Create a new Tilemap without any texture. Tiles will be solid colors instead. More... | |
TileInfo | SetTile (int tileX, int tileY, Color color, string layer="") |
Set a tile to a specific color. More... | |
TileInfo | SetTile (int tileX, int tileY, Color color, Enum layer) |
Set a tile to a specific color. More... | |
TileInfo | SetTile (int tileX, int tileY, int sourceX, int sourceY, string layer="") |
Set a tile to a specific tile from the source texture. More... | |
TileInfo | SetTile (int tileX, int tileY, int sourceX, int sourceY, Enum layer) |
Set a tile to a specific tile from the source texture. More... | |
TileInfo | SetTile (XmlElement e) |
Load tile data from an XmlElement. More... | |
TileInfo | SetTile (int tileX, int tileY, int tileIndex, string layer="") |
Set a tile on the Tilemap to a specific tile. More... | |
TileInfo | SetTile (int tileX, int tileY, int tileIndex, Enum layer) |
Set a tile on the Tilemap to a specific tile. More... | |
TileInfo | SetTile (int tileX, int tileY, bool flipX, bool flipY) |
Set a tile on the Tilemap to be flipped horizontally and/or vertically. More... | |
void | SetRect (int tileX, int tileY, int tileWidth, int tileHeight, Color color, string layer="") |
Set a rectangle area of tiles to a defined color. More... | |
void | SetRect (int tileX, int tileY, int tileWidth, int tileHeight, Color color, Enum layer) |
Set a rectangle area of tiles to a defined color. More... | |
void | SetRect (int tileX, int tileY, int tileWidth, int tileHeight, int sourceX, int sourceY, string layer="") |
Set a rectangle of tiles to a tile defined by texture coordinates. More... | |
void | SetRect (int tileX, int tileY, int tileWidth, int tileHeight, int sourceX, int sourceY, Enum layer) |
Set a rectangle of tiles to a tile defined by texture coordinates. More... | |
void | SetRect (int tileX, int tileY, int tileWidth, int tileHeight, int tileIndex, string layer="") |
Set a rectangle of tiles to a tile defined by an index. More... | |
void | SetRect (int tileX, int tileY, int tileWidth, int tileHeight, int tileIndex, Enum layer) |
Set a rectangle of tiles to a tile defined by an index. More... | |
void | SetLayer (int tileIndex, string layer="") |
Set all tiles of a specific layer. More... | |
void | SetLayer (int sourceX, int sourceY, string layer="") |
Set all tiles of a specific layer. More... | |
void | SetLayer (Color color, string layer="") |
Set all tiles of a specific layer. More... | |
void | SetLayer (int tileIndex, Enum layer) |
Set all tiles of a specific layer. More... | |
void | SetLayer (int sourceX, int sourceY, Enum layer) |
Set all tiles of a specific layer. More... | |
void | SetLayer (Color color, Enum layer) |
Set all tiles of a specific layer. More... | |
TileInfo | GetTile (int tileX, int tileY, string layer="") |
Get the TileInfo of a specific tile on the tilemap. More... | |
TileInfo | GetTile (int tileX, int tileY, Enum layer) |
Get the TileInfo of a specific tile on the tilemap. More... | |
void | LoadGrid (GridCollider grid, Color color, string layer="") |
Load tiles in from a GridCollider. More... | |
void | SetAutoTileData (string tileData) |
Assign the tile data to use for LoadGridAutoTile. More... | |
void | LoadGridAutoTile (GridCollider grid, string layer="") |
Load tiles in from a GridCollider and choose tiles based on the shape of the grid. More... | |
void | LoadGrid (GridCollider grid, Color color, Enum layer) |
Load tiles in from a GridCollider. More... | |
string | LayerName (int layer) |
Get the layer name for a specific layer on the tilemap. More... | |
int | LayerDepth (string layer) |
Get the layer depth of a layer on the tilemap by name. More... | |
int | LayerDepth (Enum layer) |
Get the layer depth of a layer on the tilemap by enum value. More... | |
void | LoadString (string source, Color color=null, char empty= '0', char filled= '1', string layer="") |
Load the tilemap with a color based on a string. More... | |
void | LoadString (string source, Color color, char empty, char filled, Enum layer) |
Load the tilemap with a color based on a string. More... | |
void | LoadCSV (string str, char columnSep= ',', char rowSep= '\n', string layer="") |
Load the tilemap from a CSV formatted string. More... | |
void | LoadCSV (string str, char columnSep, char rowSep, Enum layer) |
Load the tilemap from a CSV formatted string. More... | |
TileInfo | ClearTile (int tileX, int tileY, string layer="") |
Remove a tile from the tilemap. More... | |
TileInfo | ClearTile (int tileX, int tileY, Enum layer) |
Remove a tile from the tilemap. More... | |
void | ClearLayer (string layer="") |
Clear all tiles on a specific layer. More... | |
void | ClearLayer (Enum layer) |
Clear all tiles on a specific layer. More... | |
void | ClearAll () |
Clear all tiles on all layers. More... | |
void | ClearRect (int tileX, int tileY, int tileWidth, int tileHeight, string layer="") |
Clear all tiles inside a specified rectangle. More... | |
int | AddLayer (string name, int depth=0) |
Add a new layer to the Tilemap. More... | |
int | AddLayer (Enum name, int depth=0) |
Add a new layer to the Tilemap. More... | |
void | RemoveLayer (string name) |
Remove a layer from the Tilemap and delete that layer's tiles. More... | |
void | RemoveLayer (Enum name) |
Remove a layer from the Tilemap and delete that layer's tiles. More... | |
bool | LayerExists (string name) |
Check if a layer exists. More... | |
bool | LayerExists (Enum name) |
Check if a layer exists. More... | |
void | MergeTilemap (Tilemap other, string layerPrefix="", int layerOffset=-1) |
Merges another tilemap into this one. More... | |
List< TileInfo > | GetTiles (string layerName) |
Get the list of tiles on a specific layer. More... | |
List< TileInfo > | GetTiles (int layerDepth) |
Get the list of tiles on a specific layer. More... | |
List< TileInfo > | GetTiles (Enum layerName) |
Get the list of tiles on a specific layer. More... | |
int | GetTileIndex (TileInfo tile) |
Get the index of a specific tile on the source Texture. More... | |
Public Member Functions inherited from Otter.Graphic | |
Transformation | AddTransform (Transformation transform) |
Transformation | AddTransform (Vector2 translation, Vector2 scale, Vector2 origin, float rotation) |
Transformation | AddTransform () |
Transformation | RemoveTransformation (Transformation transform) |
Transformation | PopTransformation () |
virtual void | ClearShader () |
Removes the shader from the graphic. More... | |
void | SetPosition (float x, float y) |
Set the position of the Graphic. More... | |
void | SetPosition (Graphic g, float offsetX=0, float offsetY=0) |
Set the position of the Graphic. More... | |
void | SetPosition (Vector2 xy) |
Set the position of the Graphic. More... | |
void | SetOrigin (float x, float y) |
Set the origin of the Graphic. More... | |
void | SetOrigin (Vector2 xy) |
Set the origin of the Graphic. More... | |
void | SetTexture (string path) |
Set the Texture that the Graphic is using (if it is using one.) More... | |
void | SetTexture (Texture texture) |
Set the Texture that the Graphic is using (if it is using one.) More... | |
void | SetTexture (AtlasTexture atlasTexture) |
Set the Texture that the Graphic is using (if it is using one.) More... | |
virtual void | Update () |
Update the graphic. More... | |
virtual void | CenterOrigin () |
Centers the graphic origin. More... | |
virtual void | CenterOriginZero () |
Centers the graphic origin while retaining its relative position. More... | |
virtual void | Render (float x=0, float y=0) |
Draws the graphic. More... | |
Public Attributes | |
bool | UsePositions |
Determines if the X and Y positions of tiles are interpreted as pixels or tile coords. More... | |
string | DefaultLayerName = "base" |
The default layer name to use. More... | |
Public Attributes inherited from Otter.Graphic | |
List< Transformation > | Transforms = new List<Transformation>() { new Transformation() } |
bool | Relative = true |
Determines if the Graphic is rendered relative to its Entity. More... | |
bool | Visible = true |
Determines if the Graphic will render. More... | |
float | ScrollX = 1 |
The scroll factor for the x position. Used for parallax like effects. Values lower than 1 will scroll slower than the camera (appear to be further away) and values higher than 1 will scroll faster than the camera (appear to be closer.) More... | |
float | ScrollY = 1 |
The scroll factor for the y position. Used for parallax like effects. Values lower than 1 will scroll slower than the camera (appear to be further away) and values higher than 1 will scroll faster than the camera (appear to be closer.) More... | |
float | ShakeX |
The horizontal amount to randomly offset the graphic by each frame. More... | |
float | ShakeY |
The vertial amount to randomly offset the graphic by each frame. More... | |
Rectangle | TextureRegion |
The region to render the Texture with. More... | |
Rectangle | AtlasRegion |
The Rectangle to render an AtlasTexture with. More... | |
Shader | Shader |
The shader to be applied to this graphic. More... | |
string | Name = "Graphic" |
The name of the graphic. More... | |
BlendMode | Blend = BlendMode.Alpha |
The blend mode to be applied to this graphic. More... | |
bool | RepeatX |
Determines if the image should be rendered multiple times horizontally. More... | |
bool | RepeatY |
Determines if the image should be rendered multiple times vertically. More... | |
Protected Member Functions | |
override void | UpdateDrawable () |
Updates the internal SFML data for rendering. More... | |
Protected Member Functions inherited from Otter.Graphic | |
void | Append (float x, float y, Color color, float u, float v) |
void | Append (float x, float y, Color color=null) |
virtual void | TextureChanged () |
virtual void | SFMLRender (Drawable drawable, float x=0, float y=0) |
Properties | |
int | TileWidth [get, set] |
The width in pixels of each tile. More... | |
int | TileHeight [get, set] |
The height in pixels of each tile. More... | |
int | TileRows [get, set] |
The number of rows in the entire tilemap. More... | |
int | TileColumns [get, set] |
The number of columsn in the entire tilemap. More... | |
SortedDictionary< int, List < TileInfo > > | TileLayers [get, set] |
The tile layers to render. More... | |
Properties inherited from Otter.Graphic | |
Transformation | Transform [get] |
float | X [get, set] |
The X position of the Graphic. More... | |
float | Y [get, set] |
The Y position of the Graphic. More... | |
float | ScaleX [get, set] |
The horizontal scale of the graphic. Used in the final transformation. More... | |
float | ScaleY [get, set] |
The vertical scale of the graphic. Used in the final transformation. More... | |
float | Angle [get, set] |
The angle of rotation of the graphic. Used in the final transformation. More... | |
float | OriginX [get, set] |
The X origin point to scale and rotate the graphic with. Used in the final transformation. More... | |
float | OriginY [get, set] |
The Y origin point to scale and rotate the graphic with. Used in the final transformation. More... | |
Color | Color [get, set] |
The base color of the Graphic. Multiplies the vertices of the graphic by this color. More... | |
virtual Texture | Texture [get, set] |
The texture that the graphic is using. More... | |
float | Alpha [get, set] |
The base transparency of the graphic. A shortcut to access the base color's Alpha. More... | |
int | Width [get, set] |
The width of the Graphic. More... | |
int | Height [get, set] |
The height of the Graphic. More... | |
float | ScaledWidth [get, set] |
The width in pixels of the image after applying the X scale. More... | |
float | ScaledHeight [get, set] |
The height in pixels of the image after applying the Y scale. More... | |
virtual bool | Smooth [get, set] |
Smooth the texture of a sprite image while scaling it. More... | |
float | Scroll [get, set] |
Set both ScrollX and ScrollY. More... | |
float | HalfWidth [get] |
Half of the width. More... | |
float | HalfHeight [get] |
Half of the height. More... | |
float | Scale [set] |
Sets both the ScaleX and ScaleY at the same time. More... | |
bool | Repeat [set] |
Sets both RepeatX and RepeatY at the same time. More... | |
float | Shake [set] |
A shortcut to set both ShakeX and ShakeY. More... | |
float | Left [get] |
The X position of the left side of the Graphic. More... | |
float | Top [get] |
The Y position of the top of the Graphic. More... | |
float | Right [get] |
The X position of the right side of the Graphic. More... | |
float | Bottom [get] |
The Y position of the bottom of the Graphic. More... | |
int | TextureLeft [get] |
The X position of the left of the Texture. More... | |
int | TextureRight [get] |
The X position of the right of the Texture. More... | |
int | TextureTop [get] |
The Y position of the top of the Texture. More... | |
int | TextureBottom [get] |
The Y position of the bottom of the Texture. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Otter.Graphic | |
VertexArray | SFMLVertices = new VertexArray(PrimitiveType.Quads) |
Drawable | SFMLDrawable |
float | RepeatSizeX |
bool | roundRendering = true |
bool | Dynamic |
If true the graphic will always update its drawable. More... | |
Graphic used for loading and rendering a tilemap. Renders tiles using a vertex array.
Otter.Tilemap.Tilemap | ( | string | source, |
int | width, | ||
int | height, | ||
int | tileWidth, | ||
int | tileHeight | ||
) |
Otter.Tilemap.Tilemap | ( | string | source, |
int | size, | ||
int | tileSize | ||
) |
Otter.Tilemap.Tilemap | ( | Texture | texture, |
int | width, | ||
int | height, | ||
int | tileWidth, | ||
int | tileHeight | ||
) |
Otter.Tilemap.Tilemap | ( | Texture | texture, |
int | size, | ||
int | tileSize | ||
) |
Otter.Tilemap.Tilemap | ( | AtlasTexture | texture, |
int | width, | ||
int | height, | ||
int | tileWidth, | ||
int | tileHeight | ||
) |
Create a new Tilemap using an AtlasTexture.
texture | The AtlasTexture to use. |
width | The width of the Tilemap in pixels. |
height | The height of the Tilemap in pixels. |
tileWidth | The width of each tile in pixels. |
tileHeight | The height of each tile in pixels. |
Otter.Tilemap.Tilemap | ( | AtlasTexture | texture, |
int | size, | ||
int | tileSize | ||
) |
Create a new Tilemap using an AtlasTexture.
texture | The AtlasTexture to use. |
size | The width and height of the Tilemap in pixels. |
tileSize | The width and height of each tile in pixels. |
Otter.Tilemap.Tilemap | ( | int | width, |
int | height, | ||
int | tileWidth, | ||
int | tileHeight | ||
) |
Otter.Tilemap.Tilemap | ( | int | size, |
int | tileSize | ||
) |
int Otter.Tilemap.AddLayer | ( | string | name, |
int | depth = 0 |
||
) |
Add a new layer to the Tilemap.
name | The string name of the layer. |
depth | The depth of the tiles. |
int Otter.Tilemap.AddLayer | ( | Enum | name, |
int | depth = 0 |
||
) |
Add a new layer to the Tilemap.
name | The enum value of the layer. |
depth | The depth of the tiles. |
void Otter.Tilemap.ClearAll | ( | ) |
Clear all tiles on all layers.
void Otter.Tilemap.ClearLayer | ( | string | layer = "" | ) |
Clear all tiles on a specific layer.
layer | The string layer name. |
void Otter.Tilemap.ClearLayer | ( | Enum | layer | ) |
Clear all tiles on a specific layer.
layer | The enum value layer. |
void Otter.Tilemap.ClearRect | ( | int | tileX, |
int | tileY, | ||
int | tileWidth, | ||
int | tileHeight, | ||
string | layer = "" |
||
) |
Clear all tiles inside a specified rectangle.
tileX | The X position of the rectangle to clear. |
tileY | The Y position of the rectangle to clear. |
tileWidth | The width of tiles to clear. |
tileHeight | The height of tiles to clear. |
layer | The layer to clear tiles from. |
TileInfo Otter.Tilemap.ClearTile | ( | int | tileX, |
int | tileY, | ||
string | layer = "" |
||
) |
Remove a tile from the tilemap.
tileX | The tile's X position on the map. |
tileY | The tile's Y position on the map. |
layer | The tile's layer. |
TileInfo Otter.Tilemap.ClearTile | ( | int | tileX, |
int | tileY, | ||
Enum | layer | ||
) |
Remove a tile from the tilemap.
tileX | The tile's X position on the map. |
tileY | The tile's Y position on the map. |
layer | The tile's layer. |
TileInfo Otter.Tilemap.GetTile | ( | int | tileX, |
int | tileY, | ||
string | layer = "" |
||
) |
TileInfo Otter.Tilemap.GetTile | ( | int | tileX, |
int | tileY, | ||
Enum | layer | ||
) |
int Otter.Tilemap.GetTileIndex | ( | TileInfo | tile | ) |
Get the index of a specific tile on the source Texture.
tile | The tile to get the index of. |
List<TileInfo> Otter.Tilemap.GetTiles | ( | string | layerName | ) |
Get the list of tiles on a specific layer.
layerName | The name of the layer. |
List<TileInfo> Otter.Tilemap.GetTiles | ( | int | layerDepth | ) |
Get the list of tiles on a specific layer.
layerDepth |
List<TileInfo> Otter.Tilemap.GetTiles | ( | Enum | layerName | ) |
Get the list of tiles on a specific layer.
layerName | The enum value of the layer. |
int Otter.Tilemap.LayerDepth | ( | string | layer | ) |
Get the layer depth of a layer on the tilemap by name.
layer | The string layer name. |
int Otter.Tilemap.LayerDepth | ( | Enum | layer | ) |
Get the layer depth of a layer on the tilemap by enum value.
layer | The enum value layer. |
bool Otter.Tilemap.LayerExists | ( | string | name | ) |
Check if a layer exists.
name | The string name of the layer. |
bool Otter.Tilemap.LayerExists | ( | Enum | name | ) |
Check if a layer exists.
name | The enum value of the layer. |
string Otter.Tilemap.LayerName | ( | int | layer | ) |
Get the layer name for a specific layer on the tilemap.
layer | The layer depth id. |
void Otter.Tilemap.LoadCSV | ( | string | str, |
char | columnSep = ',' , |
||
char | rowSep = '\n' , |
||
string | layer = "" |
||
) |
Load the tilemap from a CSV formatted string.
str | The string data to load. |
columnSep | The character that separates columns in the CSV. |
rowSep | The character that separates rows in the CSV. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.LoadCSV | ( | string | str, |
char | columnSep, | ||
char | rowSep, | ||
Enum | layer | ||
) |
Load the tilemap from a CSV formatted string.
str | The string data to load. |
columnSep | The character that separates columns in the CSV. |
rowSep | The character that separates rows in the CSV. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.LoadGrid | ( | GridCollider | grid, |
Color | color, | ||
string | layer = "" |
||
) |
Load tiles in from a GridCollider.
grid | The GridCollider to reference. |
color | The color to set tiles that are collidable on the grid. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.LoadGrid | ( | GridCollider | grid, |
Color | color, | ||
Enum | layer | ||
) |
Load tiles in from a GridCollider.
grid | The GridCollider to reference. |
color | The color to set tiles that are collidable on the grid. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.LoadGridAutoTile | ( | GridCollider | grid, |
string | layer = "" |
||
) |
Load tiles in from a GridCollider and choose tiles based on the shape of the grid.
grid | The GridCollider to reference. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.LoadString | ( | string | source, |
Color | color = null , |
||
char | empty = '0' , |
||
char | filled = '1' , |
||
string | layer = "" |
||
) |
Load the tilemap with a color based on a string.
source | The string data to load. |
color | The color to fill occupied tiles with. |
empty | The character that represents an empty tile. |
filled | The character that represents a filled tile. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.LoadString | ( | string | source, |
Color | color, | ||
char | empty, | ||
char | filled, | ||
Enum | layer | ||
) |
Load the tilemap with a color based on a string.
source | The string data to load. |
color | The color to fill occupied tiles with. |
empty | The character that represents an empty tile. |
filled | The character that represents a filled tile. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.MergeTilemap | ( | Tilemap | other, |
string | layerPrefix = "" , |
||
int | layerOffset = -1 |
||
) |
Merges another tilemap into this one.
other | The tilemap to merge into this one. |
above | True if the other tilemap's base layer should be above this one's base layer. |
void Otter.Tilemap.RemoveLayer | ( | string | name | ) |
Remove a layer from the Tilemap and delete that layer's tiles.
name | The name of the layer to delete. |
void Otter.Tilemap.RemoveLayer | ( | Enum | name | ) |
Remove a layer from the Tilemap and delete that layer's tiles.
name | The name of the layer to delete. |
void Otter.Tilemap.SetAutoTileData | ( | string | tileData | ) |
Assign the tile data to use for LoadGridAutoTile.
tileData | The tile data file. |
void Otter.Tilemap.SetLayer | ( | int | tileIndex, |
string | layer = "" |
||
) |
Set all tiles of a specific layer.
tileIndex | The index of the tile to change the tiles to. |
layer | The layer to change. |
void Otter.Tilemap.SetLayer | ( | int | sourceX, |
int | sourceY, | ||
string | layer = "" |
||
) |
void Otter.Tilemap.SetLayer | ( | Color | color, |
string | layer = "" |
||
) |
Set all tiles of a specific layer.
color | The color to change the tile to. |
layer | The layer to change. |
void Otter.Tilemap.SetLayer | ( | int | tileIndex, |
Enum | layer | ||
) |
Set all tiles of a specific layer.
tileIndex | The index of the tile to change the tiles to. |
layer | The layer to change. |
void Otter.Tilemap.SetLayer | ( | int | sourceX, |
int | sourceY, | ||
Enum | layer | ||
) |
void Otter.Tilemap.SetLayer | ( | Color | color, |
Enum | layer | ||
) |
Set all tiles of a specific layer.
color | The color to change the tile to. |
layer | The layer to change. |
void Otter.Tilemap.SetRect | ( | int | tileX, |
int | tileY, | ||
int | tileWidth, | ||
int | tileHeight, | ||
Color | color, | ||
string | layer = "" |
||
) |
Set a rectangle area of tiles to a defined color.
tileX | The X position of the tile to change. |
tileY | The Y position of the tile to change. |
tileWidth | The width of tiles to change. |
tileHeight | The height of tiles to change. |
color | The color to change the colors to. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.SetRect | ( | int | tileX, |
int | tileY, | ||
int | tileWidth, | ||
int | tileHeight, | ||
Color | color, | ||
Enum | layer | ||
) |
Set a rectangle area of tiles to a defined color.
tileX | The X position of the tile to change. |
tileY | The Y position of the tile to change. |
tileWidth | The width of tiles to change. |
tileHeight | The height of tiles to change. |
color | The color to change the colors to. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.SetRect | ( | int | tileX, |
int | tileY, | ||
int | tileWidth, | ||
int | tileHeight, | ||
int | sourceX, | ||
int | sourceY, | ||
string | layer = "" |
||
) |
Set a rectangle of tiles to a tile defined by texture coordinates.
tileX | The X position of the rectangle to change. |
tileY | The Y position of the rectangle to change. |
tileWidth | The width of tiles to change. |
tileHeight | The height of tiles to change. |
sourceX | The X position in the source Texture to use to draw the tiles. |
sourceY | The Y position in the source Texture to use to draw the tiles. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.SetRect | ( | int | tileX, |
int | tileY, | ||
int | tileWidth, | ||
int | tileHeight, | ||
int | sourceX, | ||
int | sourceY, | ||
Enum | layer | ||
) |
Set a rectangle of tiles to a tile defined by texture coordinates.
tileX | The X position of the rectangle to change. |
tileY | The Y position of the rectangle to change. |
tileWidth | The width of tiles to change. |
tileHeight | The height of tiles to change. |
sourceX | The X position in the source Texture to use to draw the tiles. |
sourceY | The Y position in the source Texture to use to draw the tiles. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.SetRect | ( | int | tileX, |
int | tileY, | ||
int | tileWidth, | ||
int | tileHeight, | ||
int | tileIndex, | ||
string | layer = "" |
||
) |
Set a rectangle of tiles to a tile defined by an index.
tileX | The X position of the rectangle to change. |
tileY | The Y position of the rectangle to change. |
tileWidth | The width of tiles to change. |
tileHeight | The height of tiles to change. |
tileIndex | The index of the tile to change the tiles to. |
layer | The layer to place the tiles on. |
void Otter.Tilemap.SetRect | ( | int | tileX, |
int | tileY, | ||
int | tileWidth, | ||
int | tileHeight, | ||
int | tileIndex, | ||
Enum | layer | ||
) |
Set a rectangle of tiles to a tile defined by an index.
tileX | The X position of the rectangle to change. |
tileY | The Y position of the rectangle to change. |
tileWidth | The width of tiles to change. |
tileHeight | The height of tiles to change. |
tileIndex | The index of the tile to change the tiles to. |
layer | The layer to place the tiles on. |
Set a tile to a specific color.
tileX | The tile's x position on the map. |
tileY | The tile's y position on the map. |
color | The tile's color. |
layer | The tile's layer. |
Set a tile to a specific color.
tileX | The tile's x position on the map. |
tileY | The tile's y position on the map. |
color | The tile's color. |
layer | The tile's layer. |
TileInfo Otter.Tilemap.SetTile | ( | int | tileX, |
int | tileY, | ||
int | sourceX, | ||
int | sourceY, | ||
string | layer = "" |
||
) |
Set a tile to a specific tile from the source texture.
tileX | The tile's X position on the map. |
tileY | The tile's Y position on the map. |
sourceX | The source X position from the tile map in pixels. |
sourceY | The source Y position from the tile map in pixels. |
layer | The tile's layer. |
TileInfo Otter.Tilemap.SetTile | ( | int | tileX, |
int | tileY, | ||
int | sourceX, | ||
int | sourceY, | ||
Enum | layer | ||
) |
Set a tile to a specific tile from the source texture.
tileX | The tile's X position on the map. |
tileY | The tile's Y position on the map. |
sourceX | The source X position from the tile map in pixels. |
sourceY | The source Y position from the tile map in pixels. |
layer | The tile's layer. |
TileInfo Otter.Tilemap.SetTile | ( | XmlElement | e | ) |
Load tile data from an XmlElement.
e | An XmlElement containing attributes x, y, tx, and ty. |
TileInfo Otter.Tilemap.SetTile | ( | int | tileX, |
int | tileY, | ||
int | tileIndex, | ||
string | layer = "" |
||
) |
TileInfo Otter.Tilemap.SetTile | ( | int | tileX, |
int | tileY, | ||
int | tileIndex, | ||
Enum | layer | ||
) |
TileInfo Otter.Tilemap.SetTile | ( | int | tileX, |
int | tileY, | ||
bool | flipX, | ||
bool | flipY | ||
) |
Set a tile on the Tilemap to be flipped horizontally and/or vertically.
tileX | The X position of the tile to change. |
tileY | The Y position of the tile to change. |
flipX | Whether the tile should be horizontally flipped. |
flipY | Whether the tile should be vertically flipped. |
|
protectedvirtual |
Updates the internal SFML data for rendering.
Reimplemented from Otter.Graphic.
string Otter.Tilemap.DefaultLayerName = "base" |
The default layer name to use.
bool Otter.Tilemap.UsePositions |
Determines if the X and Y positions of tiles are interpreted as pixels or tile coords.
|
getset |
The number of columsn in the entire tilemap.
|
getset |
The height in pixels of each tile.
|
getset |
The tile layers to render.
|
getset |
The number of rows in the entire tilemap.
|
getset |
The width in pixels of each tile.