summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorAgathe Porte <microjoe@microjoe.org>2020-02-23 10:30:17 +0100
committerAgathe Porte <microjoe@microjoe.org>2020-02-23 10:30:17 +0100
commitbc0e5a406a0179fdbc7a5e298d108e966bcb3ed0 (patch)
tree2f30328a685409b87d9007229f7617ba70c5eff5 /src/lib.rs
parentada08aa7c620070c4aeab23b678ef8bb5b696667 (diff)
downloadcharlcd-bc0e5a406a0179fdbc7a5e298d108e966bcb3ed0.tar.gz
charlcd-bc0e5a406a0179fdbc7a5e298d108e966bcb3ed0.zip
add goto functions
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5679f60..b573b1a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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