Class | Gruff::Scene |
In: |
lib/gruff/scene.rb
|
Parent: | Gruff::Base |
A scene is a non-linear graph that assembles layers together to tell a story. Layers are folders with appropriately named files (see below). You can group layers and control them together or just set their values individually.
Examples:
Usage:
g = Gruff::Scene.new("500x100", "artwork/city_scene") g.layers = %w(background haze sky clouds) g.weather_group = %w(clouds) g.time_group = %w(background sky) g.weather = "cloudy" g.time = Time.now g.haze = true g.write "hazy_daytime_city_scene.png"
If there is a file named ‘default.png’, it will be selected (unless other values are provided to override it).
layers | [R] |
An array listing the foldernames that will be rendered, from back to front.
g.layers = %w(sky clouds buildings street people) |
Group layers to input values
g.weather_group = ["sky", "sea", "clouds"]
Set input values
g.weather = "cloudy"