Below is the documentation for all currently-available ZineScript functions, prefixed by zine:
. Functions are listed in alphabetical order. To see the documentation in action, check out the example programs!
zine:add(element) -> nil
Add an element to the active page. zine:startpage must be called before calling zine:add
.
zine:author(authorName) -> nil
Specify the author’s name. Stored in the zine.author_name
variable.
zine:background(color) -> nil
Set the background color for the active page. zine:startpage must be called before calling zine:background
. Note that colors are stored as strings such as “red”, “yellow”, or “forestgreen”. You can also use hex values in the following format: #rrggbb
.
zine:blur(surface) -> Surface
Apply a gaussian blur to a given surface.
zine:blur
returns the surface object that was passed into it.
zine:contour(surface) -> Surface
Apply a contour effect to a given surface.
zine:contour
returns the surface object that was passed into it.
zine:endpage() -> nil
Make it so that there is no active page.
zine:fill(optionsTable) -> Surface
Fill a surface with a given color.
Options for zine:fill
are as follows:
zine:fill
returns the surface object that was passed into it.
zine:image(optionsTable) -> Surface
Create a new image surface from a given path.
Options for zine:image
are as follows:
x
position relative to the left of the page, measured in inchesy
position relative to the top of the page, measured in incheszine:image
returns a surface object.
zine:invert(surface) -> Surface
Invert the color of every pixel in the surface.
zine:invert
returns the surface object that was passed into it.
zine:newSurface(optionsTable) -> Surface
Create a new surface at the given position with the given dimensions.
Options for zine:newSurface
are as follows:
x
position relative to the left of the page, measured in inchesy
position relative to the top of the page, measured in incheszine:newSurface
returns a surface object.
zine:noise(optionsTable) -> Surface
Add colored noise to the surface provided.
Options for zine:noise
are as follows:
{ x, y, width, height }
, all measured in incheszine:noise
returns the surface object that was passed into it.
zine:pageHeight() -> number
Return the height per page, measured in inches.
zine:pageWidth() -> number
Return the width per page, measured in inches.
zine:random() -> number
Return a random floating point number in the range 0-1.
zine:randomColor() -> string
Return a random color represented as a hexadecimal string in the format #rrggbb
.
zine:render() -> nil
Render the zine to an internal image. Required to be called before zine:save.
zine:rotate(optionsTable) -> Surface
Rotate a surface with a given angle, measured in degrees.
Options for zine:rotate
are as follows:
Note that positive angles are counterclockwise.
zine:rotate
returns the surface object that was passed into it.
zine:save(path) -> nil
Save the internally rendered zine to the given path. Cannot be called before zine:render.
zine:scale(optionsTable) -> Surface
Scale a surface by a given factor.
Options for zine:scale
are as follows:
zine:scale
returns the surface object that was passed into it.
zine:spraypaint(optionsTable) -> Surface
Add weighted, colored noise to the surface provided.
Options for zine:spraypaint
are as follows:
{ x, y, width, height }
, all measured in incheszine:spraypaint
returns the surface object that was passed into it.
zine:startpage(pageNumber) -> nil
Sets the active page. Note that while you can set pages outside of the range 1-8, they will not be rendered.
zine:tableToColor(colorTable) -> string
From a color that is represented as a table in the format { red, green, blue }
, return a color represented as a hexadecimal string in the format #rrggbb
.
zine:text(optionsTable) -> Surface
Create a new text surface.
Options for zine:text
are as follows:
x
position relative to the left of the page, measured in inchesy
position relative to the top of the page, measured in incheszine:text
returns a surface object.
zine:title(zineTitle) -> nil
Specify the zine’s title. Stored in the zine.title_text
variable.
zine:wavy(optionsTable) -> Surface
Make a surface nice and wavy.
Options for zine:wavy
are as follows:
zine:wavy
returns the surface object that was passed into it.