Skip to reading
GUI: Knobs, Dials and Gauges

Tune an FM station

Edition 0.86.4.5

New 0.86.4.5 field guide. Rotary Value bindings use Raw JSON in this edition. Clock hands are independent; running-clock or geared behavior is authored separately. Examples can be built in an existing project; the optional workbench is part of the PCA3D source package.

Download PDFView illustrations
On this page

WORKED EXAMPLE / FM RADIO

Make each press change exactly one station step. Start on 96.0 MHz and let the player tune across a 20 MHz band.

In Variable Designer, add a number variable with ID frequency and starting 1 value 96. In your GUI, add a Knob. In its rotary dialog choose Knob, set Face caption to FM and Value suffix to a space followed by MHz. Enable Show primary readout.

Scroll to Hand 1. Keep the Handle ID as value. Type the following settings and 2 choose OK. Use the hand editor for the fractional step.

Two fields, two jobs#

Step controls how much the player moves per nudge. Write value to variable tells the rest of the game which reading changed.

The radio’s Hand 1 record in the rotary inspector.

Source table from Tune an FM station, page 3
MinimumMaximumStepInitial valueWrite value to variable
881080.296frequency

Keep Start angle at −135°, Sweep at 270° and Wrap at full turn off. One 3 division on the drawn scale does not have to equal one step. Ten divisions give a readable face while each keypress still moves 0.2 MHz.

Check the exact station#

After three Right presses the readout is 96.6 MHz. Start a Trace capture. In Debug & Profile → State, evaluate global.frequency. If a puzzle rewards a narrow station, compare a small range around its center to accommodate decimal arithmetic.

Page 3 of 11Permalink
Go to page