Sign in to follow this  

Game application layout in SDL

This topic is 3659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This maybe a really newbie question, but are all the elements of an interface of a game program just placed in by your Graphics language. For example, lets say you have a score in the upper right, and a map in the lower left. In SDL, do you just write them into the code at that place? Like at (340,200) there is what you want? I'm kinda confused myself, but in general I'm just looking for an idea of how you set up the interface of a game.

Share this post


Link to post
Share on other sites
Well, you have to figure out what kind of information you want to show on the screen. If it's an image (static), load it from an image file, and blit it there. If it's something else, you will have to handle it differently.

Worked with SDL much? If not, you might find Lazy Foo's tutorials very helpful!

FlyingIsFun1217

Share this post


Link to post
Share on other sites
with a score you can just find a medium which will let you write text on to the screen, i am still a beginner but in the past i have just set co-ordinates for where i want text to be displayed....for a map if it is a .bmp then you can do the same!

Share this post


Link to post
Share on other sites
Don't forget to cater for different screen resolutions.

It might be worth positioning your screen elements according to a percentage, e.g., the score will be displayed 5% down and 90% right, which should be the top right hand corner, whatever the screen resolution.

If your game is a fixed resolution, then go ahead and use straight coordinates.

Share this post


Link to post
Share on other sites

This topic is 3659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this