il y a 5 ans
Hi,
I wonder if there is something in the Gamebuino_META library that allow us to make a symetrical transformation on an image. For example if a sprite goes left or right, to be able to use the same image or animation in one direction or another.
I am nearly sure I saw something about that on the forum but I can't find it back ...
Thank you !
NEW il y a 5 ans
I have already explained this case here for JFT (and I think you were part of that discussion, right?).
void drawMario() { mario.sheet.setFrame(mario.frame); gb.display.drawImage( mario.x, mario.y, mario.sheet, mario.w * (mario.orientation == MARIO_ORIENTATION_LEFT ? 1 : -1), // here is the trick! mario.h ); }
NEW il y a 5 ans
YES that was it ! And indeed I was a part of it ! I couldn't remember what discussion it was... thanks !
NEW il y a 5 ans
In the drawImage reference the w2 and h2 optional parameters are presented with the basic functionnality to scale the image to the new specified size, but I think it would be a great idea to add this tip directly in the reference !
I don't think I could think myself that simply invert the value could reverse the image orientation. It sounds obvious when it's told but... Anyway, it would be great to talk about that example in the reference.
NEW il y a 5 ans
You're absolutely right!
That's good... I think it's moving at the Academy level and the reference documentation is part of the changes ;-)