Skip to content

April update: Variables, Hidden Layers and More ​

We've just shipped a batch of new features you've been asking for, plus a few important fixes to smooth things out. You can now use variables for any layer property, hide or show layers, and enjoy smarter layer titles — all designed to give you more control and cleaner output.

Variables for Layer Properties You can now declare variables for things like position, size, color, and text. Just enable “Declare variables”, and those properties will be pulled out into variables at the top of your code. Variable names are based on layer titles — so name them well.

Hide/Show Layers New eye icon in the layer list lets you toggle visibility. Hidden layers won’t appear in the output at all.

Smart Layer Titles for Text By default, a text layer’s content becomes its title. But if you rename the title, it takes priority in the list, keeping things clean.

🔧 Fixes

  • Rounded corners now render with pixel-perfect accuracy
  • Double quotes in text layers are properly escaped
  • Esphome now has a better variable logic and image naming

Let me know what you think — and thanks, as always, for being part of the journey!

The fact is, Lopaka only exists thanks to your support.

If you like what I do, there're plenty of options to support Lopaka development:

How to use variables in practice ​

Variables turn a static mockup into a screen your firmware can update. A typical example is a temperature reading: you design the layout once, then change the text and color at runtime without touching the drawing code.

  1. Select a layer, such as a text layer showing 23°C.
  2. In the Inspector, click the variable toggle next to the property you want to control, such as text, x, y, or color.
  3. Enable Declare variables in Code Settings.

Lopaka moves those values to the top of the generated code as typed declarations, and the draw calls reference them:

cpp
const char* temp_text = "23°C";
int temp_x = 10;

display.setCursor(temp_x, 20);
display.print(temp_text);

Variable names come from the layer name and property, for example temp_text. Rename layers before you copy the code into your project, because renaming a layer later changes its variable names.

Hidden layers and overlays ​

Hidden layers are useful for keeping alternate states in the same screen, such as an error icon or a low-battery warning, without exporting them. For reference images you trace over, use the Overlay option: the layer is dimmed on the canvas and left out of the code.

See Code Generation for the full list of options, and the ESPHome guide for using variables with sensor data.