Skip to content

Commit

Permalink
RM
Browse files Browse the repository at this point in the history
  • Loading branch information
Tourahi committed Jan 8, 2024
1 parent 3a5bd3f commit c3d583d
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Controls/TextInput.moon
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class TextInput extends Control
@stroke = common.stroke
@rx = style.rx
@ry = style.ry
@brx = 0
@bry = 0
@brx = style.rx
@bry = style.ry

@keyDown = "none"
@limit = 0
Expand Down Expand Up @@ -419,13 +419,15 @@ class TextInput extends Control
r, g, b, a = Graphics.getColor!
color = colors.gray
color[4] = color[4] or @alpha
Graphics.setLineStyle "smooth"
Graphics.setColor color
Graphics.rectangle "fill", bg.x - @stroke, bg.y - @stroke, @getWidth! + @stroke*2, @getHeight! + @stroke*2, @brx, @bry
Graphics.setColor r, g, b, a

drawTextBox: =>
bg = @getBoundingBox!
r, g, b, a = Graphics.getColor!
Graphics.setLineStyle "smooth"
Graphics.setColor colors.white
Graphics.rectangle "fill", bg.x, bg.y, @getWidth!, @getHeight!, @rx, @ry

Expand Down
4 changes: 2 additions & 2 deletions Controls/themes/blues.moon
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Default =


textField:
rx: 5
ry: 5
rx: 15
ry: 15
marginCorner: 18
textAreaColor: { 0.0392156862745, 0.0392156862745, 0.0392156862745 }
textColor: { 1, 1, 1 }
Expand Down
73 changes: 70 additions & 3 deletions README.md
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


```

13 changes: 13 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
[Logs for changes done on CORE modules]


================================================
Version 11.4 - Alpha (December 18 - 2023)
================================================
[FIXED][Manager][Control]
* issue : When we notify the parent that teh child has dispatched an event we dispatch the parent event also
and that caused some problems. For example when the child is Focused the parent dispatch the same event
since it gets notifyed and it becomes the focused ctrl instead of the child.
* solution :
ALPHA -> commit: 77f0c70d1ea9396bc7b55596f5c4e729d99c8e3a
STILL NEEDS TESTS.



================================================
Version 11.4 - Alpha (November 26 - 2023)
================================================
Expand Down

0 comments on commit c3d583d

Please sign in to comment.