ForgeableSum Posted February 3, 2016 Share Posted February 3, 2016 So I've got this neat little rotation tween which gives the effect of a swaying tree: function tweenTree(tree, autoStart) { if (!allowTweenTrees) { return; } var randomDelay = rData.between(0, 3000); var time = 3500; var amountRotation = 2; tree.smoothed = true; tree.angle = amountRotation * -1; var move = game.add.tween(tree).to({ rotation: amountRotation * (Math.PI / 180), // angle: amountRotation, // Phaser.Easing.Quadratic.Out }, time, Phaser.Easing.Quadratic.InOut, autoStart, randomDelay, -1, true); // console.log(tree.__proto__.smoothed); tree.treeTween = move; move.onUpdateCallback(function() { tree.smoothed = true; }, this); } Note the onUpdateCallback.... Just another one of the measures I take to try and get smoothing to stay on. For some reason it randomly turns off in webgl. Doesn't seem to happen in canvas mode. See the GIF below. When you turn smoothing off, the tree tween looks horrible. In the GIF below, it turns off randomly when you are placing more trees in the game which makes absolutely no sense. This is one of those issues in which there is no precedence for. After hours of Googling, I've realized no one else has ever had this problem. See what I'm talking about here in the below GIF. Notice that when I place a tree, the smoothing turns off for all the trees ... then it goes back on again when I place another tree. it makes no sense! http://i.imgur.com/HBlSK4H.webm Phaser 2.3.0 btw. Link to comment Share on other sites More sharing options...
ForgeableSum Posted February 11, 2016 Author Share Posted February 11, 2016 Guess I'm on my own with this one! Link to comment Share on other sites More sharing options...
fillmoreb Posted February 11, 2016 Share Posted February 11, 2016 When the trees aren't being rendered smoothly, can you confirm that the smoothed flag is actually set to false? Link to comment Share on other sites More sharing options...
Recommended Posts