Page 1 of 1

RenderText string equivalent of TextFloatReference

Posted: Wed Nov 29, 2017 8:58 am
by rrTea
RenderText.TextFloatReference can show a variable, I often wish strings would be supported that way too. That'd cut the need to always name a RenderText component every time it has to show some non-static text and there'd be no need for always taking care of it manually in a ZExpression.

So for example:

Code: Select all

Say = "Hello!";
with RenderText.TextString set to Say would show "Hello!" etc. - just makes sense that RenderText would be used with plain text too :)

Re: RenderText string equivalent of TextFloatReference

Posted: Wed Nov 29, 2017 1:56 pm
by VilleK
Hi, I tried adding a "TextStringRef" property to RenderText that should do what you are asking for. Can you please test the attached exe-file (designer only) and tell me if it works? If it does then I'll rebuild the runtime files too.

Re: RenderText string equivalent of TextFloatReference

Posted: Wed Nov 29, 2017 4:09 pm
by Rado1
Works for me.

Re: RenderText string equivalent of TextFloatReference

Posted: Thu Nov 30, 2017 1:42 am
by rrTea
Works great, at least the basic tests I tried (changing the variable string value during runtime etc). I was expecting to find it under TextFloatRef, was a bit surprised that it's closer to the bottom ;) This will save some naming of the components and weed out the little bits of code that update them!

Btw the console text is working fine in this "test" ZGE version, I'm mentioning it because it has been glitched for some half a year or so (the lower part of every line is cut off - I reported it a long time ago, can't find where...).

Re: RenderText string equivalent of TextFloatReference

Posted: Thu Nov 30, 2017 10:42 am
by VilleK
Good. Note that it supports full expressions, so if you have a string variable "S", then you can set TextStringRef to "Title: " + S, etc. I'll rebuild the engines in a day or two.

Re: RenderText string equivalent of TextFloatReference

Posted: Fri Dec 01, 2017 2:05 am
by rrTea
...TextStringRef to "Title: " + S...
I actually haven't thought of testing that - great :D

Re: RenderText string equivalent of TextFloatReference

Posted: Fri Dec 01, 2017 12:39 pm
by VilleK
Rebuilt all now. Renamed property to "TextExpression" and moved it upwards in the list: http://www.zgameeditor.org/files/ZGameEditor_beta.zip

Re: RenderText string equivalent of TextFloatReference

Posted: Sat Dec 02, 2017 4:25 am
by rrTea
I can't access it, here is what it looks like on my end (using the newest build).
剪貼簿圖片 (3).png
剪貼簿圖片 (3).png (3.64 KiB) Viewed 32863 times

Re: RenderText string equivalent of TextFloatReference

Posted: Sat Dec 02, 2017 10:21 am
by VilleK
I get the same problem here, I must have done something wrong while rebuilding, will check.

Re: RenderText string equivalent of TextFloatReference

Posted: Sat Dec 02, 2017 10:35 am
by VilleK
Fixed now: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
I had forgotten to "git push" :)

Re: RenderText string equivalent of TextFloatReference

Posted: Sat Dec 02, 2017 9:26 pm
by Rado1
Text, TextFloatRef and TextArray of RenderText are maybe superfluous if there's RenderText.TextExpression property. They maybe can be removed if we do not care too much about backward compatibility. Or do they provide better performance?