Game application layout in SDL

Started by
4 comments, last by deadstar 16 years, 5 months ago
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.
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
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!
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.

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

EDIT: Triple posted? What happened! My apologies.

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

EDIT:

Sorry, double posted

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

This topic is closed to new replies.

Advertisement