diff options
author | George L. Albany <Megacake1234@gmail.com> | 2023-02-21 08:49:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 08:49:46 +0100 |
commit | fb9e316a18139ea6b6ffe3b237796b42d7114738 (patch) | |
tree | 7eb315989e19d1e8eabea955330e3a2e5469c876 /game/src/Utility/TextureSetting.gd | |
parent | 0b3f9cb21cfa86e98649066ff7d260b4f9022023 (diff) |
Add stylized theme to MainMenu (#12)
* Add stylized theme to MainMenu
Increase message queue memory size by 4
Add default_theme.theme
Refactor SampleGame.gd to better account for refactoring via @export nodes
Properly aligne SampleGame scene
Reorganize MainMenu into its own directory
Add main_menu_border_paper.png
Add main_menu_button.png
* Add background image to theme
Implement StyleBoxCombinedTexture
Allows drawing an array of textures all at once
Make MainMenu Panel a PanelContainer for consistency
* Implement MainMenu button press, hover, and focus styles
Improve MainMenu button disabled style
* Add Godot's latest documentation to the README.md
Diffstat (limited to 'game/src/Utility/TextureSetting.gd')
-rw-r--r-- | game/src/Utility/TextureSetting.gd | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/game/src/Utility/TextureSetting.gd b/game/src/Utility/TextureSetting.gd new file mode 100644 index 0000000..da9b185 --- /dev/null +++ b/game/src/Utility/TextureSetting.gd @@ -0,0 +1,123 @@ +extends Resource +class_name TextureSetting + +@export +var texture : Texture2D: + get: return texture + set(v): + texture = v + emit_changed() +@export +var draw_center : bool = true: + get: return draw_center + set(v): + draw_center = v + emit_changed() + +@export_group("Texture Margins", "texture_margin_") +@export +var texture_margin_left : float = 0: + get: return texture_margin_left + set(v): + texture_margin_left = v + emit_changed() +@export +var texture_margin_top : float = 0: + get: return texture_margin_top + set(v): + texture_margin_top = v + emit_changed() +@export +var texture_margin_right : float = 0: + get: return texture_margin_right + set(v): + texture_margin_right = v + emit_changed() +@export +var texture_margin_bottom : float = 0: + get: return texture_margin_bottom + set(v): + texture_margin_bottom = v + emit_changed() + +@export_group("Expand Margins", "expand_margin_") +@export +var expand_margin_left : float = 0: + get: return expand_margin_left + set(v): + expand_margin_left = v + emit_changed() +@export +var expand_margin_top : float = 0: + get: return expand_margin_top + set(v): + expand_margin_top = v + emit_changed() +@export +var expand_margin_right : float = 0: + get: return expand_margin_right + set(v): + expand_margin_right = v + emit_changed() +@export +var expand_margin_bottom : float = 0: + get: return expand_margin_bottom + set(v): + expand_margin_bottom = v + emit_changed() + +@export_group("Axis Stretch", "axis_stretch_") +@export +var axis_stretch_horizontal : RenderingServer.NinePatchAxisMode = RenderingServer.NINE_PATCH_STRETCH: + get: return axis_stretch_horizontal + set(v): + axis_stretch_horizontal = v + emit_changed() +@export +var axis_stretch_vertical : RenderingServer.NinePatchAxisMode = RenderingServer.NINE_PATCH_STRETCH: + get: return axis_stretch_vertical + set(v): + axis_stretch_vertical = v + emit_changed() + +@export_group("Sub-Region", "region_") +@export +var region_rect : Rect2 = Rect2(0, 0, 0, 0): + get: return region_rect + set(v): + region_rect = v + emit_changed() + +@export_group("Modulate", "modulate_") +@export +var modulate_color : Color = Color(1, 1, 1, 1): + get: return modulate_color + set(v): + modulate_color = v + emit_changed() + +@export_group("Content Margins", "content_margin_") +@export +var content_margin_left : float = -1: + get: return content_margin_left + set(v): + content_margin_left = v + emit_changed() +@export +var content_margin_top : float = -1: + get: return content_margin_top + set(v): + content_margin_top = v + emit_changed() +@export +var content_margin_right : float = -1: + get: return content_margin_right + set(v): + content_margin_right = v + emit_changed() +@export +var content_margin_bottom : float = -1: + get: return content_margin_bottom + set(v): + content_margin_bottom = v + emit_changed() |