Skip to main content

Intent

The Intent type represents what should happen when a button in the user interface is clicked. The most common type of intent is the PressIntent, but you can also use them to navigate to a different Page, start a new Game, and many other things.

pub page fn owner.MyCoolPage() {
Content {
P { "Hello, world!" }
}
}

pub game fn World.Main() {
// fun game code goes here
}

pub fn DisplaySomeButtons([ui]) {
// Calling a page fn just returns an intent to navigate to that function
Button(MyCoolPage) { "Go to cool page" }

// Calling a game fn just returns an intent to enter the game
Button(Main) { "Play cool game" }
}