i want my sprite size to be independent of texture size because i cant afford one to one mapping. here is the example
suppose i have a texture whose dimensions are 1024,1024
i want to use only portion of it from 0,0 to 300,300
i want that sprite to draw from 100,100 to 200,200 how can i acheive this
u can try using setTextureRect. it is inside the CCSprite class reference.
but it will change the size of sprite which isn’t required
I am in a similar position. I want to define texture sizes independently of sprite sizes.
i havent fully tested it but you can inherit ccsprite and then use settexturecoords directly this function is protected by default but by inheriting ccsprite you can access that function from your code and set uv value directly