Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baochungit/defold-wrap
https://github.com/baochungit/defold-wrap
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/baochungit/defold-wrap
- Owner: baochungit
- License: mit
- Created: 2024-01-25T04:29:30.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-24T09:26:38.000Z (8 months ago)
- Last Synced: 2024-06-24T10:56:15.756Z (8 months ago)
- Language: Lua
- Size: 88.9 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-defold - Defold Wrap
README
# Defold Wrap Library
This tiny library is intended to help you change the way you code on Defold.
Instead of
```lua
local node = gui.get_node("my_node")
gui.set_alpha(node, 0.5)
gui.animate(node, "color.w", 1, gui.EASING_LINEAR, 2)
gui.set_enabled(node, true)
```
Write this
```lua
local wrap = require("wrap.wrap")local node = wrap.node("my_node")
node:set_alpha(0.5):animate("color.w", 1, gui.EASING_LINEAR, 2):set_enabled(true)
```
You can also get a list of wrapped nodes
```lua
local w = wrap.node({ "my_node", title = "text_title", button = gui.get_node("button") })
w.my_node:set_alpha(0.5)
w.title:set_text("Admin")
w.button:set_size(vmath.vector3(100, 50, 0))
```Currently, it has all methods working for GUI nodes & GO, besides, it supports some convenient methods you may need it sometimes, like
```
add_position(...),
get_position_x()
get_position_y()
get_position_z()
set_position_x(...)
set_position_y(...)
set_position_z(...)
add_position_x(...)
add_position_y(...)
add_position_z(...)
...
```To use this library, simply add `https://github.com/baochungit/defold-wrap/archive/master.zip` as a dependency in your `game.project` file
---