RenderText string equivalent of TextFloatReference

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

RenderText string equivalent of TextFloatReference

Post 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 :)
User avatar
VilleK
Site Admin
Posts: 2335
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Post 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.
Attachments
ZDesigner_rendertext_test.zip
(1.79 MiB) Downloaded 908 times
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Re: RenderText string equivalent of TextFloatReference

Post by Rado1 »

Works for me.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: RenderText string equivalent of TextFloatReference

Post 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...).
User avatar
VilleK
Site Admin
Posts: 2335
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Post 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.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: RenderText string equivalent of TextFloatReference

Post by rrTea »

...TextStringRef to "Title: " + S...
I actually haven't thought of testing that - great :D
User avatar
VilleK
Site Admin
Posts: 2335
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Post by VilleK »

Rebuilt all now. Renamed property to "TextExpression" and moved it upwards in the list: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: RenderText string equivalent of TextFloatReference

Post 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 37561 times
User avatar
VilleK
Site Admin
Posts: 2335
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Post by VilleK »

I get the same problem here, I must have done something wrong while rebuilding, will check.
User avatar
VilleK
Site Admin
Posts: 2335
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Post by VilleK »

Fixed now: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
I had forgotten to "git push" :)
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Re: RenderText string equivalent of TextFloatReference

Post 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?
Post Reply