Declaración PUESTA (Gráfica)

Objetivo:

Transferir imágenes de gráficos a la pantalla.

Sintaxis:

 PUESTO (x, y), serie, Æ, verbo de acción Å

Comentarios:

el verbo de acción puede ser PSET, PREESTABLECER, Y, O, XOR.

El (x, y) son las coordenadas de la esquina superior e izquierda de la imagen para ser transferida.

LOS PUESTOS Y SE PONEN las declaraciones transfieren imágenes de gráficos a y de la pantalla. PUESTO Y SE PONEN hacen la animación posible y el movimiento de objeto rápido en el uno o el otro modo de gráficos.

La declaración PUESTA transfiere la imagen almacenada en la serie en la pantalla. El punto especificado es la coordenada de la esquina superior e izquierda de la imagen. "Un error" de llamada de función Ilegal resulta si la imagen para ser transferida es demasiado grande para caber en la pantalla.

El verbo de acción es usado para relacionarse la imagen transferida con la imagen ya en la pantalla. El PSET transfiere los datos en la pantalla textual.

PREDETERMINADO es el mismo como PSET salvo que una imagen inversa (negro en blanco) es producida.

Y transfiere la imagen sólo si una imagen ya existe bajo la imagen transferida.

O superimpone la imagen en la imagen existente.

El XOR es un modo especial a menudo usado para la animación. El XOR hace que los puntos en la pantalla sean invertidos donde un punto existe en la imagen de serie. Este comportamiento exactamente parece al cursor en la pantalla. El XOR es sobre todo útil para la animación. Cuando una imagen es puesta contra un fondo complejo dos veces, el fondo es restaurado sin alterar. Un objeto puede ser movido alrededor de la pantalla sin borrar el fondo. El modo de acción de falta es XOR.

Para más información sobre efectos dentro de los modos diferentes, ver el COLOR, PALETA, Y PROTEJA declaraciones.

La animación de un objeto es por lo general realizada como sigue:

  1. Ponga el objeto (s) sobre la pantalla.
  2. Calcule de nuevo la nueva posición del objeto (s).
  3. Ponga el objeto (s) sobre la pantalla un segunda vez en la vieja posición (ones) para quitar la vieja imagen (ágenes).
  4. Vuelva para Andar 1, esta vez poniendo el objeto (s) en la nueva posición.

El movimiento hecho este camino deja el fondo sin alterar. El parpadeo puede ser reducido minimizando el tiempo entre Pasos 4 y 1, y asegurándose que hay tardanza de bastante tiempo entre Pasos 1 y 3. Si más de un objeto está siendo animado, trate cada objeto inmediatamente, un paso a la vez.

Si no es importante conservar el fondo, la animación puede ser realizada usando el verbo de acción PSET.

Deje una frontera alrededor de la imagen (cuando es primero conseguido) como grande o más grande que la distancia de máximo el objeto se moverá. Así, cuando un objeto es movido, esta frontera con eficacia borra cualquier punto. Este método puede ser algo más rápido que el método usando XOR descrito encima ya que sólo un PUESTO es requerido mover un objeto. Sin embargo, la imagen para ser PUESTA debe ser más grande que la imagen existente.

Ejemplos:

 10 CLS: PROTEJA 1 
20 PSET (130, 120) 
30 EMPATE "U25; E7; R20; D32; L6; U12; L14" 
40 EMPATE "D12; L6": PSET (137, 102) 
50 EMPATE "U4; E4; R8; D8; L12" 
60 PSET (137, 88) 
70 EMPATE "E4; R20; D32; G4": LA PINTURA (131,119) 
80 SE ATENÚA (un 500) 
90 SE PONEN (125, 130) - (170, 80), 
unos 100 YA QUE yo = 1 a 1000: DESPUÉS yo 
110 PUESTO (20, 20), A, PSET 
120 YA QUE yo = 1 a 1000: DESPUÉS 
130 ME PONGO (125, 130) - (170, 80), 
unos 140 YA QUE yo = 1 a 1000: DESPUÉS yo 
150 PUESTO (220, 130), A, PREDETERMINADO 
 

PUT Statement (Graphics)

Purpose:

To transfer graphics images to the screen.

Syntax:

PUT(x,y),array,[,action verb]

Comments:

action verb may be PSET, PRESET, AND, OR, XOR.

The (x,y) are the coordinates of the top-left corner of the image to be transferred.

The PUT and GET statements transfer graphics images to and from the screen. PUT and GET make possible animation and high-speed object motion in either graphics mode.

The PUT statement transfers the image stored in the array onto the screen. The specified point is the coordinate of the upper-left corner of the image. An "Illegal function call" error results if the image to be transferred is too large to fit onto the screen.

The action verb is used to interact the transferred image with the image already on the screen. PSET transfers the data onto the screen verbatim.

PRESET is the same as PSET except that an inverse image (black on white) is produced.

AND transfers the image only if an image already exists under the transferred image.

OR superimposes the image onto the existing image.

XOR is a special mode often used for animation. XOR causes the points on the screen to be inverted where a point exists in the array image. This behavior is exactly like the cursor on the screen. XOR is especially useful for animation. When an image is put against a complex background twice, the background is restored unchanged. An object can be moved around the screen without obliterating the background. The default action mode is XOR.

For more information about effects within the different modes, see the COLOR, PALETTE, and SCREEN statements.

Animation of an object is usually performed as follows:

  1. Put the object(s) on the screen.
  2. Recalculate the new position of the object(s).
  3. Put the object(s) on the screen a second time at the old location(s) to remove the old image(s).
  4. Return to Step 1, this time putting the object(s) at the new location.

Movement done this way leaves the background unchanged. Flicker can be cut down by minimizing the time between Steps 4 and 1, and by making sure that there is enough time delay between Steps 1 and 3. If more than one object is being animated, process every object at once, one step at a time.

If it is not important to preserve the background, animation can be performed using the PSET action verb.

Leave a border around the image (when it is first gotten) as large or larger than the maximum distance the object will move. Thus, when an object is moved, this border effectively erases any points. This method may be somewhat faster than the method using XOR described above since only one PUT is required to move an object. However, the image to be PUT must be larger than the existing image.

Examples:

10 CLS: SCREEN 1
20 PSET (130, 120)
30 DRAW "U25; E7; R20; D32; L6; U12; L14"
40 DRAW "D12; L6": PSET(137, 102)
50 DRAW "U4; E4; R8; D8; L12"
60 PSET (137, 88)
70 DRAW "E4; R20; D32; G4": PAINT (131,119)
80 DIM A (500)
90 GET (125, 130)-(170, 80), A
100 FOR I= 1 TO 1000: NEXT I
110 PUT (20, 20), A, PSET
120 FOR I= 1 TO 1000: NEXT i
130 GET (125, 130)-(170, 80), A
140 FOR I= 1 TO 1000: NEXT I
150 PUT (220, 130), A, PRESET
1