bambieee Posted July 13, 2017 Share Posted July 13, 2017 Hi Guys there, There is a game with multiple layers. The lowest one is the water. Camera is above. The layers are scaled differently and moving with different speed imitating that its a 3D world. I want to use only a screen size tile sprite rectangle for the water to avoid full world broad animated tile map. There is a zoom navigation tool which scales all the layers up and down based the on the centre of the screen and I want to zoom the water as well. Question one: Can I set the "anchor" base point for the scale on a tile sprite? I couldn't find any property for it. And the base point is the top left corner by default. Question two: Does it make sense to try saving hardware resources in this way? The water surface has to be about 20 times bigger than the screen. Many thanks for any help. Link to comment Share on other sites More sharing options...
samme Posted July 13, 2017 Share Posted July 13, 2017 If you're using TileSprite#tileScale, there is TileSprite#tileScaleOffset. Link to comment Share on other sites More sharing options...
bambieee Posted July 18, 2017 Author Share Posted July 18, 2017 Thank you Samme, Unfortunately it doesn't work. I have tried as percent (0-1) and as pixels, but nothing. water.tileScaleOffset.x = .5; // % nothing changed water.tileScaleOffset.y = 500; // px nothing changed water.tileScale.x = 3; // working water.tileScale.y = 3; // working The base point of scaling is still (0, 0). Did I do something wrong? Link to comment Share on other sites More sharing options...
samme Posted July 20, 2017 Share Posted July 20, 2017 Maybe avoid tileScaleOffset, it seems to be set automatically. You may want to use tileScale only (and not scale) and then adjust tilePosition. Fiddle with the example: Link to comment Share on other sites More sharing options...
bambieee Posted July 20, 2017 Author Share Posted July 20, 2017 Thank you Samme, It would have been definitely nice to use this feature, but what can I do if it's not working. On the other hand Phaser is a great library. Do you know where to report the bugs? I am not in the finish yet, so have time to find other solution or wait for the bugfix. Once more thanks, for your effort! I'll show you the final result... Link to comment Share on other sites More sharing options...
samme Posted July 22, 2017 Share Posted July 22, 2017 Are you using fixedToCamera? Link to comment Share on other sites More sharing options...
bambieee Posted July 24, 2017 Author Share Posted July 24, 2017 I have a unique camera system so I don't use the built in one. But as you questioned I tried to change the fixedToCamera property, but nothing's changed. Link to comment Share on other sites More sharing options...
Recommended Posts