Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
40
rated 0 times [  46] [ 6]  / answers: 1 / hits: 57697  / 13 Years ago, thu, november 17, 2011, 12:00:00

I'm trying to flip/mirror an image as I paint it on an HTML canvas; I found a game tutorial showing a sprite sheet per direction a character has to face, but this doesn't seem quite right to me. Especially since each frame has a different size.



What would be the best technique to reach this goal?



I tried to call the setScale(-1, 1); on my canvas with no success. Maybe that isn't meant for this.



Thanks


More From » html

 Answers
10

  1. You can do this by transforming the context with myContext.scale(-1,1) before drawing your image, however


  2. This is going to slow down your game. It's a better idea to have a separate, reversed sprite.



[#89069] Wednesday, November 16, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
clarissakourtneyb

Total Points: 710
Total Questions: 89
Total Answers: 125

Location: Dominica
Member since Sat, Nov 5, 2022
2 Years ago
;