summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex
blob: 2fdb31250511457fe164cdc195dbf5bb130077a4 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
% language=us

\environment luametafun-style
\environment luametafun-mesh-examples

\startcomponent luametafun-mesh

\startchapter[title={Mesh}]

This is more a gimmick than of real practical use. A mesh is a set of paths that
gets transformed into hyperlinks. So, as a start you need to enable these:

\starttyping[option=TEX]
\setupinteraction
  [state=start,
   color=white,
   contrastcolor=white]
\stoptyping

We just give a bunch of examples of meshes. A path is divided in smaller paths and
each of them is part of the same hyperlink. An application is for instance clickable
maps but (so far) only Acrobat supports such paths.

\typebuffer[1][option=TEX]

Such a definition is used as follows. First we define the mesh as overlay:

\starttyping[option=TEX]
\defineoverlay[MyPath1][\useMPgraphic{MyPath1}]
\stoptyping

Then, later on, this overlay can be used as background for a button. Here we just
jump to another page. The rendering is shown in \in {figure} [mesh:1].

\starttyping[option=TEX]
\button
  [height=3cm,
   width=4cm,
   background=MyPath1,
   frame=off]
  {Example 1}
  [realpage(2)]
\stoptyping

\startplacefigure[reference=mesh:1]
    \externalfigure[luametafun-mesh-examples][page=1,width=.45\textwidth]
\stopplacefigure

More interesting are non|-|rectangular shapes so we show a bunch of them. You can
pass multiple paths, influence the accuracy by setting the number of steps and show
the mesh with the tracing option.

\typebuffer[2][option=TEX]
\typebuffer[3][option=TEX]
\typebuffer[4][option=TEX]
\typebuffer[5][option=TEX]
\typebuffer[6][option=TEX]
\typebuffer[7][option=TEX]

This is typical a feature that, if used at all, needs some experimenting but at
least the traced images look interesting enough. The six examples are shown in
\in {figure} [mesh:2].

\startplacefigure[reference=mesh:2]
    \startcombination[2*3]
        {\externalfigure[luametafun-mesh-examples][page=2,width=.45\textwidth]} {\type {MyPath2}}
        {\externalfigure[luametafun-mesh-examples][page=3,width=.45\textwidth]} {\type {MyPath3}}
        {\externalfigure[luametafun-mesh-examples][page=4,width=.45\textwidth]} {\type {MyPath4}}
        {\externalfigure[luametafun-mesh-examples][page=5,width=.45\textwidth]} {\type {MyPath5}}
        {\externalfigure[luametafun-mesh-examples][page=6,width=.45\textwidth]} {\type {MyPath6}}
        {\externalfigure[luametafun-mesh-examples][page=7,width=.45\textwidth]} {\type {MyPath7}}
    \stopcombination
\stopplacefigure

\stopchapter

\stopcomponent