########################### # RadViewer (Don't ask) # # Sample script file # ########################### # # Comments are started with a # and continue until end of line # Don't use them in the middle of a line unless you are sure the # next line continues the data set for the current command # Otherwise the next command will ber ead in as data. # We try to recover from this, but you are likely to lose two commands. # Whitespace is not significant. # # All co-ordinates are relative to the maxx and maxy parameters you specify to the applet # # This script is loaded by the script parameter the applet has - it should be in the same # directory as the applet. Otherwise your security settings will probably stop it working. # # Directives that are not understood are skipped - but be careful # if you have valid directives inside a skipped directive, it will # go ahead and try and use them. IOW - don't use directives the version # of the applet that you have doens't understand. ############################ # Begin crappy sample script cubic 0 100 200 0 300 400 400 200 #line 250 0 250 500 cubic 400 200 433 150 465 250 500 300 line 200 200 400 400 line 200 400 400 200 #line 250 0 250 500 line 200 400 400 400 image 400 0 500 100 kitty.jpg image 0 350 150 500 hunter.png line 200 200 200 400 pencolour 255 0 0 255 kline 6 0 0 100 0 100 100 50 150 0 100 0 0 pencolour 0 0 0 255 line 400 400 400 200 line 400 200 200 200 oval 200 200 400 400 pencolour 64 64 255 255 font 50 1 Serif text 0 300 RadViewer text 100 360 (c) Vitenka end # Stuff after an 'end' should never be processed ################################################# text 250 250 so this will never be seen # Currently the only directives we understand are: # line sx sy ex ey -- Draws a straight line in current pen color etc. from (sx,sy) to (ex,ey) # cubic sy sy c1x c1y c2x c2y ex ey -- Draws a curve from sx sy to ex ey, bending towards c1 and c2 # oval x1 y1 x2 y2 -- where x1 y1 are the top left and x2 y2 are the bottom right. # kline n x1 y1 x2 y2 ... xn yn -- Draws multiple line segments between the given points # text x y newline terminated string -- note that any whitespace after the first one after the y WILL be printed # pencolour rrr ggg bbb aaa -- Sets the pen colour (red green blue alpha 0-255) # font size style name -- style&1 = bold, &2 = italics. Note that the must only be a single whitespace between style and name (until tokeniser is ficed, anyway) # Note that font size is NOT yet scaled with the image # image x1 y1 x2 y2 filename -- Display the given image, same rules as oval and font # end -- Stop reading the file. # # All drawing is on a canvas that is (maxx,maxy) in size - # the image is then stretched to fit the actual canvas size # # Otherwise a comment in the middle of a line trashes not only # that task, but the next one as well. # Eventually, the applet will probably read svg. But not soon. #