How do I Implement BaseButton logic for RichTextLabel? #7623
Shadowblitz16
started this conversation in
GUI
Replies: 1 comment
-
The RichTextLabel a child of Button, and forward what you need is a solution. Depending how you want to use it, this might be as simple as exposing a property that allows direct access to the RichTextLabel. And if you do not want to use an scene, you can always instantiate the RichTextLabel from code. I understand that it is not desirable, but I do not see why it would not work. On the other hand, you seem to have found impediments for implementing BaseButton logic in a RichTextLabel, which is what you claim to be the only solution... However, such impediments make me think it is not a solution at all. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My suggestion was turned down so I was wondering.
How do I Implement BaseButton logic for RichTextLabel?
I want to create a script that extends from RichTextLabel which implements BaseButton
I tried adding a Button as a child of RichTextLabel and forwarding the events from there but I can't override RichTextLabel's focus and input methods to pull from the Buttons.
A person on discord suggested I make RichTextLabel a child of Button,
But I still need to forward events since I use a custom rich text effect when the button is pushed and I would like to because to use class_name without external dependencies which if I use a scene then I have to preload the scene and add it through the script.
My only solution is to implement the logic of BaseButton into my RichTextButton script that directly extends from RichTextLabel.
I was also looking at the Godot source code on how BaseButton is implemented in the engine and I find there are methods used that don't exist gdscript side for example bitwise methods.
Can someone please help me?
Beta Was this translation helpful? Give feedback.
All reactions