tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/4543-creating-a-canvas-nodeNodeBox: Discussion 2014-09-09T09:06:49Ztag:support.nodebox.net,2012-11-01:Comment/338040742014-07-23T08:30:04Z2014-07-23T08:30:04ZCreating a canvas Node<div><p>Yes, it is. We've built in a way to gain access to the rendering
context. There, you can access data on the current document (called
the NodeLibrary internally).</p>
<p>So you could create a node with one part called "context" of
(custom) type "context". This will take in a <a href=
"https://github.com/nodebox/nodebox/blob/master/src/main/java/nodebox/node/NodeContext.java">
NodeContext</a>. Then you can write something like this (in
Python):</p>
<pre>
<code>def cook(context):
library = context.nodeLibrary
width = float(library.getProperty("canvasWidth"))
height = float(library.getProperty("canvasWidth"))
# Do whatever you want with width / height</code>
</pre>
<p>Hope this helps,</p>
<p>F</p></div>Frederik De Bleser