diff options
author | Romain Porte <microjoe@microjoe.org> | 2020-02-23 10:30:17 +0100 |
---|---|---|
committer | Romain Porte <microjoe@microjoe.org> | 2020-02-23 10:30:17 +0100 |
commit | cc06ec11a6824151ae07418956f3897ab19080ef (patch) | |
tree | 6c2209527ad51a4b6ae4367b1dba2a673a744fd2 /src/lib.rs | |
parent | 9579f4cbfef9e53eefdadcd366e577d0514ff7ed (diff) | |
download | charlcd-cc06ec11a6824151ae07418956f3897ab19080ef.tar.gz charlcd-cc06ec11a6824151ae07418956f3897ab19080ef.zip |
add goto functions
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -287,6 +287,18 @@ where pub fn large_font(&mut self) -> std::io::Result<()> { write_simple_code!(self, SpecialCode::LargeFont) } + + pub fn gotoxy(&mut self, x: u32, y: u32) -> std::io::Result<()> { + write_simple_code!(self, SpecialCode::GotoXY(Some(x), Some(y))) + } + + pub fn gotox(&mut self, x: u32) -> std::io::Result<()> { + write_simple_code!(self, SpecialCode::GotoXY(Some(x), None)) + } + + pub fn gotoy(&mut self, y: u32) -> std::io::Result<()> { + write_simple_code!(self, SpecialCode::GotoXY(None, Some(y))) + } } // Reimplement Write trait for Screen, so that user can call the write and |