if (do_name() != 'Home') : ?>
endif ?>
Posted by Josh Caswell on Jan 10, 2011
include("util/comment.php"); ?>
You're right. There's a Context object which maintains a bunch of state for the running script. Things like fill and stroke colors, stroke width, transformations. It is also what allows you call oval and rect without having to import anything.
_ctx is the name of the instance that exists when your script is run. You can access it yourself if you want, just like any other variable. (for example, you can say _ctx.oval(10,10,10,10). You'll find the definition of Context in the NodeBox source code, (in file /src/nodebox/graphics/__init__.py) which you can get at http://dev.nodebox.net/
What is _ctx?
Posted by Benjamin on Jan 05, 2011Hi,
I'm currently looking at the source code of the lsystem library.
There, I've stumbled upon '_ctx'.
An example is
elif rule == "|": _ctx.rotate(180)
From the expression itself I think it's about some context, but I don't get what it actually is.
Best,
Benjamin