SpriteBase Class Reference

Base class for single sprite nodes. More...

Inheritance diagram for SpriteBase:
Node SpriteTile SpriteUV

List of all members.

Public Member Functions

abstract Vector2 CalcSizeInPixels ()
 Return the dimensions of this sprite in pixels.
 SpriteBase ()
 SpriteBase constructor.
 SpriteBase (TextureInfo texture_info)
 SpriteBase constructor.
override void Draw ()
 The draw function (expensive, standalone draw).
override bool GetlContentLocalBounds (ref Bounds2 bounds)
 The content local bounds is the smallest Bounds2 containing this sprite's Quad, and Quad itself (the sprite rectangle) if there is no rotation.
Bounds2 GetlContentLocalBounds ()
 The content local bounds is the smallest Bounds2 containing this sprite's Quad, and Quad itself (the sprite rectangle) if there is no rotation.
void MakeFullScreen ()
 Stretch sprite Quad so that it covers the entire screen.
void CenterSprite ()
 Translate sprite geometry so that center of the sprite becomes aligned with the position of the Node.
void CenterSprite (Vector2 new_center)
 Modify the center of the sprite geometry.

Public Attributes

TRS Quad = TRS.Quad0_1
 Sprite geometry in the node's local space.
bool FlipU = false
 If true, the sprite UV are flipped horizontally.
bool FlipV = false
 If true, the sprite UV are flipped vertically.
Vector4 Color = Colors.White
 The sprite color.
BlendMode BlendMode = BlendMode.Normal
 The blend mode.
TextureInfo TextureInfo
 This is used only if the Sprite is drawn standalone (not in a SpriteList).
SpriteRenderer.ISpriteShader Shader = (SpriteRenderer.ISpriteShader)Director.Instance.SpriteRenderer.DefaultShader
 The shader.

Detailed Description

Base class for single sprite nodes.

This is an abstract class.


Member Function Documentation

void CenterSprite ( Vector2  new_center)

Modify the center of the sprite geometry.

Parameters:
new_centerThe new center, specified in Node local coordinates. You can pass constants defined under TRS.Local for conveniency.
void MakeFullScreen ( )

Stretch sprite Quad so that it covers the entire screen.

The scene needs to have been set/started, since it uses CurrentScene.Camera.


Member Data Documentation

TRS Quad = TRS.Quad0_1

Sprite geometry in the node's local space.

A TRS defines an oriented rectangle.

This is used only if the Sprite is drawn standalone (not in a SpriteList).

If Sprite is used in a SpriteList, then the SpriteList's TextureInfo is used.