WombatTurkey Posted October 9, 2015 Share Posted October 9, 2015 Dumb question, I am sorry but I've been stuck on this for a while. https://jsfiddle.net/Dillybob/J5fUE/213/ Basically, I'm making an HP orb and when I change the height of the rectangle it needs to sink down not up, if that makes sense. Edit: One sec, my jsfiddle is broke Edit2: No idea, but this is the code: var HP_ORB_WIDTH = 155; var HP_ORB_HEIGHT = 135; var bmd = game.add.bitmapData((this.game.width, this.game.height)); bmd.context.rect(50, 50, HP_ORB_WIDTH, HP_ORB_HEIGHT); bmd.context.lineWidth = 2; bmd.context.fillStyle = "#e81957"; bmd.context.fillRect(50, 50, HP_ORB_WIDTH, HP_ORB_HEIGHT); //ctx.globalCompositeOperation = 'destination-atop'; bmd.context.stroke(); var HPORB = game.add.sprite(0, 0, bmd); game.add.tween(HPORB).to({ height: 1 }, 5000, Phaser.Easing.Cubic.Out, true); Link to comment Share on other sites More sharing options...
drhayes Posted October 9, 2015 Share Posted October 9, 2015 As you tween the height to 1, tween the y position to to keep the bottom aligned where you want it; probably to originalY + originalHeight. WombatTurkey 1 Link to comment Share on other sites More sharing options...
WombatTurkey Posted October 9, 2015 Author Share Posted October 9, 2015 As you tween the height to 1, tween the y position to to keep the bottom aligned where you want it; probably to originalY + originalHeight.Boom Got it!https://jsfiddle.net/Dillybob/hnbaLcj5/1/ Thank you!! Had a brain fart, sorry Link to comment Share on other sites More sharing options...
drhayes Posted October 9, 2015 Share Posted October 9, 2015 Glad it worked out. ( = Link to comment Share on other sites More sharing options...
Recommended Posts