copy/paste text in stencyl?

GregAnims

  • Posts: 305
I have a game where you can draw levels using the tileAPI and it saves them in a string of text.

Anyone know a way to allow users to copy text, and also paste it into an input box?

That's the only way i can think to allow users to make and share levels.

(NOTE: stencyl 2.2)

« Last Edit: July 30, 2013, 12:48:33 pm by GregAnims »

Tuo

  • *
  • Posts: 2469
To do it requires doing some "real" coding to make a text box. I don't know if there is a GUI widgets for 3.0 yet or not though. Once you have the text box though, should be straightforward.

Perhaps copy the ideas from this post: http://haxe.org/forum/thread/4329
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

rob1221

  • *
  • Posts: 9470
I tried this once but never figured out how to get the pasting to work.  You can't paste text in Flash without going through a paste event listener.  I guess you would need a text box as Tuo said.

Tuo

  • *
  • Posts: 2469
Oh, Stencyl 2.2? Then, there's a GUI Widgets in the StencylForge. I think that will work. If not, there is a combination of two behaviors I uploaded ages ago that, when done together, will indeed work (I did it for The Lonely Square BECAUSE of being able to do copy/paste). Those are a bit tricky to use though, so if you can't get the GUI widgets to work, let me know, and I'll try to stream for you how to get the other two to work together.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

GregAnims

  • Posts: 305
Thanks a ton dude, that would be great if you could show me.

I tried GUI widgets, couldn't get it to copy/paste..

Tuo

  • *
  • Posts: 2469
I'll be on for about two hours tonight (livestream.com/stencyl). If tonight doesn't work, just stop by whenever. I'm on at different times throughout each day.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Tuo

  • *
  • Posts: 2469
I saw you came on this morning. I'm still working on debugging the code (I have another post on here trying to get help with it). The original code was not designed to be copied, and it was made for Stencyl 1.x. I have now gotten the code to work... but it still gives an error upon startup (once I dismiss the error, it works fine; it copies/pastes/saves as a GA).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Tuo

  • *
  • Posts: 2469
Alright, in the games section of the StencylForge, search for "Demo-". That will open up all of my demo games. Once you see them, you will notice that I just uploaded a "Real Text Boxes" demo. I finally got the last bugs out. The code itself is commented as best as I could, so hopefully you will be able to understand how it works (if not, please let me know).

I hope it helps :)
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

GregAnims

  • Posts: 305
This is gonna open up a whole world of opportunities for my Stencyl games! I always wanted to play with creativity and having people share their stuff with each other, can't thank you enough dude :)

Tuo

  • *
  • Posts: 2469
I'm happy to help :).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

GregAnims

  • Posts: 305
Won't let me preview/export, not on your demo either.

Funny thing is, i can play when i use the "play now!" on stencylforge. Any ideas?

Tuo

  • *
  • Posts: 2469
Did you follow the instructions in the coding? There's one in particular, which is the setting of the font that is ONLY for my computer. You need your own font in that path.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

GregAnims

  • Posts: 305
Yeah i set the font path (.tff), and i set the game attribute.

EDIT: Whoops, i was putting backslashes in instead of / , its sorted now thanks mate

Ok, well..  it works on your demo, but not when i export behaviors to my own game. Here's exactly what i'm doing:

>export both behaviors from your demo (as png)
>drag those png files into scene behaviors editor in my own game
>once imported, i change the font path (correctly this time!)
>i make a text attribute "DelayText"
>attach "DelayTextField" to a blank scene

If you can't think of anything obvious, i guess i'll just port the behaviors from my own game into your demo..

« Last Edit: August 03, 2013, 05:19:31 am by GregAnims »

Tuo

  • *
  • Posts: 2469
"DelayText" is a game attribute, not a normal one. Is that the issue?
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

GregAnims

  • Posts: 305
by game attribute, you mean, go Settings > attributes > then make an attribute? I did that.