Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Ketsji/KX_FontObject.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_FontObject.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_FontObject.cpp b/source/gameengine/Ketsji/KX_FontObject.cpp
index 5a4d9065605..c20015945aa 100644
--- a/source/gameengine/Ketsji/KX_FontObject.cpp
+++ b/source/gameengine/Ketsji/KX_FontObject.cpp
@@ -34,6 +34,7 @@
#include "KX_Scene.h"
#include "KX_PythonInit.h"
#include "BLI_math.h"
+#include "StringValue.h"
extern "C" {
#include "BLF_api.h"
@@ -224,7 +225,18 @@ int KX_FontObject::pyattr_set_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrd
if(!PyUnicode_Check(value))
return PY_SET_ATTR_FAIL;
char* chars = _PyUnicode_AsString(value);
- self->m_text = split_string(STR_String(chars));
+
+ /* Allow for some logic brick control */
+ CValue* tprop = self->GetProperty("Text");
+ if(tprop) {
+ CValue *newstringprop = new CStringValue(STR_String(chars), "Text");
+ self->SetProperty("Text", newstringprop);
+ newstringprop->Release();
+ }
+ else {
+ self->m_text = split_string(STR_String(chars));
+ }
+
return PY_SET_ATTR_SUCCESS;
}