Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[agb] Added function to change the text color #697

Closed
wants to merge 2 commits into from
Closed

[agb] Added function to change the text color #697

wants to merge 2 commits into from

Conversation

tolik518
Copy link
Contributor

@tolik518 tolik518 commented May 15, 2024

Currently you need to create a new writer everytime you want to change the color of the text.
I implemented these 2 functions to make it more straight forward and to recycle the writer instead of creating a new one for each color.

set_foreground_colour and set_background_colour can be used like this:

    gba_write!(&mut writer, "Lorem ipsum dolor sit amet,").unwrap();
    writer.set_foreground_colour(2);
    gba_write!(&mut writer, "consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.").unwrap();
    writer.set_foreground_colour(3);
    gba_write!(&mut writer, "ut labore et dolore magna aliquyam erat, sed diam voluptua.").unwrap();
    writer.set_foreground_colour(5);
    gba_write!(&mut writer, "At vero eos et accusam et justo duo dolores et ea rebum.").unwrap();
    writer.set_foreground_colour(6).set_background_colour(1);
    gba_write!(&mut writer, "Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.").unwrap();
  • Changelog updated

tolik518 added 2 commits May 16, 2024 00:35

Verified

This commit was signed with the committer’s verified signature.
@tolik518 tolik518 changed the title added possibility to change the text color [agb] Added function to change the text color May 15, 2024
@tolik518
Copy link
Contributor Author

Color changes should be implemented like in the ObjectTextRenderer instead, like it was mentioned in #699

@tolik518 tolik518 closed this May 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant