Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

CCSprite: Add HalfTexelOffset property #292

Closed
rtabbara opened this issue Aug 26, 2015 · 0 comments
Closed

CCSprite: Add HalfTexelOffset property #292

rtabbara opened this issue Aug 26, 2015 · 0 comments

Comments

@rtabbara
Copy link
Member

Motivated by this forum post here.

As texel integer coordinates represent texture boundaries rather the centres, there is the potential for bleeding artifacts to crop up, particularly when a sprite corresponds to a sub region of a given texture. Hence, users should be provided with the ability to request for CocosSharp to internally adjust texture coordinates by half a texel to ensure that texture sampling is performed at texel centers (assuming the sub-rect perfectly lies on a boundary). In particular, these change can be set for all sprites via the static property


CCSprite.DefaultHalfTexelOffset = true; 

or for a particular sprite via the instance property


sprite.HalfTexelOffset = true;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant