Aiv Fast2D  1.0.4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Pages
Public Member Functions | Properties | List of all members
Aiv.Fast2D.Sprite Class Reference
Inheritance diagram for Aiv.Fast2D.Sprite:
Aiv.Fast2D.Mesh Aiv.Fast2D.Mesh Aiv.Fast2D.InstancedSprite

Public Member Functions

 Sprite (float width, float height)
 Sprite class is a Quad (mesh made by two triangles) More...
 
void SetAdditiveTint (int r, int g, int b, int a)
 Color tint added during Draw phase, after base color (or texture) and multiply tint. More...
 
void SetAdditiveTint (float r, float g, float b, float a)
 Color tint added during Draw phase, after base color (or texture) and multiply tint. More...
 
void SetAdditiveTint (Vector4 color)
 Color tint added during Draw phase, after base color (or texture) and multiply tint. More...
 
void SetMultiplyTint (float r, float g, float b, float a)
 Color tint used as multiplier during Draw phase, after base color (or texture). More...
 
void SetMultiplyTint (int r, int g, int b, int a)
 Color tint used as multiplier during Draw phase, after base color (or texture). More...
 
void SetMultiplyTint (Vector4 color)
 Color tint added during Draw phase, after base color (or texture). More...
 
override void DrawColor (Vector4 color)
 Draw the sprite filling it with this color More...
 
override void DrawTexture (Texture tex)
 Draw the whole texture More...
 
void DrawTexture (Texture tex, int xOffset, int yOffset)
 Draw a texture starting at specific offset to the full size of the texture More...
 
void DrawTexture (Texture tex, int xOffset, int yOffset, int width, int height)
 Draw a texture starting at specific offset to a specific size More...
 
override void DrawWireframe (Vector4 color, float tickness=0.02F)
 
 Sprite (float width, float height)
 Sprite class is a Quad (mesh made by two triangles) More...
 
void SetAdditiveTint (int r, int g, int b, int a)
 Color tint added during Draw phase, after base color (or texture) and multiply tint. More...
 
void SetAdditiveTint (float r, float g, float b, float a)
 Color tint added during Draw phase, after base color (or texture) and multiply tint. More...
 
void SetAdditiveTint (Vector4 color)
 Color tint added during Draw phase, after base color (or texture) and multiply tint. More...
 
void SetMultiplyTint (float r, float g, float b, float a)
 Color tint used as multiplier during Draw phase, after base color (or texture). More...
 
void SetMultiplyTint (int r, int g, int b, int a)
 Color tint used as multiplier during Draw phase, after base color (or texture). More...
 
void SetMultiplyTint (Vector4 color)
 Color tint added during Draw phase, after base color (or texture). More...
 
override void DrawColor (Vector4 color)
 Draw the sprite filling it with this color More...
 
override void DrawTexture (Texture tex)
 Draw the whole texture More...
 
void DrawTexture (Texture tex, int xOffset, int yOffset)
 Draw a texture starting at specific offset to the full size of the texture More...
 
void DrawTexture (Texture tex, int xOffset, int yOffset, int width, int height)
 Draw a texture starting at specific offset to a specific size More...
 
override void DrawWireframe (Vector4 color, float tickness=0.02F)
 
- Public Member Functions inherited from Aiv.Fast2D.Mesh
delegate void ShaderSetupHook (Mesh mesh)
 
 Mesh (Shader shader=null, int numberOfAxis=2)
 
void Update ()
 
void UpdateVertex ()
 
void UpdateUV ()
 
void UpdateVertexColor ()
 
void Bind ()
 
virtual void DrawTexture (int textureId)
 
virtual void DrawColor (float r, float g, float b, float a=1)
 Draw the sprite filling it with this color More...
 
void DrawColor (int r, int g, int b, int a=255)
 Draw the sprite filling it with this color More...
 
void DrawWireframe (float r, float g, float b, float a=1, float tickness=0.02f)
 
void DrawWireframe (int r, int g, int b, int a=255, float tickness=0.02f)
 
void Draw (ShaderSetupHook hook=null)
 
void DrawRenderTexture (RenderTexture rt)
 Allow to draw a RenderTexture object. More...
 
void Dispose ()
 

Properties

float Width [get]
 Get the Width of this sprite More...
 
float Height [get]
 Get the Height of this sprite More...
 
bool FlipX [get, set]
 Get / Set the orizontal orientation of this Sprite More...
 
bool FlipY [get, set]
 Get / Set the verical orientation of this Sprite More...
 
- Properties inherited from Aiv.Fast2D.Mesh
float Rotation [get, set]
 
float EulerRotation [get, set]
 
int Instances [get]
 

Additional Inherited Members

- Public Attributes inherited from Aiv.Fast2D.Mesh
float[] v
 
float[] uv
 
float[] vc
 
bool hasVertexColors
 
Shader shader
 
Vector2 position = Vector2.Zero
 
Vector2 scale = Vector2.One
 
Vector2 pivot = Vector2.Zero
 
Camera Camera
 
bool noMatrix
 
- Protected Member Functions inherited from Aiv.Fast2D.Mesh
int NewFloatBuffer (int attribArrayId, int elementSize, float[] data, int divisor=0)
 
void UpdateFloatBuffer (int bufferId, float[] data, int offset=0)
 
virtual void ApplyMatrix ()
 
- Protected Attributes inherited from Aiv.Fast2D.Mesh
ShaderSetupHook shaderSetupHook
 
int numberOfAxis
 
bool requireUseTexture
 
int instances
 

Constructor & Destructor Documentation

Aiv.Fast2D.Sprite.Sprite ( float  width,
float  height 
)
inline

Sprite class is a Quad (mesh made by two triangles)

Parameters
widththe width of the sprite
heightthe height of the sprite
Aiv.Fast2D.Sprite.Sprite ( float  width,
float  height 
)
inline

Sprite class is a Quad (mesh made by two triangles)

Parameters
widththe width of the sprite
heightthe height of the sprite

Member Function Documentation

override void Aiv.Fast2D.Sprite.DrawColor ( Vector4  color)
inlinevirtual

Draw the sprite filling it with this color

Parameters
colorcolor channel as vector of 4 float

Reimplemented from Aiv.Fast2D.Mesh.

override void Aiv.Fast2D.Sprite.DrawColor ( Vector4  color)
inlinevirtual

Draw the sprite filling it with this color

Parameters
colorcolor channel as vector of 4 float

Reimplemented from Aiv.Fast2D.Mesh.

override void Aiv.Fast2D.Sprite.DrawTexture ( Texture  tex)
inlinevirtual

Draw the whole texture

Parameters
texthe texture used as source

Reimplemented from Aiv.Fast2D.Mesh.

override void Aiv.Fast2D.Sprite.DrawTexture ( Texture  tex)
inlinevirtual

Draw the whole texture

Parameters
texthe texture used as source

Reimplemented from Aiv.Fast2D.Mesh.

void Aiv.Fast2D.Sprite.DrawTexture ( Texture  tex,
int  xOffset,
int  yOffset 
)
inline

Draw a texture starting at specific offset to the full size of the texture

Parameters
texthe texture used as source
xOffsetoffset on x axis
yOffsetoffset on y axis
void Aiv.Fast2D.Sprite.DrawTexture ( Texture  tex,
int  xOffset,
int  yOffset 
)
inline

Draw a texture starting at specific offset to the full size of the texture

Parameters
texthe texture used as source
xOffsetoffset on x axis
yOffsetoffset on y axis
void Aiv.Fast2D.Sprite.DrawTexture ( Texture  tex,
int  xOffset,
int  yOffset,
int  width,
int  height 
)
inline

Draw a texture starting at specific offset to a specific size

Passing width and height exceeding Texture.Width and Texture.Height will produce effects based on Texture filter adopted (repeat or clamp)

Parameters
texthe texture used as source
xOffsetoffset on x axis
yOffsetoffset on y axis
widthwidth to take into account
heightheight to take into account
void Aiv.Fast2D.Sprite.DrawTexture ( Texture  tex,
int  xOffset,
int  yOffset,
int  width,
int  height 
)
inline

Draw a texture starting at specific offset to a specific size

Passing width and height exceeding Texture.Width and Texture.Height will produce effects based on Texture filter adopted (repeat or clamp)

Parameters
texthe texture used as source
xOffsetoffset on x axis
yOffsetoffset on y axis
widthwidth to take into account
heightheight to take into account
override void Aiv.Fast2D.Sprite.DrawWireframe ( Vector4  color,
float  tickness = 0.02F 
)
inlinevirtual

Reimplemented from Aiv.Fast2D.Mesh.

override void Aiv.Fast2D.Sprite.DrawWireframe ( Vector4  color,
float  tickness = 0.02F 
)
inlinevirtual

Reimplemented from Aiv.Fast2D.Mesh.

Reimplemented in Aiv.Fast2D.InstancedSprite.

void Aiv.Fast2D.Sprite.SetAdditiveTint ( int  r,
int  g,
int  b,
int  a 
)
inline

Color tint added during Draw phase, after base color (or texture) and multiply tint.

Parameters
rred channel in space [0, 255]
ggreen channel in space [0, 255]
bblue channelin space [0, 255]
aalpha channel in space [0, 255]
void Aiv.Fast2D.Sprite.SetAdditiveTint ( int  r,
int  g,
int  b,
int  a 
)
inline

Color tint added during Draw phase, after base color (or texture) and multiply tint.

Parameters
rred channel in space [0, 255]
ggreen channel in space [0, 255]
bblue channelin space [0, 255]
aalpha channel in space [0, 255]
void Aiv.Fast2D.Sprite.SetAdditiveTint ( float  r,
float  g,
float  b,
float  a 
)
inline

Color tint added during Draw phase, after base color (or texture) and multiply tint.

Parameters
rred channel in space [0.0, 1.0]
ggreen channel in space [0.0, 1.0]
bblue channelin space [0.0, 1.0]
aalpha channel in space [0.0, 1.0]
void Aiv.Fast2D.Sprite.SetAdditiveTint ( float  r,
float  g,
float  b,
float  a 
)
inline

Color tint added during Draw phase, after base color (or texture) and multiply tint.

Parameters
rred channel in space [0.0, 1.0]
ggreen channel in space [0.0, 1.0]
bblue channelin space [0.0, 1.0]
aalpha channel in space [0.0, 1.0]
void Aiv.Fast2D.Sprite.SetAdditiveTint ( Vector4  color)
inline

Color tint added during Draw phase, after base color (or texture) and multiply tint.

Parameters
colorcolor channel as vector of 4 float
void Aiv.Fast2D.Sprite.SetAdditiveTint ( Vector4  color)
inline

Color tint added during Draw phase, after base color (or texture) and multiply tint.

Parameters
colorcolor channel as vector of 4 float
void Aiv.Fast2D.Sprite.SetMultiplyTint ( float  r,
float  g,
float  b,
float  a 
)
inline

Color tint used as multiplier during Draw phase, after base color (or texture).

Parameters
rred channel in space [0.0, 1.0]
ggreen channel in space [0.0, 1.0]
bblue channelin space [0.0, 1.0]
aalpha channel in space [0.0, 1.0]
void Aiv.Fast2D.Sprite.SetMultiplyTint ( float  r,
float  g,
float  b,
float  a 
)
inline

Color tint used as multiplier during Draw phase, after base color (or texture).

Parameters
rred channel in space [0.0, 1.0]
ggreen channel in space [0.0, 1.0]
bblue channelin space [0.0, 1.0]
aalpha channel in space [0.0, 1.0]
void Aiv.Fast2D.Sprite.SetMultiplyTint ( int  r,
int  g,
int  b,
int  a 
)
inline

Color tint used as multiplier during Draw phase, after base color (or texture).

Parameters
rred channel in space [0, 255]
ggreen channel in space [0, 255]
bblue channelin space [0, 255]
aalpha channel in space [0, 255]
void Aiv.Fast2D.Sprite.SetMultiplyTint ( int  r,
int  g,
int  b,
int  a 
)
inline

Color tint used as multiplier during Draw phase, after base color (or texture).

Parameters
rred channel in space [0, 255]
ggreen channel in space [0, 255]
bblue channelin space [0, 255]
aalpha channel in space [0, 255]
void Aiv.Fast2D.Sprite.SetMultiplyTint ( Vector4  color)
inline

Color tint added during Draw phase, after base color (or texture).

Parameters
colorcolor channel as vector of 4 float
void Aiv.Fast2D.Sprite.SetMultiplyTint ( Vector4  color)
inline

Color tint added during Draw phase, after base color (or texture).

Parameters
colorcolor channel as vector of 4 float

Property Documentation

bool Aiv.Fast2D.Sprite.FlipX
getset

Get / Set the orizontal orientation of this Sprite

bool Aiv.Fast2D.Sprite.FlipY
getset

Get / Set the verical orientation of this Sprite

float Aiv.Fast2D.Sprite.Height
get

Get the Height of this sprite

float Aiv.Fast2D.Sprite.Width
get

Get the Width of this sprite


The documentation for this class was generated from the following file: