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

Don’t render text you can’t see #391

Closed
wants to merge 1 commit into from

Conversation

moxie-coder
Copy link

This should prevent some lag issues happening, this has happened in a FNF mod I was making where the text would stat to go off screen and the frame rate would start to drop, so this PR should help prevent this from happening.

(Currently a draft since I can’t test it yet.)

@SeiferTim
Copy link
Member

This looks like it would not work if the Text is using a non-default camera.

@Geokureli
Copy link
Member

Geokureli commented Jun 23, 2023

Tim is correct, if you want a textfield that doesn't redraw when not displayed than extend it with ad-hoc functionality like this.

Why do you want this? why change a text field that isn't added to a camera? My guess is that you're using FlxTypeText to control a FlxBitmapText, if so, extend FlxTypeText and make it never redraw. or take the functionality out of FlxTypeText and put it in a third party class that manipulates either text class

@moxie-coder
Copy link
Author

Tim is correct, if you want a textfield that doesn't redraw when not displayed than extend it with ad-hoc functionality like this.

Why do you want this? why change a text field that isn't added to a camera? My guess is that you're using FlxTypeText to control a FlxBitmapText, if so, extend FlxTypeText and make it never redraw. or take the functionality out of FlxTypeText and put it in a third party class that manipulates either text class

Thanks for the suggestions, I wanted this since it was causing lag when a lot of text was displayed outside the screen, even though it should not draw it when it’s not seen.

@Geokureli
Copy link
Member

honestly this is another reason why we should improve FlxBitmapText.

Closing this, this isn't the right fix. make an issue for the problem you're having and we can discuss better options, there

@Geokureli Geokureli closed this Jun 24, 2023
@moxie-coder
Copy link
Author

honestly this is another reason why we should improve FlxBitmapText.

Closing this, this isn't the right fix. make an issue for the problem you're having and we can discuss better options, there

Alright then

@moxie-coder
Copy link
Author

Made the issue here. #393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants