Blender Game Python Scripting

Blender Game Python Scripting

That is, can python code replace, for example, a single letter in a Text Object or insert a letter or string into a Text Object. Note that I'm not talking about replacing a Text Object with some updated string, such as, object.text = 'new string'. I'm thinking more about having access to the Text cursor (not the mouse cursor) and positioning it on some letter that I'd like to replace. In other words, I'd like to have the same capability during BGE play that I have when altering a Text Object in the edit mode. Hebron Palestine Zip Code. As ideasman42 pointed out, you must replace it with a new string since. But here's a workaround.

Blender Game Python Scripting

Delete single character This will delete the third character cursor = 2 ob = bpy.context. Matrix Reloaded Legendado Hd. scene.objects['Text'] text = ob.data.body ob.data.body = text[:cursor] + text[cursor+1:] where I've used. Insert single character This will insert 'z' after second character cursor = 2 new_char = 'z' ob = bpy.context.scene.objects['Text'] text = ob.data.body ob.data.body = text[:cursor] + new_char + text[cursor:]. Office 2003 Self Extracting.

Comments are closed.