aboutsummaryrefslogtreecommitdiffstats
path: root/ui/label.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/label.hpp')
-rw-r--r--ui/label.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/ui/label.hpp b/ui/label.hpp
new file mode 100644
index 0000000..9524007
--- /dev/null
+++ b/ui/label.hpp
@@ -0,0 +1,32 @@
+#ifndef MBUOY_UI_LABEL_HPP
+#define MBUOY_UI_LABEL_HPP
+
+#include "attr/position.hpp"
+#include "attr/string.hpp"
+#include "find.hpp"
+#include "port.hpp"
+
+namespace mbuoy {
+
+template<auto... Attr>
+struct label
+{
+ static constexpr auto point = find<position>(Attr...);
+ static constexpr auto text = find<const char *>(Attr...);
+
+ static consteval void init(unsigned char *(&ptr)) {
+ }
+
+ static void render() {
+ port::puts(point->x, point->y, *text);
+ }
+
+ static consteval int size() {
+ return 0;
+ }
+};
+
+} // namespace mbuoy
+
+#endif // MBUOY_UI_LABEL_HPP
+