aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-17 15:54:17 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-17 15:54:17 +0100
commit8d53634e2f47a616ff90f114fe1afbc2ba4df094 (patch)
tree5a5e11e9c54c845a5dd570bb76aa73724acc5dd9 /src/crepe/api
parent0524c68cc4eb9fbd36c17ed4f5d8152cac2f977b (diff)
parenta8ccf7fe8662086bb223aa4eafd0f85e717d16cf (diff)
Merge branch 'master' into niels/UI
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/Asset.h2
-rw-r--r--src/crepe/api/Config.h11
-rw-r--r--src/crepe/api/Script.h1
-rw-r--r--src/crepe/api/Text.cpp6
-rw-r--r--src/crepe/api/Text.h3
5 files changed, 15 insertions, 8 deletions
diff --git a/src/crepe/api/Asset.h b/src/crepe/api/Asset.h
index b367a92..bfd0ac7 100644
--- a/src/crepe/api/Asset.h
+++ b/src/crepe/api/Asset.h
@@ -37,7 +37,7 @@ public:
private:
//! path to asset
- std::string src;
+ const std::string src;
private:
/**
diff --git a/src/crepe/api/Config.h b/src/crepe/api/Config.h
index e91ecd1..074c113 100644
--- a/src/crepe/api/Config.h
+++ b/src/crepe/api/Config.h
@@ -80,6 +80,17 @@ struct Config final {
*/
std::string root_pattern = ".crepe-root";
} asset;
+ //! Default font options
+ struct {
+ /**
+ * \brief Default font size
+ *
+ * Using the SDL_ttf library the font size needs to be set when loading the font.
+ * This config option is the font size at which all fonts will be loaded initially.
+ *
+ */
+ unsigned int size = 16;
+ } font;
//! Configuration for click tolerance.
struct {
//! The maximum number of pixels the mouse can move between MouseDown and MouseUp events to be considered a click.
diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h
index 5d49223..65306cd 100644
--- a/src/crepe/api/Script.h
+++ b/src/crepe/api/Script.h
@@ -201,7 +201,6 @@ private:
*
* \{
*/
-
//! Game object ID of game object parent BehaviorScript is attached to
game_object_id_t game_object_id;
//! Reference to parent component
diff --git a/src/crepe/api/Text.cpp b/src/crepe/api/Text.cpp
index 2e248de..9d57abd 100644
--- a/src/crepe/api/Text.cpp
+++ b/src/crepe/api/Text.cpp
@@ -6,10 +6,8 @@
using namespace crepe;
Text::Text(game_object_id_t id, const vec2 & dimensions, const vec2 & offset,
- const std::string & font_family, const Data & data, const std::string & text,
- std::optional<Asset> font)
+ const std::string & font_family, const Data & data, const std::string & text)
: UIObject(id, dimensions, offset),
text(text),
data(data),
- font_family(font_family),
- font(font) {}
+ font_family(font_family) {}
diff --git a/src/crepe/api/Text.h b/src/crepe/api/Text.h
index 92cca18..c30dc80 100644
--- a/src/crepe/api/Text.h
+++ b/src/crepe/api/Text.h
@@ -51,8 +51,7 @@ public:
* \param font Optional font asset that can be passed or left empty.
*/
Text(game_object_id_t id, const vec2 & dimensions, const vec2 & offset,
- const std::string & font_family, const Data & data, const std::string & text = "",
- std::optional<Asset> font = std::nullopt);
+ const std::string & font_family, const Data & data, const std::string & text = "");
//! Label text.
std::string text = "";