How do I delete the last character in a string?

Get help using Construct 2

Post » Thu Nov 27, 2014 2:20 am

If for example, my string is "12345" and i press a delete button, how do i get my output to say "1234"?

New to construct, I will appreciate any help I can get!!
B
3
Posts: 8
Reputation: 191

Post » Thu Nov 27, 2014 2:30 am

Here's a capx. Should be self explanatory.

https://www.dropbox.com/s/j07b7ppqp0q31 ... .capx?dl=0

Welcome to the community :)
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Thu Nov 27, 2014 2:42 am

Thanks for the link, I was trying to use left() and len() earlier, but could you explain to me a little more about how to edit my string when it is a non sprite object. In my case, my string is the users input. Also, is "Self." a reference to the immediate object being manipulated in the line of code?
B
3
Posts: 8
Reputation: 191

Post » Thu Nov 27, 2014 2:57 am

I don't quite know what you mean about 'non-sprite object's'. Spritefont is a separate plugin from a Sprite, and in most respects it functions similarly to the text object.

As for 'self', yes, it is a reference to the immediate object. Specifically, a reference to the object said action originated from. If you search for "self" in the page below, there is a little more about it.

https://www.scirra.com/manual/78/expressions
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202


Return to How do I....?

Who is online

Users browsing this forum: rayolf, Yahoo [Bot] and 8 guests