public void InitSpriteBatch( int maxSpriteCount , DemoGame.GraphicsDevice graphDev ) { batch = new SpriteBatch( graphDev.Graphics, maxSpriteCount ) ; material = new SpriteMaterial( new Texture2D( "/Application/res/data/2Dtex/unifiedTexture.png", true ) ) ; material.Texture.SetFilter( TextureFilterMode.Linear, TextureFilterMode.Linear, TextureFilterMode.Nearest ) ; sprites = new Sprite[ maxSpriteCount ] ; spriteCount = 0 ; }
public Sprite( SpriteBatch batch, SpriteMaterial material = null, int zIndex = 0 ) { this.batch = batch ; this.material = material ?? SpriteMaterial.DefaultMaterial ; this.zIndex = zIndex ; vertexID = -1 ; indexID = -1 ; UpdateSortKey( false ) ; batch.AddSprite( this ) ; Center = new Vector2( 0.5f ) ; UVSize = new Vector2( 1.0f ) ; Color = new Rgba( 255, 255, 255, 255 ) ; updataFlag = false; }