Skip to content

Commit 8144fe7

Browse files
committed
Use alpha test shader in the vertex-z test.
Former-commit-id: ab44836
1 parent b8d2759 commit 8144fe7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cocos2d-ui-tests/tests/VertexZTest.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,20 @@ - (void)setupVertexZTest
7373
// add a card node to hold the cards
7474
_cardNode = [CCSpriteBatchNode batchNodeWithFile:@"Cards/cards.classic.png"];
7575
_cardNode.contentSize = [CCDirector sharedDirector].viewSize;
76+
77+
_cardNode.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColorAlphaTest];
78+
GLint location = [_cardNode.shaderProgram uniformLocationForName:@(kCCUniformAlphaTestValue_s)];
79+
[_cardNode.shaderProgram setUniformLocation:location withF1:0.5];
80+
7681
[self.contentNode addChild:_cardNode];
7782

7883
// add an array of cards
7984
for (int count = 0; count < NUMBER_OF_CARDS; count ++)
8085
{
8186
CCSprite *card = [CCSprite spriteWithImageNamed:[self randomCard]];
87+
8288
card.positionType = CCPositionTypeNormalized;
83-
card.position = ccp(0.5 + (count - NUMBER_OF_CARDS / 2) * 0.02, 0.5);
89+
card.position = ccp(0.5 + (count - NUMBER_OF_CARDS / 2) * 0.02, 0.5 + (count - NUMBER_OF_CARDS / 2) * 0.01);
8490
[_cardNode addChild:card];
8591
}
8692
}

0 commit comments

Comments
 (0)