Jump to content

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.


Link to comment
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?

Link to comment
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...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...