Home » Archimedes archive » Archimedes World » AW-1994-01.adf » AWJan94 » !AWJan94/Goodies/Disc/Example_3/Translate

!AWJan94/Goodies/Disc/Example_3/Translate

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1994-01.adf » AWJan94
Filename: !AWJan94/Goodies/Disc/Example_3/Translate
Read OK:
File size: 0453 bytes
Load address: 0000
Exec address: 0000
File contents
    1PROCList
    2LIBRARY "PathLib:OS_units.Paths"
    3LIBRARY "PathLib:OS_units.Transforms"
    4square%=FNPath_CreateSquare(200,200,400)
    5PROCCreateTransform
    6PROCDrawObjects
    7END
    8
    9DEF PROCCreateTransform
   10 PROCPath_CreateTransform(translate%)
   11 PROCPath_Translation(translate%,20,20)
   12ENDPROC
   13
   14DEF PROCDrawObjects
   15 REPEAT
   16  SYS "Draw_Stroke",square%
   17  PROCPath_Transform(square%,translate%)
   18  x$=GET$
   19 UNTIL FALSE
   20ENDPROC
   21
   22DEF PROCList
   23MODE MODE
   24COLOUR 2
   25PRINT "EXAMPLE 3: TRANSLATING A SQUARE, by (20,20) OS units" : PRINT
   26DATA LIBRARY "PathLib:OS_units.Paths"
   27DATA LIBRARY "PathLib:OS_units.Transforms"
   28DATA "square%=FNPath_CreateSquare(200,200,400)"
   29DATA "PROCCreateTransform"
   30DATA "PROCDrawObjects"
   31DATA "END"
   32DATA ""
   33DATA "DEF PROCCreateTransform"
   34DATA " PROCPath_CreateTransform(translate%)"
   35DATA " PROCPath_Translation(translate%,20,20)"
   36DATA "ENDPROC"
   37DATA ""
   38DATA "DEF PROCDrawObjects"
   39DATA " REPEAT"
   40DATA "  SYS ""Draw_Stroke"",square%"
   41DATA "  PROCPath_Transform(square%,translate%)"
   42DATA "  x$=GET$"
   43DATA " UNTIL FALSE"
   44DATA "ENDPROC"
   45COLOUR 1
   46FOR i%=1 TO  19 : READ x$ : PRINT x$ :NEXT
   47COLOUR 7
   48PRINT '"Press space bar! (ESC to finish)."
   49ENDPROC
   50
	�List
ț "PathLib:OS_units.Paths"
$ț "PathLib:OS_units.Transforms"
+square%=�Path_CreateSquare(200,200,400)
�CreateTransform
�DrawObjects
�

	� �CreateTransform

& �Path_CreateTransform(translate%)
( �Path_Translation(translate%,20,20)
�


� �DrawObjects
 �
  ș "Draw_Stroke",square%
)  �Path_Transform(square%,translate%)

  x$=�
 � �
�

� �List
� �
� 2
@� "EXAMPLE 3: TRANSLATING A SQUARE, by (20,20) OS units" : �
&� LIBRARY "PathLib:OS_units.Paths"
+� LIBRARY "PathLib:OS_units.Transforms"
0� "square%=FNPath_CreateSquare(200,200,400)"
� "PROCCreateTransform"
� "PROCDrawObjects"
� "END"
 � ""
!� "DEF PROCCreateTransform"
"-� " PROCPath_CreateTransform(translate%)"
#/� " PROCPath_Translation(translate%,20,20)"
$� "ENDPROC"
%� ""
&� "DEF PROCDrawObjects"
'� " REPEAT"
(%� "  SYS ""Draw_Stroke"",square%"
)0� "  PROCPath_Transform(square%,translate%)"
*� "  x$=GET$"
+� " UNTIL FALSE"
,� "ENDPROC"
-� 1
.!� i%=1 �  19 : � x$ : � x$ :�
/� 7
0*� '"Press space bar! (ESC to finish)."
1�
2
�
00000000  0d 00 01 09 f2 4c 69 73  74 0d 00 02 1f c8 9b 20  |.....List...... |
00000010  22 50 61 74 68 4c 69 62  3a 4f 53 5f 75 6e 69 74  |"PathLib:OS_unit|
00000020  73 2e 50 61 74 68 73 22  0d 00 03 24 c8 9b 20 22  |s.Paths"...$.. "|
00000030  50 61 74 68 4c 69 62 3a  4f 53 5f 75 6e 69 74 73  |PathLib:OS_units|
00000040  2e 54 72 61 6e 73 66 6f  72 6d 73 22 0d 00 04 2b  |.Transforms"...+|
00000050  73 71 75 61 72 65 25 3d  a4 50 61 74 68 5f 43 72  |square%=.Path_Cr|
00000060  65 61 74 65 53 71 75 61  72 65 28 32 30 30 2c 32  |eateSquare(200,2|
00000070  30 30 2c 34 30 30 29 0d  00 05 14 f2 43 72 65 61  |00,400).....Crea|
00000080  74 65 54 72 61 6e 73 66  6f 72 6d 0d 00 06 10 f2  |teTransform.....|
00000090  44 72 61 77 4f 62 6a 65  63 74 73 0d 00 07 05 e0  |DrawObjects.....|
000000a0  0d 00 08 04 0d 00 09 16  dd 20 f2 43 72 65 61 74  |......... .Creat|
000000b0  65 54 72 61 6e 73 66 6f  72 6d 0d 00 0a 26 20 f2  |eTransform...& .|
000000c0  50 61 74 68 5f 43 72 65  61 74 65 54 72 61 6e 73  |Path_CreateTrans|
000000d0  66 6f 72 6d 28 74 72 61  6e 73 6c 61 74 65 25 29  |form(translate%)|
000000e0  0d 00 0b 28 20 f2 50 61  74 68 5f 54 72 61 6e 73  |...( .Path_Trans|
000000f0  6c 61 74 69 6f 6e 28 74  72 61 6e 73 6c 61 74 65  |lation(translate|
00000100  25 2c 32 30 2c 32 30 29  0d 00 0c 05 e1 0d 00 0d  |%,20,20)........|
00000110  04 0d 00 0e 12 dd 20 f2  44 72 61 77 4f 62 6a 65  |...... .DrawObje|
00000120  63 74 73 0d 00 0f 06 20  f5 0d 00 10 1e 20 20 c8  |cts.... .....  .|
00000130  99 20 22 44 72 61 77 5f  53 74 72 6f 6b 65 22 2c  |. "Draw_Stroke",|
00000140  73 71 75 61 72 65 25 0d  00 11 29 20 20 f2 50 61  |square%...)  .Pa|
00000150  74 68 5f 54 72 61 6e 73  66 6f 72 6d 28 73 71 75  |th_Transform(squ|
00000160  61 72 65 25 2c 74 72 61  6e 73 6c 61 74 65 25 29  |are%,translate%)|
00000170  0d 00 12 0a 20 20 78 24  3d be 0d 00 13 08 20 fd  |....  x$=..... .|
00000180  20 a3 0d 00 14 05 e1 0d  00 15 04 0d 00 16 0b dd  | ...............|
00000190  20 f2 4c 69 73 74 0d 00  17 07 eb 20 eb 0d 00 18  | .List..... ....|
000001a0  07 fb 20 32 0d 00 19 40  f1 20 22 45 58 41 4d 50  |.. 2...@. "EXAMP|
000001b0  4c 45 20 33 3a 20 54 52  41 4e 53 4c 41 54 49 4e  |LE 3: TRANSLATIN|
000001c0  47 20 41 20 53 51 55 41  52 45 2c 20 62 79 20 28  |G A SQUARE, by (|
000001d0  32 30 2c 32 30 29 20 4f  53 20 75 6e 69 74 73 22  |20,20) OS units"|
000001e0  20 3a 20 f1 0d 00 1a 26  dc 20 4c 49 42 52 41 52  | : ....&. LIBRAR|
000001f0  59 20 22 50 61 74 68 4c  69 62 3a 4f 53 5f 75 6e  |Y "PathLib:OS_un|
00000200  69 74 73 2e 50 61 74 68  73 22 0d 00 1b 2b dc 20  |its.Paths"...+. |
00000210  4c 49 42 52 41 52 59 20  22 50 61 74 68 4c 69 62  |LIBRARY "PathLib|
00000220  3a 4f 53 5f 75 6e 69 74  73 2e 54 72 61 6e 73 66  |:OS_units.Transf|
00000230  6f 72 6d 73 22 0d 00 1c  30 dc 20 22 73 71 75 61  |orms"...0. "squa|
00000240  72 65 25 3d 46 4e 50 61  74 68 5f 43 72 65 61 74  |re%=FNPath_Creat|
00000250  65 53 71 75 61 72 65 28  32 30 30 2c 32 30 30 2c  |eSquare(200,200,|
00000260  34 30 30 29 22 0d 00 1d  1b dc 20 22 50 52 4f 43  |400)"..... "PROC|
00000270  43 72 65 61 74 65 54 72  61 6e 73 66 6f 72 6d 22  |CreateTransform"|
00000280  0d 00 1e 17 dc 20 22 50  52 4f 43 44 72 61 77 4f  |..... "PROCDrawO|
00000290  62 6a 65 63 74 73 22 0d  00 1f 0b dc 20 22 45 4e  |bjects"..... "EN|
000002a0  44 22 0d 00 20 08 dc 20  22 22 0d 00 21 1f dc 20  |D".. .. ""..!.. |
000002b0  22 44 45 46 20 50 52 4f  43 43 72 65 61 74 65 54  |"DEF PROCCreateT|
000002c0  72 61 6e 73 66 6f 72 6d  22 0d 00 22 2d dc 20 22  |ransform".."-. "|
000002d0  20 50 52 4f 43 50 61 74  68 5f 43 72 65 61 74 65  | PROCPath_Create|
000002e0  54 72 61 6e 73 66 6f 72  6d 28 74 72 61 6e 73 6c  |Transform(transl|
000002f0  61 74 65 25 29 22 0d 00  23 2f dc 20 22 20 50 52  |ate%)"..#/. " PR|
00000300  4f 43 50 61 74 68 5f 54  72 61 6e 73 6c 61 74 69  |OCPath_Translati|
00000310  6f 6e 28 74 72 61 6e 73  6c 61 74 65 25 2c 32 30  |on(translate%,20|
00000320  2c 32 30 29 22 0d 00 24  0f dc 20 22 45 4e 44 50  |,20)"..$.. "ENDP|
00000330  52 4f 43 22 0d 00 25 08  dc 20 22 22 0d 00 26 1b  |ROC"..%.. ""..&.|
00000340  dc 20 22 44 45 46 20 50  52 4f 43 44 72 61 77 4f  |. "DEF PROCDrawO|
00000350  62 6a 65 63 74 73 22 0d  00 27 0f dc 20 22 20 52  |bjects"..'.. " R|
00000360  45 50 45 41 54 22 0d 00  28 25 dc 20 22 20 20 53  |EPEAT"..(%. "  S|
00000370  59 53 20 22 22 44 72 61  77 5f 53 74 72 6f 6b 65  |YS ""Draw_Stroke|
00000380  22 22 2c 73 71 75 61 72  65 25 22 0d 00 29 30 dc  |"",square%"..)0.|
00000390  20 22 20 20 50 52 4f 43  50 61 74 68 5f 54 72 61  | "  PROCPath_Tra|
000003a0  6e 73 66 6f 72 6d 28 73  71 75 61 72 65 25 2c 74  |nsform(square%,t|
000003b0  72 61 6e 73 6c 61 74 65  25 29 22 0d 00 2a 11 dc  |ranslate%)"..*..|
000003c0  20 22 20 20 78 24 3d 47  45 54 24 22 0d 00 2b 14  | "  x$=GET$"..+.|
000003d0  dc 20 22 20 55 4e 54 49  4c 20 46 41 4c 53 45 22  |. " UNTIL FALSE"|
000003e0  0d 00 2c 0f dc 20 22 45  4e 44 50 52 4f 43 22 0d  |..,.. "ENDPROC".|
000003f0  00 2d 07 fb 20 31 0d 00  2e 21 e3 20 69 25 3d 31  |.-.. 1...!. i%=1|
00000400  20 b8 20 20 31 39 20 3a  20 f3 20 78 24 20 3a 20  | .  19 : . x$ : |
00000410  f1 20 78 24 20 3a ed 0d  00 2f 07 fb 20 37 0d 00  |. x$ :.../.. 7..|
00000420  30 2a f1 20 27 22 50 72  65 73 73 20 73 70 61 63  |0*. '"Press spac|
00000430  65 20 62 61 72 21 20 28  45 53 43 20 74 6f 20 66  |e bar! (ESC to f|
00000440  69 6e 69 73 68 29 2e 22  0d 00 31 05 e1 0d 00 32  |inish)."..1....2|
00000450  04 0d ff                                          |...|
00000453