log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Elsear brings super-fast Networking to Risc PC/A7000/A7000+ (News:)
- Latest hardware upgrade from RISCOSbits (News:)
- RISCOSbits releases a new laptop solution (News:4)
- Announcing the TIB 2024 Advent Calendar (News:2)
- RISC OS London Show Report 2024 (News:1)
- Code GCC produces that makes you cry #12684 (Prog:39)
- Rougol November 2024 meeting on monday (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
- WROCC November 2024 talk o...ay - Andrew Rawnsley (ROD) (News:2)
- October 2024 News Summary (News:3)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
Acorn Arcade forums: Programming: Gamesuite pointer and coordinates
 
  Gamesuite pointer and coordinates
  botol (09:39 18/7/2003)
  monkeyson2 (10:40 18/7/2003)
    botol (12:36 21/7/2003)
      andrew (12:43 21/7/2003)
      Loris (16:00 21/7/2003)
 
Theo Message #44593, posted by botol at 09:39, 18/7/2003
Member
Posts: 2
I am trying to write a game using Gamesuite, Which involves clicking on the screen, and having a sprite appear there. I need to use an Amnesia table because it needs collision checking, but because Amnesia coordinates are different than ones used by Risc OS, you can't get it to appear in the right place.:(
Anyone have any solutions?
  ^[ Log in to reply ]
 
Phil Mellor Message #44594, posted by monkeyson2 at 10:40, 18/7/2003, in reply to message #44593
monkeyson2Please don't let them make me be a monkey butler

Posts: 12380
You need to convert between the co-ordinate systems.

The last time I did this was when MODE 13 was a good choice of screen mode to run a game in. The RISC OS screen co-ords were 0-1280, 0-1024 (left-right, bottom-top), but FastSpr used 0-320, 256-0. To convert from RISC OS to FastSpr, I did:

fx = rx / 4
fy = 256 - (fy / 4)

The division could be optimised out by shifting the numbers (>> 2) instead.
  ^[ Log in to reply ]
 
Theo Message #44691, posted by botol at 12:36, 21/7/2003, in reply to message #44594
Member
Posts: 2
Thanks but I need it in Mode 32?
  ^[ Log in to reply ]
 
Andrew Message #44693, posted by andrew at 12:43, 21/7/2003, in reply to message #44691
HandbagHandbag Boi
Posts: 3439
Can the GS handle Mode 32? what's the resolution?
  ^[ Log in to reply ]
 
Tony Haines Message #44701, posted by Loris at 16:00, 21/7/2003, in reply to message #44691
madbanHa ha, me mine, mwahahahaha
Posts: 1025
Thanks but I need it in Mode 32?
To generalise what the good monkey said, the OS measures from the bottom left (up and right positive), with each pixel being some power of two (ie 1,2,4) in each axis.

FastSpr measures from the top left (down and right being positive), in pixels along each axis. (This is to get an easy mapping to the screen memory.)

IIRC you need to be in a 256 colour mode for this to be valid.

Given this information, I suggest you experiment.
  ^[ Log in to reply ]
 

Acorn Arcade forums: Programming: Gamesuite pointer and coordinates