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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added `dot` and `cross` product methods for `Vector2D`.
- Added `set_foreground_colour` and `set_background_colour` methods for `TextRenderer`.

### Fixed

10 changes: 10 additions & 0 deletions agb/src/display/font.rs
Original file line number Diff line number Diff line change
@@ -154,6 +154,16 @@ impl<'a, 'b> TextWriter<'a, 'b> {
pub fn commit(self) {
self.text_renderer.commit(self.bg, self.vram_manager);
}

pub fn set_foreground_colour(&mut self, colour: u8) -> &mut Self {
self.foreground_colour = colour;
self
}

pub fn set_background_colour(&mut self, colour: u8) -> &mut Self {
self.background_colour = colour;
self
}
}

fn div_ceil(quotient: i32, divisor: i32) -> i32 {