Screen coordinates vs. room coordinates<solved>

Started by Quintaros, Tue 07/10/2003 06:24:17

Previous topic - Next topic

Quintaros

On a scrolling room, is there a way to keep an object in the same position on the screen regardless of where in the room the character is?

What I'm trying to do is have a letterboxed room scroll up/down (I know there is a built in letterboxing function but I've chosen to go with a slightly different aspect ratio).

I thought that I could create the letterboxing as an object and than manipulate the objects postion based on what part of the room was visible by putting something in the repeatedly execute script for the room:

MoveObject(0,160,bottomscreen);

where 160 was the centre of the width of the screen and bottomscreen was the room's y-coordinate that was on the bottom edge of the visible area of the screen.  But I'm not sure if there is a function to get the coordinate for the screen position rather than room postion.

Gilbert

Use graphical overlays instead, they're always drawn on topmost layers and they use screen coordinates.

There's even a whole section about overlay functions in the manual:

Text Script Functions --> Overlay Functions


All you need to do is to CreateGraphicicOverlay() to put it on screen when it's needed, eg:
topbarid=CreateGraphicOverylay(0,0,5,0);

(where toparid was a variable defined earlier to hode the overlay id, needed later if you want to move or remove the overlay)

When you don't need the overlay anymore, just use RemoveOverlay(), eg:
RemoveOverlay (topbarid);

Quintaros

#2
That works perfect.  Thanks alot.

Damn it works so well it makes me want to go back and redo every other background to include this device.

SMF spam blocked by CleanTalk