aboutsummaryrefslogtreecommitdiff
path: root/go/activities
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-09-04 13:24:00 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-09-04 13:24:00 +0200
commit97bcc8167934097b20b5a83bc311950f40e15496 (patch)
treedad868ea5543564b7a1b44bf96478cc8155d8eae /go/activities
parent75220464bf0e0a21a6526b7d8a30596b8fc8915a (diff)
downloadmuhqs-game-97bcc8167934097b20b5a83bc311950f40e15496.tar.gz
muhqs-game-97bcc8167934097b20b5a83bc311950f40e15496.zip
add an about activity
Diffstat (limited to 'go/activities')
-rw-r--r--go/activities/about.go60
1 files changed, 60 insertions, 0 deletions
diff --git a/go/activities/about.go b/go/activities/about.go
new file mode 100644
index 00000000..8669f5bb
--- /dev/null
+++ b/go/activities/about.go
@@ -0,0 +1,60 @@
+package activities
+
+import (
+ "image/color"
+
+ "muhq.space/muhqs-game/go/ui"
+)
+
+// About is an Activity that presents the about information in a scrollable buffer.
+// It features an arrow back button calling activities.PopActivity().
+type About struct {
+ ui.Collection
+}
+
+var about = [...]string{
+ " ",
+ "Muhq's Game",
+ "Copyright Florian Fischer",
+ "Game material GNU Free Documentation License",
+ "Implementation GNU GPL 3+",
+ " ",
+ "Font: Antykwa Torunska",
+ "Designer: Zygfryd Gardzielewski",
+ "Author: Janusz Marian Nowacki",
+ "This work is released under the GUST Font Nosource License",
+ " ",
+ "Used go packages",
+ "github.com/RyanCarrier/dijkstra - MIT License",
+ "github.com/hajimehoshi/ebiten - Apache 2.0 license",
+ "golang.org/x/image - BSD-3-Clause",
+ "golang.org/x/net - BSD-3-Clause",
+ "gopkg.in/yaml.v3",
+}
+
+const ABOUT_MARGIN = 25
+
+func NewAbout(width, height int) *About {
+ a := &About{ui.Collection{Width: width, Height: height}}
+
+ buffer := ui.NewBuffer(ABOUT_MARGIN, ABOUT_MARGIN, width-2*ABOUT_MARGIN, height-2*ABOUT_MARGIN)
+ a.AddWidget(buffer)
+ buffer.Bg(color.Black)
+ buffer.AddLines(about[:])
+
+ back := ui.NewRoundSimpleButton(5, 5, 40, "←", func(*ui.SimpleButton) { PopActivity() })
+ a.AddWidget(back)
+
+ return a
+}
+
+func (a *About) Layout(int, int) (int, int) {
+ return a.Width, a.Height
+}
+
+func (a *About) Update() error {
+ if err := ui.Update(); err != nil {
+ return err
+ }
+ return a.Collection.Update()
+}