Skip to content

Commit

Permalink
Fix hello-tophat.md
Browse files Browse the repository at this point in the history
  • Loading branch information
skejeton authored Jul 6, 2024
1 parent da203ff commit d8a21f1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/hello-tophat.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
)
fn init*() {
window.setup("Hello tophat!", 600, 600)
window::setup("Hello tophat!", 600, 600)
window.onFrame.register({
canvas.drawText("Hello tophat!", { 1, 1 }, th.black, 2)
window::onFrame.register({
canvas::drawText("Hello tophat!", { 1, 1 }, th.black, 2)
})
}
```
Expand Down Expand Up @@ -44,29 +44,29 @@ aren't on the file system. All modules have their documentation available
[here](api/README.md).

```umka
fn main() {
fn init*() {
```

This declares the `init` function and exports it. This function your game's
entry point.

```umka
window.setup("Hello tophat!", 600, 600)
window::setup("Hello tophat!", 600, 600)
```

This function call creates a window. It will set the title to "Hello tophat!"
and the dimensions to 600x600.

```umka
window.onFrame.register({
window::onFrame.register({
```

This registers a callback to the `onFrame` signal. What this means is that the
code in the brackets will be called on every frame. This is you game's main
loop.

```umka
canvas.drawText("Hello tophat!", { 1, 1 }, th.black, 2)
canvas::drawText("Hello tophat!", { 1, 1 }, th.black, 2)
```

This function draws the text `Hello tophat!` at position `1, 1`, with black
Expand Down

0 comments on commit d8a21f1

Please sign in to comment.