From 6da135760b1d6c57ea327825f5de977a7eaa2872 Mon Sep 17 00:00:00 2001 From: Justin Senn Date: Mon, 6 Feb 2023 18:14:04 +0100 Subject: [PATCH] update --- src/main/java/Snake/TextView.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/Snake/TextView.java b/src/main/java/Snake/TextView.java index f8adcc7..29746ac 100644 --- a/src/main/java/Snake/TextView.java +++ b/src/main/java/Snake/TextView.java @@ -4,6 +4,30 @@ import java.awt.*; public class TextView implements Drawable { + public enum AnchorType { Left, Center, Right }; + + private String text; + + private Point position; + + private boolean visible; + + private AnchorType anchor; + + public TextView(String text, Point position) + { + this(text, position, true); + } + + public TextView(String text, Point position, boolean visible) + { + this.text = text; + this.position = position; + this.visible = visible; + this.anchor = AnchorType.Center; + } + + @Override public void draw(Graphics g)