Updating Text Wrap

gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
edited December 2014 in Working with GS (Mac)

Hi, Neko Montaaju & Sort 'Em are ready to be uploaded to Apple in January (at long last for one of them) so i'm treading water working on another one from my "list" though it'll probably go back down the queue before it's finished... :wink:

OK, I've a problem that has got me scratching my head - I've tried different approaches over a couple of hours but nothing works.

It's an app which involves a custom made (typing) keyboard and I need a workaround for live updating of the Text Wrap. To explain further, the first and simplest approach was, when pressing "q" for example, I've Change Attribute MainText to MainText.."q" in the area that shows the type- the same for the space bar, except " " of course.

But when the words approach the end of a line and a word splits by carrying on onto the next line, then pressing space, i'd want the split word to wrap over as the full word onto that new line... if you see what I mean.

But Wrap Text isn't "live" is it, so it keeps the split word.... anyone have an ingenious workaround for this?

""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Comments

  • zweg25zweg25 Member Posts: 738

    If I understand what you are saying, I whipped up a project real quick, and using change attribute game.text to game.text..self.whatLetterAmI works for me. I can PM you the project.

    I am trying to learn how to make gifs, so I am going to try and post how it works for me :smiley:

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You'd need some kind of a buffer that keeps track of the last word and replaces the displayed characters based on text string functions. On my phone right now so I can't provide a demo.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited December 2014

    Hi @zweg25 & @tatiang thanks for your replies.

    @zweg25 Interesting that it works for you - live wrap as you type with a custom keyboard in a field (actor) - I'd be interested in seeing that, thank you.

    Tatian, yes, I thought along those lines but still the problem of knowing which is the last word in a line - I could have done it with the amount of characters in a line if it was a fixed width typeface, but I'm using American Typewriter, which isn't, as you know.

    But I look forward to your demo if you've time, thanks v.m. :smile:

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • zweg25zweg25 Member Posts: 738
    edited December 2014

    My first gif.. not awful.. :grin:

  • zweg25zweg25 Member Posts: 738

    @gyroscope‌ Is this what you meant?

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited December 2014

    Hi again @zweg25 yes, exactly that ... so I wonder what I'm doing wrong? :|

    For interest, does yours still wrap OK with the text range left?

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • zweg25zweg25 Member Posts: 738

    It does

  • zweg25zweg25 Member Posts: 738

    Here is the project if you like to play with it.

    (Stable Release 12.10 btw)

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Thank you, @zweg25, appreciated. I'll take a look at that now - probably kick myself.... :wink:

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • zweg25zweg25 Member Posts: 738

    No problem, good luck

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited December 2014

    Good stuff, @zweg25 the difference with yours is you've used self attributes for the letters - why that makes the difference I'm not sure...

    Thanks again. :)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • zweg25zweg25 Member Posts: 738

    Interesting, did you do the same to get wrapping to work?

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Yes, by using self attributes as you did instead of adding the letter as text to the attribute in the change attribute behaviour.

    Strange it makes a difference... but glad it does!

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    @zweg25 -- That is a really nice example of how to do a keyboard. Would you consider adding it to the "spare code" thread so it does not get lost?

  • zweg25zweg25 Member Posts: 738

    @RThurman‌ of course, but the art isn't the best :grin:

Sign In or Register to comment.