How do I Append text to new line.

0 favourites
  • 7 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • 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,

  • Wouldn't it work to append : ""&newline&text1.text

  • 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

  • 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?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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..

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)