mirror of
https://github.com/wassname/phaser.git
synced 2026-08-11 11:23:06 +08:00
Updated some docs, added the new renderHidden parameter for Canvas and updated the RenderTexture examples as a result.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user