Jump to content

is there a way to mirror a tilesprite like tilesprite.scale.x = -1 ?


valueerror
 Share

Recommended Posts

i have a big tilesprite (tiling only vertical) and i need it to be mirrored on some occasions.. so everything on the right will be on the left. if i try the old trick to scale it around the x axis to -1 it just gets black..

is this even possible or is this something restricted to normal sprites?

Link to comment
Share on other sites

I noticed this too. My theory is that the x-position needs to be compensated, and that the tilesprite is mirrored to the left of the desired x-position. But its just a guess without looking into how it's coded.

Edit: Missed the previous post. Hope that works. My post is on using tilesprite.scale.x = -1

Link to comment
Share on other sites

hey... thank you both for your answers.. you're awesome..  :)

 

this works (as nkholski said it is mirrored and the anchor is on the left side so i have to compensate for that...)

 ufer = game.add.tileSprite(worldwidth,0,worldwidth,worldheight,'ufer'); ufer.scale.x = -1;

and westinghouse's approach also works :)

ufer = game.add.tileSprite(0,0,worldwidth,worldheight,'ufer');ufer.tileScale.x=-1

since both of your answers are correct i'm marking this one here (containing both solutions) as answer..  thx a lot!

 

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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