Label and Layout enhancements#461
Merged
benmoran56 merged 3 commits intopyglet:pyglet-1.5-maintenancefrom Sep 16, 2021
Merged
Conversation
dab4a95 to
5840df6
Compare
Contributor
|
Can I rotate the Label? |
Fix small typo.
benmoran56
approved these changes
Sep 16, 2021
Member
benmoran56
left a comment
There was a problem hiding this comment.
Thanks! These were definitely lacking.
Member
|
@jason-bowen-zheng Unfortunately not. The layout class it too complex to add rotation. |
Contributor
|
@benmoran56 It seems like a good solution! |
Collaborator
Author
@jason-bowen-zheng Not with this merge. However, this is supported in the alternate font renderer (Windows only). See: https://github.com/pyglet/pyglet/blob/pyglet-1.5-maintenance/examples/text/advanced_font.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a couple enhancements to existing Label and layouts to make it similar to Sprites.
Adds a visibility property. This behaves like Sprite visibility, except this deletes the vertices, then re-adds them. This also lets you change text while it's not visible.
Add opacity property for DocumentLabels. - Even though you can adjust this through color property, it gets cumbersome if all you want to do is adjust the opacity.
Add an update function to update both the x and y position simultaneously on layouts. This is a small performance speedup, since both axis can be adjusted in the same loop. In the future can be added with more functionality, for example, adding a Z axis or rotations.