ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm making a 2D RPG for Linux (see sig) that uses a tiled graphical construct (ie, older Final Fantasy games). I have a question about graphics programming, which I've never done before although I have about 4 years programming experience in multiple languages.
So lets say I make a bunch of 80x80 pixel tiles and I want to use those to construct a map. If the screen resolution is set at 800x600, does that mean that the screen will display 8 tiles a the cross and 6 tiles up? What about if I set it to 1024x768? Will that the screen is 12.8 tiles wide and 9.6 tiles up? I know its a simple question and probably has a simple answer, but I wanted to clarify this somewhat ambiguous notion of tiles and screen resolutions. Thanks! (If it matters, I'm using the SDL libraries for this game)
Assuming you meant 640x480 as your first example (instead of the 800x600 listed), yes. If you have 80x80 tiles, the screen will only be able to display a given number of them at a time.
For 640x480 - 8 tile horizontal and 6 tiles vertical
For 800x600 - 10 horizontal, 7.5 vertical
For 1024x768 - 12.8 horizontal, 9.6 vertical
Originally posted by leonscape Simple answer: No 800/80 = 10
I can't believe I have my bachelor's and I still make stupid mistakes like that
Ok so it is as I thought, thanks Dark_Helmet (by the way, I loved you in Spaceballs). Now I'm starting to think of having some sort of side bar because I'd like the screen to be squared, hmm.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.