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

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

Closed
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 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
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.

None yet

1 participant