Jump to content
  • Advertisement
Sign in to follow this  
UMichGOBLUE

Game application layout in SDL

This topic is 3943 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!