2d viewport/camera?

Hey how would i go about moving a 2d camera in raylib?
I see stuff in the cheatsheet for 3d camera and all but nothing for 2d.

Thanks!

Comments

  • Hi mouldysammich,

    Right now there is no 2D camera system, you have to move/scale/rotate all screen elements at drawing or use the new experimental function included in raylib 1.4:

    void BeginDrawingEx(int blendMode, Shader shader, Matrix transform);

    With this function you can use a custom blendMode, shader and transform matrix to be applied to all the draw elements. Using a custom transform matrix you can translate-rotate-scale all the screen elements and create a 2D camera.

    I know this method is far from desired so I'm adding "2D camera system" to my TODO list.
  • Great, thanks very much! Should be fun trying to figure out transform matrix.
    Really love raylib so far! It gives me a nice way to practice my C skills!
  • Hi mouldysammich,

    Just added an issue on GitHub for it: https://github.com/raysan5/raylib/issues/94

    I'll try to implement it an provide an example as soon as posible.
Sign In or Register to comment.