From 27cea5e6f0cd3fabcfb351cc6f219d61eb7d8fe5 Mon Sep 17 00:00:00 2001 From: alvinsight Date: Fri, 28 Feb 2014 18:40:06 +0000 Subject: [PATCH] Tidying up a bit --- examples/debug/debug physics.js | 1 - examples/display/bitmapdata wobble.js | 2 -- examples/sprites/dynamic crop.js | 26 ++++++++++++++++---------- examples/world/move around world.js | 2 -- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/examples/debug/debug physics.js b/examples/debug/debug physics.js index 8c9ff0773..ef71bc764 100644 --- a/examples/debug/debug physics.js +++ b/examples/debug/debug physics.js @@ -33,7 +33,6 @@ function create() { function update() { - // game.physics.collide( sprite, otherSprite ) ; // Move sprite up and down smoothly for show var tStep = Math.sin( counter ) ; diff --git a/examples/display/bitmapdata wobble.js b/examples/display/bitmapdata wobble.js index 8206e98ed..81d635134 100644 --- a/examples/display/bitmapdata wobble.js +++ b/examples/display/bitmapdata wobble.js @@ -28,8 +28,6 @@ function create() { // Populate the wave with some data waveData = game.math.sinCosGenerator(32, 8, 8, 2); - console.log(bmd.context) - } function update() { diff --git a/examples/sprites/dynamic crop.js b/examples/sprites/dynamic crop.js index 1fdfa5330..feac40a41 100644 --- a/examples/sprites/dynamic crop.js +++ b/examples/sprites/dynamic crop.js @@ -6,26 +6,32 @@ function preload() { } var pic; +var cropRect; function create() { pic = game.add.sprite(0, 0, 'trsi'); - - pic.cropEnabled = true; - - pic.crop.width = 128; - pic.crop.height = 128; - + cropRect = {x : 0, y : 0 , width : 128, height : 128}; } function update() { - pic.x = game.input.x; - pic.y = game.input.y; + if(game.input.x < pic.width && game.input.y < pic.height){ - pic.crop.x = game.input.x; - pic.crop.y = game.input.y; + pic.x = game.input.x; + pic.y = game.input.y; + + cropRect.x = game.input.x; + cropRect.y = game.input.y; + + pic.crop(cropRect); + + + + } + + } diff --git a/examples/world/move around world.js b/examples/world/move around world.js index 53a520260..ef088d93e 100644 --- a/examples/world/move around world.js +++ b/examples/world/move around world.js @@ -88,8 +88,6 @@ function render() { game.debug.renderCameraInfo(game.camera, 32, 32); game.debug.renderSpriteInfo(d, 32, 200); - // game.debug.renderWorldTransformInfo(d, 32, 200); - // game.debug.renderLocalTransformInfo(d, 32, 400); game.debug.renderSpriteCorners(d, false, true); }