bambieee

Tile sprite scale anchor

Recommended Posts

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.

scrsht.jpg

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.