Updated some docs, added the new renderHidden parameter for Canvas and updated the RenderTexture examples as a result.

This commit is contained in:
photonstorm
2013-12-27 00:26:21 +00:00
parent 2c8077835c
commit fdbdd81b7b
9 changed files with 83 additions and 53 deletions
+6 -4
View File
@@ -27,9 +27,11 @@ function create() {
function update() {
// This time we'll draw the ball sprite twice, in a mirror effect
texture.renderXY(ball, game.input.activePointer.x, game.input.activePointer.y, false);
texture.renderXY(ball, game.input.activePointer.x, 600 - game.input.activePointer.y, false);
if (!game.input.activePointer.position.isZero())
{
// This time we'll draw the ball sprite twice, in a mirror effect
texture.renderXY(ball, game.input.activePointer.x, game.input.activePointer.y, false, true);
texture.renderXY(ball, game.input.activePointer.x, 600 - game.input.activePointer.y, false, true);
}
}
+2 -2
View File
@@ -69,12 +69,12 @@ function update() {
if (i == 0 || i == 100 || i == 200)
{
// If it's the first star of the layer then we clear the texture
stars[i].texture.renderXY(star, stars[i].x, stars[i].y, true);
stars[i].texture.renderXY(star, stars[i].x, stars[i].y, true, true);
}
else
{
// Otherwise just draw the star sprite where we need it
stars[i].texture.renderXY(star, stars[i].x, stars[i].y, false);
stars[i].texture.renderXY(star, stars[i].x, stars[i].y, false, true);
}
}
+7 -3
View File
@@ -27,8 +27,12 @@ function create() {
function update() {
// Here we draw the mushroom sprite to the renderTexture at the pointer coordinates.
// The 'false' parameter at the end tells it not to clear itself, causing the trail effect you see.
texture.render(mushroom, game.input.activePointer.position, false);
if (!game.input.activePointer.position.isZero())
{
// Here we draw the mushroom sprite to the renderTexture at the pointer coordinates.
// The 'false' parameter 2nd from the end tells it not to clear itself, causing the trail effect you see.
// The final 'true' parameter tells it to render sprites even with visible false set.
texture.render(mushroom, game.input.activePointer.position, false, true);
}
}