Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/help/rest/linemenu.txt
blob: 32c630afd3c62a8824a15a656a041d9c3410c307 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.. _linemenu:
.. _line:

.. index::
   pair: functions; Line drawing
   pair: command; line

Line drawing functions
======================

XaoS has support for drawing lines. These functions are available only in
animations and could be used to show some parts of fractals or draw simple
diagrams. See the tutorial ":tutor:`Introduction to fractals <intro.xaf>`" for examples of this feature.

Lines can be drawn in **screen** coordinates, where 0,0 is the top left corner
and 1,1 is bottom right, **scaled** coordinates, which are similar, but scaled
to keep 0,0--1,1 rectangular, or **Fractal** coordinates, to draw a line at an
exact position on the screen.

The color of the line should be specified by the :ref:`color <color>` command.
You might draw an arbitrary number of lines and, later, morph them. Each line
is identified by a unique numeric key; the current key can be set using
linekey. Commands for changing lines operate on the line with the current key.
(Lines drawn in sequence have consecutive numbers.)

For example::

	(color 'red) 
	(line 'scaled 0.3 0.5 0.7 0.5) 
	(line 'scaled 0.3 0.5 0.7 0.5)
	(line 'scaled 0.3 0.5 0.3 0.5) 
	(line 'scaled 0.7 0.5 0.7 0.5) 
	(linekey 0)
	(morphline 'scaled 0.3 0.3 0.7 0.3) 
	(morphline 'scaled 0.3 0.7 0.7 0.7)
	(morphline 'scaled 0.3 0.3 0.3 0.7) 
	(morphline 'scaled 0.7 0.3 0.7 0.7) 
	(usleep 1000000)

Creates line morphing to rectangle.

.. toctree::

   line
   morphline
   morphlastline
   linekey
   clearline
   clearlines