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 |
Please 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 |
Handbag 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 |
Ha 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 |