Fix vanishing textures


Just to document this somewhere, there are two ways to draw a texture flipped with DrawTexturePro.

Version1: depending on the direction you're facing, you either use 0 or the texture width as the x position for the source rectangle and a positive or negative width, also depending on the direction you're facing.

This works perfectly fine on desktop, but when run in web through wasm, this makes the textures disappear.

To fix this, you can just use Version 2, where you keep the x position of the source always at 0 and just adjust the width, depending on the direction.

This works perfectly on desktop and web.

Leave a comment

Log in with itch.io to leave a comment.