Twiddle

Immediate-mode controls · Ruby

Put the controls beside the render.

A headless-friendly UI toolkit that renders into Tessel images and consumes plain event hashes.

gem install twiddle

Parameters− □ ×
speed1.8
samples32
denoiseon
tint■
Twiddle::Contextwidgets → Tessel image

A UI for tests and windows.

Compose deterministic controls and draw the same UI in a renderer or RBGL window.

01

Tune values

Sliders, drags, text fields, color editors, and choices.

02

Organize panels

Plots, progress bars, collapsing headers, tooltips, and scrolling.

03

Route input

Keyboard, mouse, wheel, modifiers, and logical scaling.

A small first step

Start with one example.

Install the gem, then follow the project guide for platform requirements and the full API.

Read the installation guide ↗

require "tessel"
require "twiddle"

image = Tessel::Image.new(480, 320, fill: "#101827")
ui = Twiddle::Context.new
ui.frame(events: []) do |g|
  g.window("Parameters") do
    g.slider("speed", 1.0, 0.0..4.0)
  end
end
ui.render(image)