LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2004, 04:44 PM   #1
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Rep: Reputation: 30
Graphics programming newbie question


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)
 
Old 06-20-2004, 04:50 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Simple answer: No 800/80 = 10
 
Old 06-20-2004, 04:53 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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
 
Old 06-20-2004, 04:59 PM   #4
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Quote:
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.
 
Old 06-21-2004, 05:21 PM   #5
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
Or have a bottom bar and make the screen evenly rectangular. By the way, is it going to be isometric? (Spelled wrong I am sure)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphics Programming Language renjith Programming 7 08-16-2003 10:08 AM
Newbie question> Programming with C Juan Araya Slackware 2 03-06-2003 08:41 PM
Graphics programming on Linux berry Programming 4 10-23-2002 04:41 AM
Graphics Driver Programming XoSkely10 Programming 1 07-31-2002 02:26 PM
newbie programming question aizkorri Programming 4 03-22-2002 03:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration