SDL2: 2d board game, mouse input, dynamic

Started by
2 comments, last by here_here 1 month, 1 week ago

Hi, newbie here, a little lost.

I want to make a 2d board game program. So the board can be zoomed in and out. There will be more boards than one. And the entire screen can be moved, navigated. And these all need mouse input. This is an example of what it might look like:

I read in another post in this forum the following:

"SDL isn't a GUI library. There is, to SDL, no such thing as an "object clicked", because the main surface is just a bunch of pixels."

I understand that there are ways to do this in SDL2, I just would rather use something that is made for this purpose.

If it was a static board, I would just check the mouse click coordinates to activate an action. But since the board can be zoomed in and out and they can move…
What is the way to do this? Any software which is better suited to implement this than SDL2?

Thank you a whole lot.

Advertisement

I think this one might help you. It's not exactly what you're looking for, but most of what you want to do is there (except zooming).

For the zooming stuff, you can have a look there.

@_Silence_ thank you 🙂

This topic is closed to new replies.

Advertisement