コード例 #1
0
        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 ;
        }
コード例 #2
0
ファイル: CtrlBatch.cs プロジェクト: hatano0x06/Coroppoxus
	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;
	}