How do I Append text to new line.

Get help using Construct 2

Post » Fri Aug 15, 2014 3:12 pm

Hi All,
This weekend I shall mainly be trying to work out how to Append text to a new line and in reverse order,

Scenario =
Text Object = Text1
Text Object2= Text2

onclick- Append Text2 with Text1

result wantted text1 = 1 text2=1
next: text1=2 text2= 12
next: text1=3 text2= 123
ect.

I have this already working in construct2 HOWEVER-
after the 1st line is full the text object gos blank, I have made the text object bigger on both axis to no joy,
my thinking is this:
either
1- count how many characters make a line then after that many hits try and add the new line break in , however i can see a problem later on when it comes to 2 characters numbers , <this is where i am at on this part.

the other bit would be to text2 =321 , would this be achieved by making a new variable 'x' and Append text1 to that and then work out how to print that out into text2 ?

Have a great weekend,
B
13
S
4
Posts: 60
Reputation: 1,001

Post » Fri Aug 15, 2014 3:32 pm

Wouldn't it work to append : ""&newline&text1.text
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Aug 15, 2014 5:54 pm

Thank you, LittleStain
that returns each text2 out on a newline,

so now need to find the happy medium ,

thinking a sub to count the number of characters
B
13
S
4
Posts: 60
Reputation: 1,001

Post » Fri Aug 15, 2014 6:34 pm

I thought that was what you were trying to achieve, for I don't understand why your text should have issues..

Here's a small capx with text append, would this work?
You do not have the required permissions to view the files attached to this post.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Aug 15, 2014 7:12 pm

LittleStain wrote:I thought that was what you were trying to achieve, for I don't understand why your text should have issues..

Here's a small capx with text append, would this work?

With your help we have sorted the newline,
17 characters per line then newline,

just trying to work out how to append to the front of the text,

I can not open your capx as i am not running the same v az you yet.
B
13
S
4
Posts: 60
Reputation: 1,001

Post » Fri Aug 15, 2014 7:26 pm

That would be as simple as creating a text variable and setting it to: Text1.text&Text2.text and then setting text2 to the variable..
I'm not sure if it can be done without the variable step inbetween, but this way it should for sure..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Aug 15, 2014 10:15 pm

LittleStain wrote:That would be as simple as creating a text variable and setting it to: Text1.text&Text2.text and then setting text2 to the variable..
I'm not sure if it can be done without the variable step inbetween, but this way it should for sure..


just found a setting that says 'wrapping' so thought i change it from 'word' to 'character' seems to of givin me a free weekend twiddling me thumbs now.
thanks @LittleStain
B
13
S
4
Posts: 60
Reputation: 1,001


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests