anyuianyui
anyui-LIVE
anyui
Feedback
  • English
  • 中文
anyui-LIVE
anyui
Feedback
  • English
  • 中文
  • Introduction

    • Introduction
  • Get Started

    • Get Started
  • Workspace

    • Workspace
  • Editor

    • Overview
    • Toolbar
    • Navigator
    • Inspector
    • Statusbar
    • Settings
    • Canvas
    • Preview
    • Resource management
  • Agent
  • Subjects

    • Image
    • Font Library
    • Layout
    • Dynamic LVGL version
    • Override screen size
    • Codegen
    • Transplant
    • Simulator
    • Dynamic Display Size Change
  • FAQ

Codegen converts the workspace design into C source code that runs on the target device. This guide covers code generation features, configuration options, and integration points.

Overview

After designing screens in the editor, anyui-LIVE generates the screen implementations and converts assets into the generated/ directory of the workspace. The generated code is self-contained and independent of the hardware and development tools used to build the final firmware.

The pipeline is described here; the assets it consumes are defined in the image guide and the font library guide.

Generated output

Codegen produces the following in {root}/generated:

OutputDescription
Screen source filesC files implementing each screen and the setup_ui() entry point.
Asset sourcesConverted images, fonts, and Lottie data.
Header filesDeclarations for screens, components, and generated variables.

This output is automatically generated and should not be modified by hand.

Configuration options

Codegen behavior is controlled through project configuration:

OptionDescription
ResolutionTarget resolution used when generating screen layout.
Color depthColor depth used for generated assets.

See the workspace guide for where these options are configured.

Integration points

The generated code integrates with the rest of the system through well-defined entry points:

  • setup_ui() - call this to initialize the UI from your application.
  • generated/ - copy these files into your project build.

These integration points are the basis of the transplant guide, which explains moving generated code to a target device.

Related guides

  • Image - how image assets are converted.
  • Font library - how font libraries are converted.
  • Workspace - the generated output directory.
  • Overview - the screens that codegen compiles.
  • Preview - the simulated code produced by codegen.
  • Transplant - integrate generated code into a target project.
  • Simulator - run generated code on a local machine.
Prev
Override screen size
Next
Transplant