nodebox / seed

Procedural Content Generator
https://seed.emrg.be/
MIT License
22 stars 8 forks source link

Add function syntax #1

Closed fdb closed 6 years ago

fdb commented 6 years ago

As a user I want to be able to re-use values, e.g. the size of a rectangle to create a square:

root:
- {{ square(5..100) }}

square(size):
- <rect x={{ 0..500 }} y={{ 0..500 }} width={{ size }} height={{ size }} />

A function can have multiple parameters when called:

root:
- {{ square(5..100, color) }}

Parameters are either names (causing a random lookup), value ranges, ...