| 1 | /**************************************************************************/ |
| 2 | /* label_settings.h */ |
| 3 | /**************************************************************************/ |
| 4 | /* This file is part of: */ |
| 5 | /* GODOT ENGINE */ |
| 6 | /* https://godotengine.org */ |
| 7 | /**************************************************************************/ |
| 8 | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ |
| 9 | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ |
| 10 | /* */ |
| 11 | /* Permission is hereby granted, free of charge, to any person obtaining */ |
| 12 | /* a copy of this software and associated documentation files (the */ |
| 13 | /* "Software"), to deal in the Software without restriction, including */ |
| 14 | /* without limitation the rights to use, copy, modify, merge, publish, */ |
| 15 | /* distribute, sublicense, and/or sell copies of the Software, and to */ |
| 16 | /* permit persons to whom the Software is furnished to do so, subject to */ |
| 17 | /* the following conditions: */ |
| 18 | /* */ |
| 19 | /* The above copyright notice and this permission notice shall be */ |
| 20 | /* included in all copies or substantial portions of the Software. */ |
| 21 | /* */ |
| 22 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
| 23 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
| 24 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
| 25 | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
| 26 | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ |
| 27 | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ |
| 28 | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
| 29 | /**************************************************************************/ |
| 30 | |
| 31 | #ifndef LABEL_SETTINGS_H |
| 32 | #define LABEL_SETTINGS_H |
| 33 | |
| 34 | #include "core/io/resource.h" |
| 35 | #include "font.h" |
| 36 | |
| 37 | /*************************************************************************/ |
| 38 | |
| 39 | class LabelSettings : public Resource { |
| 40 | GDCLASS(LabelSettings, Resource); |
| 41 | |
| 42 | real_t line_spacing = 3; |
| 43 | |
| 44 | Ref<Font> font; |
| 45 | int font_size = Font::DEFAULT_FONT_SIZE; |
| 46 | Color font_color = Color(1, 1, 1); |
| 47 | |
| 48 | int outline_size = 0; |
| 49 | Color outline_color = Color(1, 1, 1); |
| 50 | |
| 51 | int shadow_size = 1; |
| 52 | Color shadow_color = Color(0, 0, 0, 0); |
| 53 | Vector2 shadow_offset = Vector2(1, 1); |
| 54 | |
| 55 | void _font_changed(); |
| 56 | |
| 57 | protected: |
| 58 | static void _bind_methods(); |
| 59 | |
| 60 | public: |
| 61 | void set_line_spacing(real_t p_spacing); |
| 62 | real_t get_line_spacing() const; |
| 63 | |
| 64 | void set_font(const Ref<Font> &p_font); |
| 65 | Ref<Font> get_font() const; |
| 66 | |
| 67 | void set_font_size(int p_size); |
| 68 | int get_font_size() const; |
| 69 | |
| 70 | void set_font_color(const Color &p_color); |
| 71 | Color get_font_color() const; |
| 72 | |
| 73 | void set_outline_size(int p_size); |
| 74 | int get_outline_size() const; |
| 75 | |
| 76 | void set_outline_color(const Color &p_color); |
| 77 | Color get_outline_color() const; |
| 78 | |
| 79 | void set_shadow_size(int p_size); |
| 80 | int get_shadow_size() const; |
| 81 | |
| 82 | void set_shadow_color(const Color &p_color); |
| 83 | Color get_shadow_color() const; |
| 84 | |
| 85 | void set_shadow_offset(const Vector2 &p_offset); |
| 86 | Vector2 get_shadow_offset() const; |
| 87 | }; |
| 88 | |
| 89 | #endif // LABEL_SETTINGS_H |
| 90 | |