insality / druid Goto Github PK
View Code? Open in Web Editor NEWPowerful Defold UI component framework
Home Page: https://insality.github.io/druid/modules/Druid.html
License: MIT License
Powerful Defold UI component framework
Home Page: https://insality.github.io/druid/modules/Druid.html
License: MIT License
I am getting an immediate mouse_hover callback for all buttons upon starting, even if the mouse is not inside any button yet.
Expected: the callback is only triggered when the mouse goes inside the button's zone.
Tested on: Defold 1.2.169 Windows 10 desktop
Suggestion: is it possible to have separate callbacks instead, like:
on_mouse_enter
on_mouse_leave
? Use case is for example, I would like to change the color/image when the mouse enters the button's area, then revert back to old/original state when it leaves. Or is this already possible?
Thanks.
Basic Druid text component can use value from GUI node. To avoid duplication of same text in GUI and scripts.
https://github.com/Insality/druid/blob/develop/druid/base/text.lua#L91
Steps to reproduce:
I was expecting that this will still generate a valid click event because the initial press and final release are on the same button.
However, it does not register a click event. Is this expected?
EDIT: I have modified the question and issue description, as the click outside events I previously mentioned were normal (for other buttons in the same gui).
Self annotation bug: https://insality.github.io/druid/modules/druid.button.html#set_enabled
To keep gui data between layout change
Put all default styles value in every component
style.EXTRA_STRECH_SIZE
scroll:set_extra_strech_size
Add grid set position function
Add grid dynamic and static mode
Add reserve for element counts (for harder bounds)
Separate grid for static_grid and dynamic_grid component
static - single element sizes
dynamic - different element sizes, but with several restrictions
local M = component.create("my_component")
The code above creates a brand new my_component. What if I just want to extend the existing functionality of an existing druid component e.g. a button. How can I do this?
Currently, I am using something like this:
function M.init(self, ...)
self.druid = self:get_druid()
self.button = self.druid:new_button(...)
end
but then I have to override all functions like:
function M.set_enabled(self,state)
self.button:set_enabled(state)
end
Is this the proper way to do things? Or is there a simpler way?
Thanks.
Clarify this moment in docs, refactor scroll to more clean behaviour
Wrong behaviour on 0 or 1 values (scroll disappear or jumping)
Call single function to update all Druid instance
Now hover working only on mobile (hover, while holding touch key)
Need add another event on hover without any action (on desktop for example)
-- drag.lua
function M.on_input(self, action_id, action)
if action_id ~= const.ACTION_TOUCH and action_id ~= const.ACTION_MULTITOUCH then
return
end
should be return false?
Grid right now deleting nodes on grid:clear()
I wanna give all node removing to user, so no more deleting nodes
For sorting nodes in row, cols or both
Basic implementation
Useful to positioning a lot of nodes (ex. in list)
Later need to do more functionality:
Placing by nodes width, allow inserting in any place, allow use animation to re-place nodes
Basic usage: select buttons on screen via gamepad D-PAD
Just usual slider
If create druid instance with another name (not self.druid = druid.new(self)
, druid will crash
Button, what can be used for control the character. For example in platformer. Can react, while pressed
When a button is disabled via set_enabled (false), I think the hover/mouse_hover events should be disabled as well? Right now, the button still get interactions even if it's disabled.
I can probably change this via styles, but it's better if this is "fixed" in the extension itself. Thanks.
Basic druid functions (buttons, text etc) should be covered by tests
Rework API to add more ability for chaining calls
Example with scrolls:
self.druid:new_scroll("scroll_with_points", "scroll_with_points_content")
:set_points({})
:set_extra_stretch_size(100)
Useful for ex. tutorials? Active or disable set of items to control, what is able to interact
Scale mode: not only downscale, add text trim
Add scroll for trimmed text
Swipe component can be used for detecting swipes in special zones
Now we check if it only string or userdata. With hash we can get node via gui.get_node
Used in complex components, what spawns another components
It's problem if we have semitransparent blockers :-(
Component for block input on special zone (node)
I get an error on this line when I try to create a new button with an animation node:
https://github.com/Insality/druid/blob/develop/druid/base/button.lua#L168
I think it's because of the change below, when get_node was moved from helper:
080035c#diff-be286c70c65555e56c461b7009e857e7
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.