RawSpriteTileList Class Reference

Draw sprites in batch to reduce number of draw calls, state setup etc. More...

Inheritance diagram for RawSpriteTileList:
Node

List of all members.

Public Member Functions

 RawSpriteTileList (TextureInfo texture_info)
 RawSpriteTileList constructor.
override void Draw ()
 The draw function, draws all sprites in Sprites list.
Vector2 CalcSizeInPixels ()
 Based on the tile size and texture dimensions, return the corresponding size in pixels.

Public Attributes

List< RawSpriteTileSprites = new List< RawSpriteTile >()
 The list of RawSpriteTile objects to render.
Vector4 Color = Colors.White
 The color that will be used for all sprites in the Children list.
BlendMode BlendMode = BlendMode.Normal
 The blend mode that will be used for all sprites in the Children list.
TextureInfo TextureInfo
 The TextureInfo object that will be used for all sprites in the Children list.
SpriteRenderer.ISpriteShader Shader = (SpriteRenderer.ISpriteShader)Director.Instance.SpriteRenderer.DefaultShader
 The shader that will be used for all sprites in the Children list.

Detailed Description

Draw sprites in batch to reduce number of draw calls, state setup etc.

Unlike SpriteList, instead of holding a list of Node objects, this holds a list of RawSpriteTile, which is more lightweight. In effect this is a thin wrap of SpriteRenderer, usable as a Node.


Constructor & Destructor Documentation

RawSpriteTileList ( TextureInfo  texture_info)

RawSpriteTileList constructor.

TextureInfo must be specified in constructor since there is no default for it.


Member Function Documentation

Vector2 CalcSizeInPixels ( )

Based on the tile size and texture dimensions, return the corresponding size in pixels.

For example you might want to do something like bob.Quad.S = bob.CalcSizeInPixels().