home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / educatio / tw31.zip / TWTUT3.CHP < prev    next >
Text File  |  1993-05-25  |  9KB  |  340 lines

  1. %
  2. #EF
  3. #TGETTING COLORFUL
  4. #C2,R5
  5. There are two ways of adding color to your ~M~Itutorials~N. They can be added by
  6. using the ~HCommands~N which begin with the ~C~I#~N sign, called ~HControl Commands~N or
  7. through ~HInline Commands~N. The ~C~I#~H Control Command~N colors affect whole screens,
  8. while the ~HInline~N colors affect individual letters or words.
  9.  
  10. ~HInline Commands~N begin with ~H~~~N and can be used anywhere in the text.
  11. The ~HQuick Reference~N print-out and the ~c~ZHelp~N system in the ~H~bTutorialWriter~N
  12. ~HEditor~N give a full description of the ~HColor Codes~N.
  13.  
  14.  
  15. There are ~Height background colors~N available, and ~Hsixteen text colors~N. The
  16. eight background colors are represented by ~Ha lower case letter~N e.g.
  17. ~H~~c~N which means '~ccyan background~N'.
  18.  
  19.  
  20. Text colors use the ~Hsame eight letters~N, but in ~HUPPER CASE~N, so ~H~~C~N means
  21. '~Ccyan text~N'.  A ~Hfurther eight text colors ~Nare available by adding ~H~~I~N
  22. which means '~Hintense~N'. ~H~~C~~I~N means '~C~ILightCyan text~N'.
  23. #W
  24. %
  25. #EF
  26. #T15,1
  27. #C2,R5
  28. The ~HCommands~N can be combined, of course, so ~H~~b~~C~~I~N means ~b~C~ILightCyan
  29.  
  30. on a Blue background~N.
  31.  
  32.  
  33. And text colors can be made to blink or flash by adding ~H~~F~N. ~H~~b~~C~~I~~F~N
  34.  
  35. means ~b~C~I~Fblinking LightCyan on a Blue background~N.
  36.  
  37.  
  38.  
  39. ~HOnce a color has been set, it will continue until it is changed by another
  40.  
  41. Command~N.  To make things easier, two ~HCommands~N can be predefined as default
  42.  
  43. colors, using the ~C~IConfigure Tutorial~N option.  ~H~~N~N is the 'normal text color' and
  44.  
  45. ~H~~H~N is the ~HHighlight color~N.
  46. #WP
  47. %
  48. #EF
  49. #T15,1
  50. #C2,R6
  51. This text is in default normal color.
  52.  
  53. ~~HThis text is in default hilite~~N     ~HThis text is in default hilite~N
  54.  
  55.   (~C~IThe ~~N at the end switches it back to default normal color.~N)
  56. #D10
  57.  
  58.  
  59.  
  60. ~~GThis text is green~~N                     ~GThis text is green~N
  61. ~~G~~IThis text is lightgreen~~N              ~G~IThis text is lightgreen~N
  62. ~~G~~FThis is green blinking~~N               ~G~FThis is green blinking~N
  63. ~~G~~I~~FThis is lightgreen blinking~~N        ~G~I~FThis is lightgreen blinking~N
  64. #D10
  65.  
  66.  
  67.  
  68. ~~c~~ZBlack text on a cyan background~~N       ~c~ZBlack text on a cyan background~N
  69. ~~c~~Z~~F Now it is blinking ~~N.               ~c~Z~F Now it is blinking ~N
  70. #WP
  71. %
  72. #EF
  73. #T15,1
  74. #C2,R5
  75. And there are two non-color ~HInline Commands~N.
  76.  
  77.  
  78. ~H~~K~N writes to the screen with a click (~H~~k~N resets it ) and
  79.  
  80. ~H~~S~N writes to the screen slowly (~H~~s~N stops it).
  81.  
  82.  
  83.  
  84. ~~K~~HThis will write in default hilite with a clicking sound.~~N~~k
  85. #D30
  86.  
  87. ~K~HThis will write in default hilite with a clicking sound.~N~k
  88.  
  89.  
  90.  
  91. ~~S~~M~~IThis will write slowly but silently in lightmagenta~~N~~s.
  92. #D30
  93.  
  94. ~S~M~IThis will write slowly but silently in lightmagenta~N~s.
  95. #WP
  96. %
  97. #EF
  98. #T15,1
  99. #C2,R5
  100. When you are creating a ~HCHAPTER~N, I recommend that you type out what you
  101.  
  102. want to say and get it positioned on the screen the way you want it, before
  103.  
  104. you insert the ~HInline Command Codes~N.  When you do insert the ~HCodes~N, some of
  105.  
  106. the words may be pushed off the edge of the screen. When ~G~ITWTEACH~N reads the
  107.  
  108. file, the ~H~~ Code~N and the letter following it are not printed, so your text
  109.  
  110. will be positioned on the screen as it was before the ~HCodes~N were inserted.
  111.  
  112. But if you put the ~HCodes~N in as you write the text, it can be difficult to
  113.  
  114. visualize how it will appear on the final screen.
  115.  
  116.  
  117. By the way, this is the reason the ~H~bTutorialWriter~C~I~z Editor~N doesn't word-wrap!
  118. #WP
  119. %
  120. #EF
  121. #T15,1
  122. #C2,R5
  123. In the last Chapter we covered the ~C~I#Cx~N and ~C~I#Ry~H Commands~N which position the
  124. Cursor. Here's a bit more detail about them, and things they let you do.
  125.  
  126. The ~HCommand~C~I #Cx1~N sets the cursor to ~HColumn x1 of the current row~N.  The screen
  127. has 80 columns, numbered 1 thru 80, starting from the left. When the Column
  128. has been set, ~Hit remains at that setting until it is reset~N.  For example,
  129. let's change the Column setting to 40, then print three lines to the screen:
  130.  
  131. ~H#C40
  132. First row
  133. next row
  134. next row~N
  135. #W
  136. #EL,25
  137. #C40,R14
  138. ~HFirst row
  139. next row
  140. next row~N
  141. #C2,R20
  142. #D2
  143. The ~HCommand ~C~I#Ry1~N sets the cursor at ~HRow y1 at the current cursor position~N.
  144. The screen has 25 Rows, numbered 1 thru 25, starting from the top.  ~HThe Row
  145. is automatically increased at the end of each line~N.
  146. #WP
  147. %
  148. #EF
  149. #T15,1
  150. #C2,R5
  151. These two ~HCommands~N can be joined by replacing the ~C~I#~N in front of ~C~I#Ry1~N with a
  152.  
  153. comma.  ~C~I#Cx1,Ry1~N means ~Hset the cursor at Column x1, Row y1~N.  This joined
  154.  
  155. ~HCommand~N gives complete control over the cursor, and allows you to highlight
  156.  
  157. items on the screen with ~HInline Commands~N. For example, let's change part of
  158.  
  159. Row 5 :
  160.  
  161.  
  162. ~H#C28,R5
  163. ~~H~~Fjoined by replacing~~N
  164. ~H#D5
  165. ~H#C28,R5
  166. ~~H~~rjoined by replacing~~N
  167. ~H#D5
  168. ~H#C28,R5
  169. ~~Hjoined by replacing~~N
  170. #D20
  171. #C28,R5
  172. ~H~Fjoined by replacing
  173. #D5
  174. #C28,R5
  175. ~H~rjoined by replacing
  176. #D5
  177. #C28,R5
  178. ~Hjoined by replacing
  179. #WP
  180. %
  181. #EF
  182. #T15,1
  183. #C2,R6
  184. Another ~HCommand~N that you may have noticed on the previous screen is the
  185.  
  186. ~C~I#Dn~H Command~N. It is used in almost all these examples and is a very useful
  187.  
  188. ~HCommand~N.
  189.  
  190.  
  191.  
  192. It delays printing to the screen for ~C~In~H seconds, or until a key or the
  193.  
  194. MOUSE Button is pressed~N.
  195.  
  196.  
  197.  
  198. So if nothing seems to be happening in this ~G~ITutorial~N and you are ready to
  199.  
  200. move on, press a key or the MOUSE button.
  201. #WP
  202. %
  203. #EF
  204. #T
  205. #C2,R5
  206. Now we'll look at adding color through two of the ~HControl Commands~N you met in
  207.  
  208. the last Chapter :-
  209.  
  210.  
  211. ~H #T[Fore,Back][,titlename]
  212.  #EF[Fore,Back]~N
  213.  
  214.  
  215.  
  216. The colors for ~C~I#~H Commands~N are represented by numbers and you can refer to
  217.  
  218. them on your ~HQuick Reference~N printout as we go along. And with all these
  219.  
  220. ~HCommands~N, carefully study the use of ~C~ICommas as separators~N. If the ~HCommas~N are
  221.  
  222. not properly placed, the ~HCommand~N will not behave as expected.
  223. #WP
  224. %
  225. #EF
  226. #T15,1
  227. #C2,R5
  228. The ~HCommand~N to put a title on the screen is ~C~I#T~N. The first time it is used in
  229. a ~G~ITutorial~N it is necessary to state the titlename, since there is no default.
  230.  
  231. ~H#TMy Chosen Title~N
  232. #D20
  233. #TMy Chosen Title
  234. #C2,R11
  235. When the title has been defined, ~C~I#T~N will put it on the screen in the default
  236. colors of white on red.  To keep the same title, but change its colors, the
  237. command is ~C~I#TFore,Back~N.  Let's try blue on gray.
  238.  
  239. ~H#T1,7~N
  240. #D20
  241. #T1,7
  242. #C2,R18
  243. To change both the colors and the title use the ~HCommand~C~I #TFore,Back,newtitle~N.
  244. This time we'll choose black on cyan.
  245.  
  246. ~H#T0,3,New Title~N
  247. #D20
  248. #T0,3,New Title
  249. #WP
  250. %
  251. #EF
  252. #TGETTING COLORFUL
  253. #C2,R5
  254. ~C~I#EF[Fore,Back]~N clears the screen, removing the title.  Used as ~C~I#EF~N it
  255.  
  256. clears it to the default colors you define using the ~M~IConfigure Tutorial~N menu
  257.  
  258. option. To change the text and background colors, put in values for ~C~IFore~N and
  259.  
  260. ~C~IBack~N. The following Command will change the screen colors to black on white.
  261.  
  262. ~H#EF,0,7~N
  263. #D20
  264. #EF,0,7
  265. #C2,R8
  266. The screen colors are now black on white, but the title has gone. The cursor
  267.  
  268. is positioned, by default, at column 1 on row 1 and you must reposition it.
  269.  
  270. When you use the ~B#EF Command~Z~w, you will also need to use the ~B#T Command~Z~w.
  271.  
  272. Then the cursor will be positioned, by default, at column1 on row 4 and you
  273.  
  274. reposition it with the ~B~w#Cx,Ry Command~Z~w. For example, this will change
  275.  
  276. the title color to Intense White on Blue and start writing at Col2, Row22
  277.  
  278. ~B~w#T15,1~Z~w
  279. ~B~w#C2,R22~Z~w
  280. #D20
  281. #T15,1
  282. #C2,R22
  283. ~Z~wNow change the Title color back to its Default colors.
  284. ~B#T~N
  285. #D10
  286. #T
  287. #EL,25,14,0
  288. #WP
  289. %
  290. #EF
  291. #T
  292. #C2,R5
  293. There are two other erase ~HCommands~N.  ~C~I#EL,y1~N erases the line at ~HRow ~C~Iy1~N.
  294. The other, ~C~I#ES,x1,y1,x2,y2[,Fore,Back]~N erases a section of the screen from
  295. ~HColumn ~C~Ix1~N, ~HRow ~C~Iy1~N to ~HColumn ~C~Ix2~N, ~HRow ~C~Iy2~N. The color of the erased section
  296. can be changed by inserting values for ~C~IFore~N and ~C~IBack~N. ~HBear in mind that
  297. these colors will remain in effect until you change them!~N  When the section
  298. is erased, the cursor is placed in the top left hand corner of that section.
  299.  
  300.  
  301. Here's an example. Note that when the line at Row 5 is erased, the color is
  302. still red. The ~H~~N~N changes it back to normal default, and the line is cleared
  303. again, this time in black.
  304.  
  305. ~H#ES,20,6,40,11,15,4
  306. ~HYou are here
  307. ~H#EL,5
  308. ~H~~N
  309. ~H#EL,5
  310. #WN
  311. #EL,25
  312. #ES,20,6,40,11,15,4
  313. You are here
  314. #D5
  315. #EL,5
  316. ~N
  317. #D3
  318. #EL,5
  319. #WP
  320. %
  321. #EF
  322. #TGETTING COLORFUL
  323. #C2,R7
  324. That's the end of this Chapter on c~G~Io~B~Il~Ho~R~Ir~C~Is~N.
  325.  
  326.  
  327.  
  328. With these ~HCommands~N and the ones you learned in ~HChapter 2~N, you can create
  329.  
  330. some pretty nice ~M~Itutorials~N.
  331.  
  332.  
  333.  
  334. But the next Chapter will show you how to get your message across using some
  335.  
  336. ~Hattention-getting screens~N.
  337.  
  338. #WP
  339. #X
  340.