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

CCSprite: Add HalfTexelOffset property #292

@rtabbara

Description

@rtabbara

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;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions