Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Flip Option in raylib_util.nim #1

Open
Technisha opened this issue Dec 9, 2020 · 1 comment
Open

Add Flip Option in raylib_util.nim #1

Technisha opened this issue Dec 9, 2020 · 1 comment

Comments

@Technisha
Copy link

Hello! I have been testing this out for a little while now and am now planning to make a little game, but i'm facing an issue because Textures seem to not have a simple way to flip them (If the character is moving one way), so is it possible if this feature can be implemented? Thanks! (If i figure out how to do this, i'll probably create a PR)

@Technisha
Copy link
Author

Welp, i'm stupid because this was actually bugging me for about half an hour, buuuut i got it done! It can easily be implemented like this (look below), only issue is, it doesn't have any way of saying if it's flipped

proc TextureFlipH(texture:var Texture2D):Texture2D =
  texture.width = texture.width * -1
  return texture

proc TextureFlipV(texture:var Texture2D):Texture2D =
  texture.height = texture.height * -1
  return texture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant