[Suggestion] Edit Text Strings From Any Position

Discussion and feedback on Construct 2

Post » Tue Jan 21, 2014 5:11 pm

Presently, with the Text and Sprite Font objects, you can append the end of the text string with additional characters. That's how I understand it.

But I was wondering if it would be possible to add a feature to both objects where you could do just as you can in Arrays, where you can insert content in the middle or beginning of a value.

Say you have a Text value of "I Scirra."
Asside from being grammatically incorrect, say you want to amend this text. You'd need a condition that could isolate a position in the string and then insert the text " love" in between the two. It would essentially look like this...
"I" --> " love" <-- " Scirra." [The --> and <-- is mean to identify the insertion of an existing text as opposed to current procedures where you can combine text strings and variables like this Variable + "Text".]

Basically, if we could take those certain events and actions that can be applied to text values within an Array and use them with the Text and Sprite Fonts, that would be so helpful.

Please let me know if I need to clarify this more. Thanks, Scirra Bros!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
142
S
24
G
8
Posts: 793
Reputation: 15,157

Post » Tue Jan 21, 2014 5:14 pm

Can't you just write a function to do this? Shouldn't be too hard, and it's the perfect application for a function.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Tue Jan 21, 2014 5:29 pm

@squiddster - As I'm reviewing the manual for the Text, Sprite Font, and Array objects, I'm thinking you're right... I'm still faced with how to set up a process that will take a text string and break it up into its individual characters, in a sense.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
142
S
24
G
8
Posts: 793
Reputation: 15,157

Post » Tue Jan 21, 2014 5:38 pm

B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Tue Jan 21, 2014 6:38 pm

This is one of those cases where people who come from other coding backgrounds don't even think about features like that. I've been manipulating text strings since 1982.

I had a moment of "Gee, what if there was a different way."
B
242
S
63
G
33
Posts: 903
Reputation: 40,756


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest