From 0424a2a795fb3da1c18284e2c86dc76c9ac4c0d3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 13 Aug 2010 12:00:22 +0200 Subject: config files. frame loading now via LPEG. --- mpliferc-global.lua | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 mpliferc-global.lua (limited to 'mpliferc-global.lua') diff --git a/mpliferc-global.lua b/mpliferc-global.lua new file mode 100644 index 0000000..83ab6eb --- /dev/null +++ b/mpliferc-global.lua @@ -0,0 +1,56 @@ +-- +-------------------------------------------------------------------------------- +-- FILE: mpliferc-global.lua +-- USAGE: with ConTeXt +-- DESCRIPTION: default settings for the automaton module +-- AUTHOR: Philipp Gesang (Phg), +-- VERSION: 1.0 +-- CREATED: 13/08/10 10:35:46 CEST +-------------------------------------------------------------------------------- +-- + +if not mplife then return 1 end + +mplife.setup.global = {} + +do + local c = {} + + c.file = "examples/sships.gol" + c.rule = gol.parse_rule("B3/S23") -- default Conway + c.init = gol.parse_file(c.file) + c.last = c.init -- for successive mode + + c.pensize = .1 + c.color = { r = .6, g = .6, b = .8 } + c.opacity = 1/3 + c.fade = true + c.gestalt = "unitsquare" -- try "unitcircle" + + c.firstframe = 1 + c.frames = 5 + + c.preamble = [[ +\setupcolors[state=start] +\setupbackgrounds[state=start] +\setuppapersize[S6][S6] + +\setuppagenumbering[state=stop,location=] + +\defineoverlay[back][\ctxlua{mplife.successive()}] + +\setupbackgrounds [page] [background=back] +]] + c.before_frame = [[ +\startMPcode +pickup pencircle xyscaled (.25*]] .. c.pensize .. [[pt, ]] .. c.pensize .. [[pt) rotated 45; +]] + c.after_frame = [[ +currentpicture := currentpicture xysized (\the\paperwidth, \the\paperheight); +\stopMPcode +]] + + mplife.setup.global = c +end + +return mplife.setup.global -- cgit v1.2.3