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

User avatar
rrTea
Posts: 306
Joined: Sat Feb 15, 2014 9:54 am

RenderText string equivalent of TextFloatReference

Postby rrTea » Wed Nov 29, 2017 8:58 am

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: 1891
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Postby VilleK » Wed Nov 29, 2017 1:56 pm

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.8 MiB) Downloaded 18 times

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Re: RenderText string equivalent of TextFloatReference

Postby Rado1 » Wed Nov 29, 2017 4:09 pm

Works for me.

User avatar
rrTea
Posts: 306
Joined: Sat Feb 15, 2014 9:54 am

Re: RenderText string equivalent of TextFloatReference

Postby rrTea » Thu Nov 30, 2017 1:42 am

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: 1891
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Postby VilleK » Thu Nov 30, 2017 10:42 am

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: 306
Joined: Sat Feb 15, 2014 9:54 am

Re: RenderText string equivalent of TextFloatReference

Postby rrTea » Fri Dec 01, 2017 2:05 am

...TextStringRef to "Title: " + S...


I actually haven't thought of testing that - great :D

User avatar
VilleK
Site Admin
Posts: 1891
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Postby VilleK » Fri Dec 01, 2017 12:39 pm

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: 306
Joined: Sat Feb 15, 2014 9:54 am

Re: RenderText string equivalent of TextFloatReference

Postby rrTea » Sat Dec 02, 2017 4:25 am

I can't access it, here is what it looks like on my end (using the newest build).
剪貼簿圖片 (3).png
剪貼簿圖片 (3).png (3.65 KiB) Viewed 938 times

User avatar
VilleK
Site Admin
Posts: 1891
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Postby VilleK » Sat Dec 02, 2017 10:21 am

I get the same problem here, I must have done something wrong while rebuilding, will check.

User avatar
VilleK
Site Admin
Posts: 1891
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: RenderText string equivalent of TextFloatReference

Postby VilleK » Sat Dec 02, 2017 10:35 am

Fixed now: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
I had forgotten to "git push" :)

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Re: RenderText string equivalent of TextFloatReference

Postby Rado1 » Sat Dec 02, 2017 9:26 pm

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?


Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 0 guests