C# Класс FlatRedBall.TileGraphics.MapDrawableBatch

Наследование: FlatRedBall.PositionedObject, IDrawableBatch
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
mIndices int[]
mIndices short[]
mTexture Microsoft.Xna.Framework.Graphics.Texture2D
mTileset Tileset
mVertices Microsoft.Xna.Framework.Graphics.VertexPositionTexture[]

Private Properties

Свойство Тип Описание
FromReducedLayer MapDrawableBatch
FromReducedLayer MapDrawableBatch
GetRenderingIndexValues void
PrepareRenderingStates Microsoft.Xna.Framework.Graphics.Effect
RegisterName void
VerifySingleTexture void

Открытые методы

Метод Описание
AddTile ( Vector3 bottomLeftPosition, Vector2 dimensions, Vector4 texture ) : int

Adds a tile to the tile map

AddTile ( Vector3 bottomLeftPosition, Vector2 tileDimensions, int textureTopLeftX, int textureTopLeftY, int textureBottomRightX, int textureBottomRightY ) : int

Add a tile to the map

AddTile ( Vector3 bottomLeftPosition, Vector2 dimensions, Vector4 texture ) : void

Adds a tile to the tile map

AddTile ( Vector3 bottomLeftPosition, Vector2 tileDimensions, int textureTopLeftX, int textureTopLeftY, int textureBottomRightX, int textureBottomRightY ) : void

Add a tile to the map

AddToManagers ( ) : void
AddToManagers ( Layer layer ) : void
ApplyDiagonalFlip ( int orderedTileIndex ) : void
Clone ( ) : MapDrawableBatch
Destroy ( ) : void

Don't call this, instead call SpriteManager.RemoveDrawableBatch

Draw ( Camera camera ) : void

Custom drawing technique - sets graphics states and draws the custom shape

FromScnx ( string sceneFileName, string contentManagerName, bool verifySameTexturePerLayer ) : MapDrawableBatch
FromSpriteSaves ( List spriteSaveList, int startingIndex, int count, string contentManagerName, bool verifySameTexturesPerLayer ) : MapDrawableBatch
GetBottomLeftWorldCoordinateForOrderedTile ( int orderedTileIndex, float &x, float &y ) : void
GetFirstAfterX ( VertexPositionTexture list, float xGreaterThan ) : int
GetFirstAfterY ( VertexPositionTexture list, float yGreaterThan ) : int
GetTextureCoordiantesForOrderedTile ( int orderedTileIndex, float &textureX, float &textureY ) : void
MapDrawableBatch ( ) : System
MapDrawableBatch ( int numberOfTiles, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System
MapDrawableBatch ( int numberOfTiles, int textureTileDimensionWidth, int textureTileDimensionHeight, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System

Create and initialize all assets

MergeOntoThis ( IEnumerable mapDrawableBatches ) : void
PaintTile ( int orderedTileIndex, int newTextureId ) : void

Paints a texture on a tile. This method takes the index of the Sprite in the order it was added to the MapDrawableBatch, so it supports any configuration including non-rectangular maps and maps with gaps.

PaintTile ( int row, int column, int newTextureId ) : void

Paints a texture on a tile. This method assumes that the MapDrawableBatch is a perfect recangle with no gaps, and that all tiles have been added left to right, top to bottom.

PaintTileTextureCoordinates ( int orderedTileIndex, float textureXCoordinate, float textureYCoordinate ) : void
Paste ( Sprite sprite, bool setZTo0 ) : int
Paste ( SpriteSave spriteSave, bool setZTo0 ) : int
Paste ( Sprite sprite ) : void
Paste ( SpriteSave spriteSave ) : void
RemoveQuads ( IEnumerable quadIndexes ) : void
RotateTextureCoordinatesCounterclockwise ( int orderedTileIndex ) : void
Update ( ) : void

Here we update our batch - but this batch doesn't need to be updated

Защищенные методы

Метод Описание
InternalInitialize ( ) : void

Приватные методы

Метод Описание
FromReducedLayer ( TMXGlueLib reducedLayerInfo, LayeredTileMap owner, TMXGlueLib rtmi, string contentManagerName ) : MapDrawableBatch
FromReducedLayer ( TMXGlueLib reducedLayerInfo, string contentManagerName, int tileDimensionWidth, int tileDimensionHeight, float quadWidth, float quadHeight ) : MapDrawableBatch
GetRenderingIndexValues ( Camera camera, int &firstVertIndex, int &lastVertIndex, int &indexStart, int &numberOfTriangles ) : void
PrepareRenderingStates ( Camera camera, TextureAddressMode &oldTextureAddressMode ) : Effect
RegisterName ( string name, int tileIndex ) : void
VerifySingleTexture ( List spriteSaveList, int startingIndex, int count ) : void

Описание методов

AddTile() публичный Метод

Adds a tile to the tile map
public AddTile ( Vector3 bottomLeftPosition, Vector2 dimensions, Vector4 texture ) : int
bottomLeftPosition Vector3
dimensions Vector2
texture Vector4 /// 4 points defining the boundaries in the texture for the tile. /// (X = left, Y = right, Z = top, W = bottom) ///
Результат int

AddTile() публичный Метод

Add a tile to the map
public AddTile ( Vector3 bottomLeftPosition, Vector2 tileDimensions, int textureTopLeftX, int textureTopLeftY, int textureBottomRightX, int textureBottomRightY ) : int
bottomLeftPosition Vector3
tileDimensions Vector2
textureTopLeftX int Top left X coordinate in the core texture
textureTopLeftY int Top left Y coordinate in the core texture
textureBottomRightX int Bottom right X coordinate in the core texture
textureBottomRightY int Bottom right Y coordinate in the core texture
Результат int

AddTile() публичный Метод

Adds a tile to the tile map
public AddTile ( Vector3 bottomLeftPosition, Vector2 dimensions, Vector4 texture ) : void
bottomLeftPosition Vector3
dimensions Vector2
texture Vector4 /// 4 points defining the boundaries in the texture for the tile. /// (X = left, Y = right, Z = top, W = bottom) ///
Результат void

AddTile() публичный Метод

Add a tile to the map
public AddTile ( Vector3 bottomLeftPosition, Vector2 tileDimensions, int textureTopLeftX, int textureTopLeftY, int textureBottomRightX, int textureBottomRightY ) : void
bottomLeftPosition Vector3
tileDimensions Vector2
textureTopLeftX int Top left X coordinate in the core texture
textureTopLeftY int Top left Y coordinate in the core texture
textureBottomRightX int Bottom right X coordinate in the core texture
textureBottomRightY int Bottom right Y coordinate in the core texture
Результат void

AddToManagers() публичный Метод

public AddToManagers ( ) : void
Результат void

AddToManagers() публичный Метод

public AddToManagers ( Layer layer ) : void
layer Layer
Результат void

ApplyDiagonalFlip() публичный Метод

public ApplyDiagonalFlip ( int orderedTileIndex ) : void
orderedTileIndex int
Результат void

Clone() публичный Метод

public Clone ( ) : MapDrawableBatch
Результат MapDrawableBatch

Destroy() публичный Метод

Don't call this, instead call SpriteManager.RemoveDrawableBatch
public Destroy ( ) : void
Результат void

Draw() публичный Метод

Custom drawing technique - sets graphics states and draws the custom shape
public Draw ( Camera camera ) : void
camera FlatRedBall.Camera The currently drawing camera
Результат void

FromScnx() публичный статический Метод

public static FromScnx ( string sceneFileName, string contentManagerName, bool verifySameTexturePerLayer ) : MapDrawableBatch
sceneFileName string
contentManagerName string
verifySameTexturePerLayer bool
Результат MapDrawableBatch

FromSpriteSaves() публичный статический Метод

public static FromSpriteSaves ( List spriteSaveList, int startingIndex, int count, string contentManagerName, bool verifySameTexturesPerLayer ) : MapDrawableBatch
spriteSaveList List
startingIndex int
count int
contentManagerName string
verifySameTexturesPerLayer bool
Результат MapDrawableBatch

GetBottomLeftWorldCoordinateForOrderedTile() публичный Метод

public GetBottomLeftWorldCoordinateForOrderedTile ( int orderedTileIndex, float &x, float &y ) : void
orderedTileIndex int
x float
y float
Результат void

GetFirstAfterX() публичный статический Метод

public static GetFirstAfterX ( VertexPositionTexture list, float xGreaterThan ) : int
list Microsoft.Xna.Framework.Graphics.VertexPositionTexture
xGreaterThan float
Результат int

GetFirstAfterY() публичный статический Метод

public static GetFirstAfterY ( VertexPositionTexture list, float yGreaterThan ) : int
list Microsoft.Xna.Framework.Graphics.VertexPositionTexture
yGreaterThan float
Результат int

GetTextureCoordiantesForOrderedTile() публичный Метод

public GetTextureCoordiantesForOrderedTile ( int orderedTileIndex, float &textureX, float &textureY ) : void
orderedTileIndex int
textureX float
textureY float
Результат void

InternalInitialize() защищенный Метод

protected InternalInitialize ( ) : void
Результат void

MapDrawableBatch() публичный Метод

public MapDrawableBatch ( ) : System
Результат System

MapDrawableBatch() публичный Метод

public MapDrawableBatch ( int numberOfTiles, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System
numberOfTiles int
texture Microsoft.Xna.Framework.Graphics.Texture2D
Результат System

MapDrawableBatch() публичный Метод

Create and initialize all assets
public MapDrawableBatch ( int numberOfTiles, int textureTileDimensionWidth, int textureTileDimensionHeight, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System
numberOfTiles int
textureTileDimensionWidth int
textureTileDimensionHeight int
texture Microsoft.Xna.Framework.Graphics.Texture2D
Результат System

MergeOntoThis() публичный Метод

public MergeOntoThis ( IEnumerable mapDrawableBatches ) : void
mapDrawableBatches IEnumerable
Результат void

PaintTile() публичный Метод

Paints a texture on a tile. This method takes the index of the Sprite in the order it was added to the MapDrawableBatch, so it supports any configuration including non-rectangular maps and maps with gaps.
public PaintTile ( int orderedTileIndex, int newTextureId ) : void
orderedTileIndex int The index of the tile to paint - this matches the index of the tile as it was added.
newTextureId int
Результат void

PaintTile() публичный Метод

Paints a texture on a tile. This method assumes that the MapDrawableBatch is a perfect recangle with no gaps, and that all tiles have been added left to right, top to bottom.
public PaintTile ( int row, int column, int newTextureId ) : void
row int The row (y) index, base 0
column int The column (x) index, base 0
newTextureId int The texture ID, which is a left to right, top to bottom index
Результат void

PaintTileTextureCoordinates() публичный Метод

public PaintTileTextureCoordinates ( int orderedTileIndex, float textureXCoordinate, float textureYCoordinate ) : void
orderedTileIndex int
textureXCoordinate float
textureYCoordinate float
Результат void

Paste() публичный Метод

public Paste ( Sprite sprite, bool setZTo0 ) : int
sprite Sprite
setZTo0 bool
Результат int

Paste() публичный Метод

public Paste ( SpriteSave spriteSave, bool setZTo0 ) : int
spriteSave SpriteSave
setZTo0 bool
Результат int

Paste() публичный Метод

public Paste ( Sprite sprite ) : void
sprite Sprite
Результат void

Paste() публичный Метод

public Paste ( SpriteSave spriteSave ) : void
spriteSave SpriteSave
Результат void

RemoveQuads() публичный Метод

public RemoveQuads ( IEnumerable quadIndexes ) : void
quadIndexes IEnumerable
Результат void

RotateTextureCoordinatesCounterclockwise() публичный Метод

public RotateTextureCoordinatesCounterclockwise ( int orderedTileIndex ) : void
orderedTileIndex int
Результат void

Update() публичный Метод

Here we update our batch - but this batch doesn't need to be updated
public Update ( ) : void
Результат void

Описание свойств

mIndices защищенное свойство

The indices to draw the shape
protected int[] mIndices
Результат int[]

mIndices защищенное свойство

The indices to draw the shape
protected short[] mIndices
Результат short[]

mTexture защищенное свойство

protected Texture2D,Microsoft.Xna.Framework.Graphics mTexture
Результат Microsoft.Xna.Framework.Graphics.Texture2D

mTileset защищенное свойство

protected Tileset,FlatRedBall.TileGraphics mTileset
Результат Tileset

mVertices защищенное свойство

The vertices used to draw the map.
Coordinate order is: 3 2 0 1
protected VertexPositionTexture[],Microsoft.Xna.Framework.Graphics mVertices
Результат Microsoft.Xna.Framework.Graphics.VertexPositionTexture[]