Node editor
Build app logic by wiring blocks together instead of writing code. It's turned into C when you build.
Create a graph
- A C: UI app project includes
logic/main.wiinodeswith a working example: a counter button. - Or add one with File > New > Wii Homebrew > Node Graph (.wiinodes)….
Double-click the file to open the node editor. Widgets come from the project's .wiiui design.
How it works
- Add Node adds a block from a category: Events, Flow, Actions, Values, Math & Logic and Text.
- Drag between ports to connect them. A port only joins ports of its own colour.
- White wires are the order things happen in. Start from an Event node (the red ones) and follow the wires.
- Coloured wires carry values: blue is a number, green is text, orange is yes/no.
- A data input with nothing wired in shows a box where you type the value to use.
- Drag a node's title to move it, drag the background to pan, and Delete removes the selected node. Right-click an input port to disconnect it.
Events
- On Start: once, when the app starts.
- On Every Frame: 60 times a second.
- On Button Pressed: when a button widget is clicked.
- On Wii Remote Button: when A, B, 1, 2, +, −, or the D-pad is pressed.
Flow and actions
- Branch: runs one path if a yes/no is true, another if not.
- Repeat: runs its body a number of times, then continues. Its index output counts from 0.
- Set Text, Set Visible and Set Color change a widget.
- Set Number / Text Variable / Yes-No store a value.
- Exit App quits to the Homebrew Channel.
Values, math and text
- Number, Text, Yes / No constants, Get blocks for variables and a widget's text, and Frame Count.
- Add, Subtract, Multiply, Divide, Remainder, Compare, And, Or, Not and Random Number. Dividing by zero gives 0.
- Number to Text, Join Text and Text Equals.
Variables
The Variables panel on the right holds values that last while the app runs. Add a Number, Text or Yes/No variable, give it a name and a starting value, then read and change it with Get and Set blocks. Renaming a variable updates every block that uses it.
Example: a click counter
- In the UI designer, add a button named
goand a label namedstatus. - In the node editor, make a variable
count(Number, starts at 0). - On Button Pressed (widget
go) → Set Number (count), with Add (Getcount+ 1) wired into its value. - Then → Set Text (widget
status) with Join Text (“Pressed ”, Number to Text(Getcount)). - Build & Run, point, and click.
When a build stops
If a node refers to a widget or variable that doesn't exist, or a chain of blocks runs back into itself, the build stops and the Console says which. Use Repeat for loops.