Modular Fungi Lights Off mode

LightWidget gets drawn with draw() like any other widget, but LightWidget defines draw() as a call to two other functions: drawLight() and drawHalo(). So, your current method works fine if you want (or are content with) Rack drawing its standard “light halo” on top of your widget. Keeping everything in draw() instead would bypass the call to drawHalo().

In Rack v2, lights will no longer come with halos, and the virtual method LightWidget::drawHalo() might or might not even exist anymore.

Besides all that, you’ve got it right with simply inheriting from LightWidget.

1 Like