Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works in editor, does not work in run project #1

Open
Sekerali opened this issue Apr 16, 2024 · 4 comments
Open

Works in editor, does not work in run project #1

Sekerali opened this issue Apr 16, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Sekerali
Copy link

The auto sizer is only working for me in the editor, the text behaves as a regular label in run project.

The Resized flag is getting called at runtime when resizing the label, and i have tried changing the text at runtime.
I am guessing the C# to my_label._check_line_count() is label.GetLineCount(), which also doesnt auto size the font.

@LuisEscorza
Copy link
Owner

Thanks for letting me know! I'll check it out as soon as I have time. Can you tell me what you're doing at runtime with the label so I can try to reproduce it? Just setting the text property?

The resized flag shouldn't be called at runtime at least by default. Did you take out the Engine.is_editor_hint() check yourself? I'll try to see what's going on there too 👍

About the C#,I've never used it with Godot and I don't know what to tell you.. I had no idea you could use C# with a tool written in gdscript 😅 in any case, shouldn't it be 'CheckLineCount()' instead of 'GetLineCount()'?

In any case,thanks for posting the issues, I'll check all of that out as soon as I can.

@LuisEscorza
Copy link
Owner

(Sorry, closed by accident)
Ok so, I've tried resizing the label at runtime and the signal is not getting called, so that's working as expected.

Regarding the issue with it not working even when changing the text, I've noticed that the _check_line_count() doesn't get called if you change the text from the label itself (modifying the script), unless you do it like self.text = value . Without the self you do need to call the line count check yourself, but this is not the case if you change the text from any other class, which is the expected use case. I'll make a note on the documentation and the readme for a next release so it's clear, but it should be working as expected.

I'll leave the issue open for now, in the case that you changed the text from outside the label and it still didn't work. I'll need some more info so I can try to reproduce it, otherwise I'll close it after some time 👍

@CryReaper
Copy link

I also had this issue. Using C# and was modifying .Text from a separate class that referenced a label through an [Export], and not from within the label class. Worked in editor but for runtime I had to call the _check_line_count method after modifying the text for it to work.

@LuisEscorza
Copy link
Owner

So it seems the issue is with C# then, so I don't really know what the issue is.. but I'll try to check it out when I have time in the coming weeks. Thanks for posting 👍

@LuisEscorza LuisEscorza added the bug Something isn't working label Jun 30, 2024
@LuisEscorza LuisEscorza reopened this Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants