pub struct DrawingStyle {
pub foreground: DmgColor,
pub background: DmgColor,
pub drawing_mode: DrawingMode,
}Expand description
The style in how drawing functions work.
Corresponds to the color function of GBDK.
Specify a color combination similar to the builder pattern, and apply it
with a method apply().
§Examples
let mut w = unsafe {DrawingStream::new()};
DrawingStyle::default()
.foreground(DmgColor::LTGREY);
.apply(&w);
w.set_style(DrawingStyle::reversed());Fields§
§foreground: DmgColor§background: DmgColor§drawing_mode: DrawingModeImplementations§
Source§impl DrawingStyle
impl DrawingStyle
Sourcepub fn foreground(&mut self, color: DmgColor) -> &mut Self
pub fn foreground(&mut self, color: DmgColor) -> &mut Self
Set foreground of DrawingStyle.
Sourcepub fn background(&mut self, color: DmgColor) -> &mut Self
pub fn background(&mut self, color: DmgColor) -> &mut Self
Set background of DrawingStyle.
Sourcepub fn drawing_mode(&mut self, mode: DrawingMode) -> &mut Self
pub fn drawing_mode(&mut self, mode: DrawingMode) -> &mut Self
Set drawing mode of DrawingStyle.
Sourcepub fn apply(&self, stream: &DrawingStream)
pub fn apply(&self, stream: &DrawingStream)
Apply drawing style.
DrawingStream needed as parameter to ensure GameBoy is in APA mode.
Trait Implementations§
Source§impl Clone for DrawingStyle
impl Clone for DrawingStyle
Source§fn clone(&self) -> DrawingStyle
fn clone(&self) -> DrawingStyle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for DrawingStyle
impl Default for DrawingStyle
Source§impl PartialEq for DrawingStyle
impl PartialEq for DrawingStyle
impl Copy for DrawingStyle
impl StructuralPartialEq for DrawingStyle
Auto Trait Implementations§
impl Freeze for DrawingStyle
impl RefUnwindSafe for DrawingStyle
impl Send for DrawingStyle
impl Sync for DrawingStyle
impl Unpin for DrawingStyle
impl UnwindSafe for DrawingStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more