I have to call get texture from sprite first, then call setAntiAliasTexParameters.
I want the texture class call setAntiAliasTexParameters by itself when it’s loaded automatically without call get texture from a sprite.
I already investigated the Texture2D class, but I don’t know where should I call setAntiAliasTexParameters.
Well it should default to anti-aliased texture. So can you explain what you’re seeing visually that is wrong or unexpected for your art?
For pixel art, however, we decided to modify the engine source to change this default to Aliased textures instead. It would probably be helpful to have a define macro that can be set for both source builds and also during pre-built version to determine which the engine uses by default.
For everything except fonts you can toggle the default by changing the value set in CCTexture2D.cpp's constructor.
, _antialiasEnabled(true) // change to false for pixel art (aliased)
Fonts have their own identical setting defined in CCFontAtlas.cpp. This is nice in case you want to have the ability to use arbitrary font sizes without having pixel scaling issues. Or if you use the distance field font stuff correctly.