-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scrollbar.horizontal
#74
Conversation
@@ -66,6 +66,7 @@ nodes { | |||
alpha: 1.0 | |||
template_node_child: false | |||
size_mode: SIZE_MODE_MANUAL | |||
custom_type: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: I don't know what these are about, but the editor added it to all components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is a new thing introduced with custom GUI nodes, such as Spine nodes from the Spine extension.
|
||
scrollbar.refresh() | ||
return scrollbar | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: This part is mostly copy-pasted from vertical
, which I'm not super happy about. However, I thought introducing abstractions to keep things DRY would make it less readable. I defer to you @britzl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is perfectly fine to be honest. Sure, the first 20 lines or so could be moved to a shared function perhaps, but lets keep it as it is!
gooey/internal/scrollbar.lua
Outdated
|
||
scrollbar.enabled = core.is_enabled(handle) | ||
scrollbar.node = handle | ||
scrollbar.node_id = node_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Oops, node_id
is never defined in here! M.vertical
has the same problem!
@britzl was the original intention to set scrollbar.node_id = handle_id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution!
(It can also serve as a slider, which is what I needed for adjusting music and sound fx volumes in my game. 馃槄)
Modified the example GUI to show it in action:
horizontal_scrollbar.mp4