C# Class Nez.TextureAtlases.TexturePackerAtlas

Datei anzeigen Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
spriteAnimationDetails List>.Dictionary
subtextures List
texture Microsoft.Xna.Framework.Graphics.Texture2D

Public Methods

Method Description
TexturePackerAtlas ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System.Collections.Generic
create ( Microsoft.Xna.Framework.Graphics.Texture2D texture, int regionWidth, int regionHeight, int maxRegionCount = int.MaxValue, int margin, int spacing ) : TexturePackerAtlas
createRegion ( string name, int x, int y, int width, int height, float pivotX = 0.5f, float pivotY = 0.5f ) : Subtexture
getSpriteAnimation ( string animationName ) : SpriteAnimation

returns a SpriteAnimation given an animationName where the animationName is the region's "filename" metadata in the TexturePacker atlas minus the framenumbers at the end

getSubtexture ( int index ) : Subtexture
getSubtexture ( string name ) : Subtexture
removeSubtexture ( int index ) : void
removeSubtexture ( string name ) : void
this ( int index ) : Subtexture
this ( string name ) : Subtexture

Method Details

TexturePackerAtlas() public method

public TexturePackerAtlas ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System.Collections.Generic
texture Microsoft.Xna.Framework.Graphics.Texture2D
return System.Collections.Generic

create() public static method

public static create ( Microsoft.Xna.Framework.Graphics.Texture2D texture, int regionWidth, int regionHeight, int maxRegionCount = int.MaxValue, int margin, int spacing ) : TexturePackerAtlas
texture Microsoft.Xna.Framework.Graphics.Texture2D
regionWidth int
regionHeight int
maxRegionCount int
margin int
spacing int
return TexturePackerAtlas

createRegion() public method

public createRegion ( string name, int x, int y, int width, int height, float pivotX = 0.5f, float pivotY = 0.5f ) : Subtexture
name string
x int
y int
width int
height int
pivotX float
pivotY float
return Nez.Textures.Subtexture

getSpriteAnimation() public method

returns a SpriteAnimation given an animationName where the animationName is the region's "filename" metadata in the TexturePacker atlas minus the framenumbers at the end
public getSpriteAnimation ( string animationName ) : SpriteAnimation
animationName string Animation name.
return SpriteAnimation

getSubtexture() public method

public getSubtexture ( int index ) : Subtexture
index int
return Nez.Textures.Subtexture

getSubtexture() public method

public getSubtexture ( string name ) : Subtexture
name string
return Nez.Textures.Subtexture

removeSubtexture() public method

public removeSubtexture ( int index ) : void
index int
return void

removeSubtexture() public method

public removeSubtexture ( string name ) : void
name string
return void

this() public method

public this ( int index ) : Subtexture
index int
return Nez.Textures.Subtexture

this() public method

public this ( string name ) : Subtexture
name string
return Nez.Textures.Subtexture

Property Details

spriteAnimationDetails public_oe property

stores a map of the name of the sprite animation (derived from texturepacker filename metadata) to an array. each entry in the list refers to index of the corresponding subtexture
public Dictionary> spriteAnimationDetails
return List>.Dictionary

subtextures public_oe property

public List subtextures
return List

texture public_oe property

public Texture2D,Microsoft.Xna.Framework.Graphics texture
return Microsoft.Xna.Framework.Graphics.Texture2D