CAOS-Programmierung: Befehlsgruppen: Camera

Aus Wikibooks

Camera

BKGD (command) metaroom_id (integer) background (string) transition (integer)

Change the current background displayed for the selected camera (with SCAM). Transition is as for META. The background must have been specified with  
the ADDM or ADDB command first.

BKGD (string) metaroom_id (integer)

Returns the name of the background file currently shown by the given camera.

BRMI (command) metaroom_base, (integer) room_base (integer)

Sets the Map's Metaroom and Room index bases for adding new rooms/metarooms.

CMRA (command) x (integer) y (integer) pan (integer)

Move current camera so top left corner of view is at world coordinate x y. Set pan 0 to jump straight to location, pan 1 to smoothly scroll there 
(unless in a different meta room).

CMRP (command) x (integer) y (integer) pan (integer)

Centre current camera on world coordinate x y. Set pan 0 to jump straight to location, pan 1 to smoothly scroll there (unless in different meta room), 
and pan 2 to smoothly scroll only if the destination is already visible.

CMRT (command) pan (integer)

Centre current camera on target. Set pan 0 to jump straight to location, pan 1 to smoothly scroll there (unless in different meta room), and pan 2 to  
smoothly scroll only if the destination is already visible.

CMRX (integer)

Returns the x coordinate of the centre of the current camera.

CMRY (integer)

Returns the y coordinate of the centre of the current camera.

FRSH (command)

Refreshes the main view port.

LINE (command) x1 (integer) y1 (integer) x2 (integer) y2 (integer) r (integer) g (integer) b (integer) stipple_on (integer) stipple_off (integer)

Adds a line to target's drawing list. The line goes between the start and end points (world coordinates) in the specified colour. Set stipple_on and 
stipple_off to 0 to draw a solid line, or to the number of pixels to alternate for a stippled line. To clear all the lines for an agent, call LINE  
with the start and end points the same.

LOFT (integer) filename (string)

Declares that you have finished with a photograph image file taken by SNAP. If the file is in use in a gallery, this function fails and returns 1. 
Otherwise it returns 0. The file will be marked for the attic, and moved there later.

META (command) metaroom_id (integer) camera_x (integer) camera_y (integer) transition (integer)

Change the current camera (set with SCAM) to a new meta room. Moves the top left coordinate of the camera to the given coordinates.
Transition can be:
0 - no transition effect
1 - flip horizontally
2 - burst

META (integer)

Returns the metaroom id that the current camera is looking at.

SCAM (command) compoundagent (agent) partNumber (integer)

Sets the current camera to be used in subsequent camera macro commands. This uses the given TARG and the given PART number. If you set this to NULL 
then the Main Camera will be used. This is the default setting

SNAP (command) filename (string) x_centre (integer) y_centre (integer) width (integer) height (integer) zoom_factor (integer)

This takes a photograph of the world at a particular place. The zoom parameter should be between 0 and 100. 100 means at original size, 50 means half 
size etc. It makes a new image file in the world images directory - you can use it to make agents and parts as with any image file. Call SNAX first to 
check your filename isn't already in use in any images directory. When you have finished with the file, call LOFT.

SNAX (integer) filename (string)

Returns 1 if the specified image file exists, or 0 if it doesn't. Use with SNAP to find a unique filename to use.

TRCK (command) agent (agent) x% (integer) y% (integer) style (integer) transition (integer)

Camera follows the given agent. Set to NULL to stop tracking. x% and y% are percentages (0-100) of the screen size. They describe a rectangle centred 
on the screen which the target stays within.
Style 0 is brittle - if you move the camera so the target is out of the rectangle, then the tracking is broken.
Style 1 is flexible - you can move the camera away from the target. If you move it back, then tracking resumes.
Style 2 is hard - you can't move the camera so the target is out of the rectangle.
The transition is the sort of fade to use if the tracking causes a change in meta room. The values are the same as for the transition in the META  
command.

TRCK (agent)

Returns the agent being tracked by the camera, if any.

WDOW (command)

Toggle full screen mode.

WDOW (integer)

Returns 1 if in full screen mode, or 0 if in windowed mode.

WNDB (integer)

Returns world coordinates of bottom of current camera window.

WNDH (integer)

Returns height of current camera window.

WNDL (integer)

Returns world coordinates of left of current camera window.

WNDR (integer)

Returns world coordinates of right of current camera window.

WNDT (integer)

Returns world coordinates of top of current camera window.

WNDW (integer)

Returns width of current camera window.

ZOOM (command) pixels (integer) x (integer) y (integer)

Zoom in on the specified position by a negative amount of pixels or out by positive amount of pixels. If you send -1 as the x and y coordinates then 
the camera zooms in on the exising view port centre. This only applies to remote cameras.