From 6e4aa7ff484f87a66f8d2c5b466338c106a4a72b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 16 Jun 2024 05:18:59 -0700 Subject: [PATCH] fix some names in documentation --- reference.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reference.md b/reference.md index 6c228c4..a894a53 100644 --- a/reference.md +++ b/reference.md @@ -48,7 +48,7 @@ two categories. * `on.resize(w,h)` -- called when you resize the app window. Provides new window dimensions in `w` and `h`. Don't bother updating `App.screen.width` and `App.screen.height`, that will happen automatically before calling - `App.resize`. + `on.resize`. (Based on [LÖVE](https://love2d.org/wiki/love.resize)) * `on.file_drop(file)` -- called when a file icon is dragged and dropped on @@ -114,7 +114,7 @@ two categories. * `on.text_input(t)` -- called when you press a key combination that yields (roughly) a printable character. For example, `shift` and `a` pressed - together will call `App.textinput` with `A`. + together will call `on.textinput` with `A`. (Based on [LÖVE](https://love2d.org/wiki/love.textinput).) * `on.key_release(key)` -- called when you press a key on the keyboard. @@ -286,9 +286,9 @@ clicked. It requires setting up 3 things: - a `state` table housing all buttons. Can be the same `state` variable the text-editor widget uses, but doesn't have to be. - specifying buttons to create in `state`. This must happen either directly - or indirectly within `App.draw`. + or indirectly within `on.draw`. - responding to clicks on buttons in `state`. This must happen either - directly or indirectly within `App.mousepressed`. + directly or indirectly within `on.mouse_press`. The following facilities help set these things up: @@ -309,7 +309,7 @@ The following facilities help set these things up: }) ``` - Call this either directly or indirectly from `App.draw`. It will assign a + Call this either directly or indirectly from `on.draw`. It will assign a rectangle with the given dimensions and trigger the provided (zero-arg) `onpress1` callback when the primary mouse button is clicked within. It will also optionally paint the rectangle with the specified background @@ -321,7 +321,7 @@ The following facilities help set these things up: * `mouse_press_consumed_by_any_button(state, x,y, mouse_button)` - Call this either directly or indirectly from `App.mousepressed`. It will + Call this either directly or indirectly from `on.mouse_press`. It will pass on a click to any button registered in `state`. It's also helpful to ensure clicks on a button don't have other effects, so I prefer the following boilerplate early in `mousepressed`: @@ -339,7 +339,7 @@ The following facilities help set these things up: (Based on [LÖVE](https://love2d.org/wiki/love.mouse.setPosition).) * `App.mouse_down(mouse_button)` -- returns `true` if the button - `mouse_button` is pressed. See `App.mousepressed` for `mouse_button` codes. + `mouse_button` is pressed. See `on.mouse_press` for `mouse_button` codes. (Based on [LÖVE](https://love2d.org/wiki/love.mouse.isDown).) * `App.mouse_x()` -- returns the x coordinate of the current position of the