Skip to content

Commit e2dc4e9

Browse files
Add editor.zoom and editor.scroll to editor.md
1 parent a02b3cc commit e2dc4e9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

api/editor.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ local point = app.editor.mousePos
3030
Returns a [point](point.md#point) indicating the mouse position on the
3131
screen.
3232

33+
## Editor.zoom
34+
35+
```lua
36+
app.editor.zoom = 0.33333333333
37+
local zoom = app.editor.zoom
38+
39+
local percentage = zoom * 100 -- 33.3%
40+
```
41+
42+
Gets or sets the editor zoom as a float. To get a percentage, multiply by 100.
43+
44+
## Editor.scroll
45+
46+
```lua
47+
local scroll = app.editor.scroll
48+
app.editor.scroll = scroll
49+
```
50+
51+
Gets or sets the editor scroll (coordinates of sprite pixel to center the editor at) as a table, with values `x` and `y` as floats.
52+
3353
## Editor:askPoint()
3454

3555
```lua

0 commit comments

Comments
 (0)