C# Class Nez.Sprites.Sprite

the most basic and common Renderable. Renders a Subtexture/Texture.
Inheritance: RenderableComponent
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Свойство Type Description
spriteEffects SpriteEffects

Protected Properties

Свойство Type Description
_origin Microsoft.Xna.Framework.Vector2
_subtexture Nez.Textures.Subtexture

Méthodes publiques

Méthode Description
Sprite ( ) : Nez.Textures
Sprite ( Subtexture subtexture ) : Nez.Textures
Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Nez.Textures
drawOutline ( Graphics graphics, Camera camera, Microsoft.Xna.Framework.Color outlineColor, int offset = 1 ) : void
drawOutline ( Graphics graphics, Camera camera, int offset = 1 ) : void

Draws the Renderable with an outline. Note that this should be called on disabled Renderables since they shouldnt take part in default rendering if they need an ouline.

render ( Graphics graphics, Camera camera ) : void
setOrigin ( Vector2 origin ) : Sprite

sets the origin for the Renderable

setOriginNormalized ( Vector2 value ) : Sprite

helper for setting the origin in normalized fashion (0-1 for x and y)

setSubtexture ( Subtexture subtexture ) : Sprite

sets the Subtexture and updates the origin of the Sprite to match Subtexture.origin. If for whatever reason you need an origin different from the Subtexture either clone it or set the origin AFTER setting the Subtexture here.

Method Details

Sprite() public méthode

public Sprite ( ) : Nez.Textures
Résultat Nez.Textures

Sprite() public méthode

public Sprite ( Subtexture subtexture ) : Nez.Textures
subtexture Nez.Textures.Subtexture
Résultat Nez.Textures

Sprite() public méthode

public Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Nez.Textures
texture Microsoft.Xna.Framework.Graphics.Texture2D
Résultat Nez.Textures

drawOutline() public méthode

public drawOutline ( Graphics graphics, Camera camera, Microsoft.Xna.Framework.Color outlineColor, int offset = 1 ) : void
graphics Graphics
camera Camera
outlineColor Microsoft.Xna.Framework.Color
offset int
Résultat void

drawOutline() public méthode

Draws the Renderable with an outline. Note that this should be called on disabled Renderables since they shouldnt take part in default rendering if they need an ouline.
public drawOutline ( Graphics graphics, Camera camera, int offset = 1 ) : void
graphics Graphics Graphics.
camera Camera Camera.
offset int Offset.
Résultat void

render() public méthode

public render ( Graphics graphics, Camera camera ) : void
graphics Graphics
camera Camera
Résultat void

setOrigin() public méthode

sets the origin for the Renderable
public setOrigin ( Vector2 origin ) : Sprite
origin Microsoft.Xna.Framework.Vector2 Origin.
Résultat Sprite

setOriginNormalized() public méthode

helper for setting the origin in normalized fashion (0-1 for x and y)
public setOriginNormalized ( Vector2 value ) : Sprite
value Microsoft.Xna.Framework.Vector2
Résultat Sprite

setSubtexture() public méthode

sets the Subtexture and updates the origin of the Sprite to match Subtexture.origin. If for whatever reason you need an origin different from the Subtexture either clone it or set the origin AFTER setting the Subtexture here.
public setSubtexture ( Subtexture subtexture ) : Sprite
subtexture Nez.Textures.Subtexture Subtexture.
Résultat Sprite

Property Details

_origin protected_oe property

protected Vector2,Microsoft.Xna.Framework _origin
Résultat Microsoft.Xna.Framework.Vector2

_subtexture protected_oe property

protected Subtexture,Nez.Textures _subtexture
Résultat Nez.Textures.Subtexture

spriteEffects public_oe property

Batchers passed along to the Batcher when rendering. flipX/flipY are helpers for setting this.
public SpriteEffects spriteEffects
Résultat SpriteEffects