From 95b7170acdfa73c5842db002ec64f78125fe2f90 Mon Sep 17 00:00:00 2001 From: Physcik Date: Fri, 30 Jan 2026 03:04:43 +0500 Subject: Text formation --- engine/UI/Style.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 engine/UI/Style.go (limited to 'engine/UI/Style.go') diff --git a/engine/UI/Style.go b/engine/UI/Style.go new file mode 100644 index 0000000..1901e4b --- /dev/null +++ b/engine/UI/Style.go @@ -0,0 +1,24 @@ +package ui + +import ( + rl "github.com/gen2brain/raylib-go/raylib" +) + +type Style struct { + BacgroundColor *rl.Color + FontColor *rl.Color + Padding *float32 +} + +// Fills up not specifiend elements with default ones +func (base *Style) FillMissing(defaultStyle *Style) { + if base.BacgroundColor == nil { + base.BacgroundColor = defaultLabelStyle.BacgroundColor + } + if base.Padding == nil { + base.Padding = defaultLabelStyle.Padding + } + if base.FontColor == nil { + base.FontColor = defaultLabelStyle.FontColor + } +} -- cgit v1.3