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

Improvements to some features, additional features, & updated documentation. #5

Merged
merged 8 commits into from
Oct 5, 2022

Conversation

rocamocha
Copy link
Contributor

@rocamocha rocamocha commented Sep 21, 2022

Bugfixes:

  • The hex conversion function from colors.lua presented problems when trying to hide a printer with already printed text via manipulating the alpha value. Any text colored by a style would still be visible since the value was hardcoded in the color conversion.
    --> This was fixed by providing the conversion with the printer's self-reference, so we could get the alpha value via gui.get_color using the NodeProxy stored in self.prefab

  • The math for creating new lines is changed as it presented odd behaviour when trying to align the text using the pivot options in the GUI node for the text parent and resize a textbox around it using text metrics. This has been mostly fixed, although important to note is that the text input into the metrics calculation needs to be sanitized to remove the style wrappers (we need to ignore things such as {/}). I have written a sanitize() function for this in another project, but have not added it because I think it needs a better name, and maybe even should ultimately just be changed to a text metrics function.

Added features:

  • The style tables can now take a parameter line_spacing which is added to the distance between new lines.

  • Added a fadeout() function which animates the alpha channel of all the nodes contained in self.current_letters

  • Non-conflicting styles can now be compounded when not explicitly exited with {/}. For example, if you have a style with color as a param and another with waving as a param and provide printer with the following text:

"{colorstyle} alpha beta {wavestyle} gamma {/}"

Before, doing {wavestyle} would cancel {colorstyle} even though their parameters don't conflict - meaning to have color AND waving on the word 'gamma' you would need to create an entirely new style.
Now, the styles can be stacked, with the last declared style taking priority if there are any conflicting parameters. This is done by storing the last style in self.last_style and overwriting the defaults in get_style() with any existing parameters. This temporary stored style is cleared only when the styles are explicitly exited using {/}.

Documentation updates:
Various small spelling and grammar changes, and conversion from passive to active voice where possible to improve clarity.
Added and changed sections to reflect new features.

@Insality Insality merged commit 0ba7351 into Insality:master Oct 5, 2022
@Insality
Copy link
Owner

Insality commented Oct 5, 2022

Thanks for the update! Merged and add 1.1.0 release (previous was 1.0.0)

I'm don't get idea of new line spacing field and it's works not very well in the this PR, so I'm removed it from this repository. Since there is exists font_height field which behaviour is similar, I decided to leave only this.

And made some corrections, since this printer should start print from top-left area of text_parent node

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.

2 participants