Golly 2.9b1 and the overlay
Posted: November 14th, 2016, 6:55 am
The 1st beta version of Golly 2.9 is now available:
EDIT: Download links have been removed now that version 3.0b1 has been released.
This version has a new feature called the overlay -- a rectangular area of pixels that can be displayed above the current layer. Lua scripts have total control over what the overlay looks like and how the user interacts with it. Here's a simple example:
All the overlay commands are documented in Help > Overlay.
The Scripts/Lua folder has a number of scripts that illustrate how the overlay can be used to extend Golly in all sorts of ways. A good place to start would be overlay-demo.lua. It contains examples of most of the overlay commands. More complex scripts are also supplied:
breakout.lua -- A script by Chris Rowett that shows how the overlay can be used to create an interactive game.
hexgrid.lua -- Creates a true hexagonal grid for rules that use a hexagonal neighborhood.
lifeviewer.lua -- Another script by Chris that displays patterns like LifeViewer, with history, smooth non-integer scaling, and rotation. Still a work in progress.
pop-plot.lua -- This script has been updated to use the overlay to display nicer looking plots that can be saved in a PNG file.
Apart from the overlay there are a number of other important changes in this version, so make sure you read Help > Changes.
Please note that we're still working on the overlay API. There's likely to be a number of beta releases before the final version is ready for sourceforge (probably well into next year).
Feedback, suggestions, bug reports are all welcome!
EDIT: Download links have been removed now that version 3.0b1 has been released.
This version has a new feature called the overlay -- a rectangular area of pixels that can be displayed above the current layer. Lua scripts have total control over what the overlay looks like and how the user interacts with it. Here's a simple example:
Code: Select all
local g = golly()
local ov = g.overlay
-- create a 400x300 overlay in the middle of the layer
ov("create 400 300")
ov("position middle")
-- fill it with a translucent blue background
ov("rgba 0 0 255 128")
ov("fill")
-- draw some white text in the top left corner
ov("rgba 255 255 255 255")
ov("text msg Click to exit.")
ov("blend 1")
ov("paste 10 10 msg")
g.update()
-- wait for user to click in the overlay
while true do
local event = g.getevent()
if event:find("^oclick") then break end
end
ov("delete") -- remove the overlay
The Scripts/Lua folder has a number of scripts that illustrate how the overlay can be used to extend Golly in all sorts of ways. A good place to start would be overlay-demo.lua. It contains examples of most of the overlay commands. More complex scripts are also supplied:
breakout.lua -- A script by Chris Rowett that shows how the overlay can be used to create an interactive game.
hexgrid.lua -- Creates a true hexagonal grid for rules that use a hexagonal neighborhood.
lifeviewer.lua -- Another script by Chris that displays patterns like LifeViewer, with history, smooth non-integer scaling, and rotation. Still a work in progress.
pop-plot.lua -- This script has been updated to use the overlay to display nicer looking plots that can be saved in a PNG file.
Apart from the overlay there are a number of other important changes in this version, so make sure you read Help > Changes.
Please note that we're still working on the overlay API. There's likely to be a number of beta releases before the final version is ready for sourceforge (probably well into next year).
Feedback, suggestions, bug reports are all welcome!