-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,73 @@ | ||
# MeowUI | ||
# **MeowUI** | ||
|
||
### README is currently being rewritten. | ||
[LÖVE](https://love2d.org/) GUI library written in MoonScript. | ||
|
||
* see : https://github.com/Tourahi/MeowUI-Demo | ||
Inspired by [CatUI](https://github.com/wilhantian/catui), but the core modules were heavily modified. Some inspiration was also taken from [LoveFrames](https://github.com/linux-man/LoveFrames). | ||
|
||
Currently based on LÖVE 11.4 MoonScript 0.5 | ||
|
||
### Demo | ||
|
||
See : https://github.com/Tourahi/MeowUI-Demo | ||
|
||
How to make a control <TODO>. | ||
|
||
**Third-party** | ||
|
||
utf8.lua : https://github.com/Stepets/utf8.lua | ||
|
||
# **Hello, World!** | ||
|
||
```lua | ||
-- Always require MeowUI before any control | ||
assert require "MeowUI" | ||
-- Include a control. | ||
-- (You can expand your own controls based on your needs. See controls for examples) | ||
Button = assert require MeowUI.c_cwd .. "Button" | ||
|
||
with love | ||
.load = -> | ||
-- Get the manager (Takes care of all events). <Singleton> | ||
export manager = MeowUI.manager | ||
-- Get the root control. <Singleton> | ||
root = manager\getRoot! | ||
|
||
-- And lets make a fansy polygon shaped button. | ||
bPoly = with Button "Polygon" | ||
\setPosition 200, 200 | ||
\setRadius 25 | ||
\setSides 6 | ||
|
||
-- Finally add the new button as a child to the root so it can be drawn updated etc... | ||
root\addChild frame | ||
|
||
.update = (dt) -> | ||
manager\update dt | ||
|
||
.draw = -> | ||
manager\draw! | ||
|
||
.mousepressed = (x, y, button) -> | ||
manager\mousepressed x, y, button | ||
|
||
.keypressed = (key, is_r) -> | ||
manager\keypressed key, is_r | ||
|
||
.mousemoved = (x, y, dx, dy, istouch ) -> | ||
manager\mousemoved x, y, dx, dy, istouch | ||
|
||
.mousereleased = (x, y, dx, dy, istouch ) -> | ||
manager\mousereleased x, y, dx, dy, istouch | ||
|
||
.wheelmoved = (x, y) -> | ||
manager\wheelmoved x, y | ||
|
||
.keyreleased = (key) -> | ||
manager\keyreleased key | ||
|
||
.textinput = (text) -> | ||
manager\textinput text | ||
|
||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters