Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Text Box with Scroll Bars

Author
Message
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: SKALD
Posted: 6th May 2025 07:37 Edited at: 6th May 2025 07:39
Hello,

I noticed AppGameKit Studio is on sale on Steam right now until May 12. Thinking of buying.

I'm using AppGameKit Classic for Warlordocracy (and DarkBASIC for Brigand). I like how easy it is to compile AppGameKit for Linux and Android, as well as Windows, and I want to make a cross-platform notepad app that modders can use for scripting for both games. I can make a multi-line edit box in AppGameKit Classic, but it's not easy to make a scroll bar.

Is it easy to make an edit box with automatic scroll bars in AppGameKit Studio by any chance? Also, are there visual features I can add similar to Visual Studio to make Windows apps, like drop boxes, checkboxes, etc.? Again, I want to use AppGameKit because I really love how easy it is to compile across all platforms. Thanks for any advice.

Brian
Laughing Coyote Software
laughingcoyote.net
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: SKALD
Posted: 6th May 2025 08:38
Oops, this should probably be in the AppGameKit Studio forum. Should I repost it?
laughingcoyote.net
Virtual Nomad
Moderator
19
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 6th May 2025 09:11
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th May 2025 20:56 Edited at: 6th May 2025 21:00
I'll have a solution for you this evening (hopefully). Scroll box is simple, adding scroll bars is trivial. Editing text definitely adds complexity, even more so if the font isn't a fixed-width. BUT, it's doable.
Here's a screenshot of what I have so far for ya. The window is resizable. Text is clipped to the window but also I think there's a simple method for word-wrapping if you don't want the horizontal scrollable. Scrollbars are not yet implement, but that's the easy part. The tricky part was getting a caret to position at the correct character location in the text when clicked, but that's complete now. The window text is a single string and inserts new line characters for you. I still have to implement inserting the text at the caret position and handling the delete/backspace keys.





Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: SKALD
Posted: 6th May 2025 22:23
Oh wow you're just writing the code for me, thank you! AppGameKit Classic has a lot more functionality than I realized. I compiled the code and I can resize the box, but I can't get the text cursor to show when I click it.

I could pay you to $100 or something (along with name in credits) if you add in the scroll bars, edit functionality, and make sure it can save a plain text file with multiple lines. I want to distribute a script editor with both of my games for modders, so fixed width text is all I need.

I attached a couple script files so you can see what I want to use it for. They are both plain text that you can open with Notepad. "BSL" is Brigand Scripting Language and "WSL" is Warlord Scripting Language.
laughingcoyote.net
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th May 2025 04:29 Edited at: 7th May 2025 04:30
I do this for fun, not money. Got vertical scrolling. It's not quite perfect yet, needs a few tweaks. You can move the caret with left/right arrow keys and delete, enter, backspace all work. I wrote a different function for detecting the location of the caret when clicked, I think it's more efficient than my original method. If you had a lot of text, there's improvements that could be made for efficiency with the tradeoff of a little extra memory usage, but for the moment the added complexity isn't worth the benefit. Maybe someday I'll tweak it.




Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Pebender
4
Years of Service
User Offline
Joined: 13th Feb 2021
Location:
Posted: 7th May 2025 05:01
Hi and good morning,

shouldn´t it be easier to use a GUI for AppGameKit ?
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: SKALD
Posted: 7th May 2025 05:31 Edited at: 7th May 2025 07:11
The scroll bar works great, but I still can't get the text cursor (caret) to appear when I click for some reason. Do you think it's because I'm using AppGameKit Classic? Not sure what I'm missing.

I'll keep looking at it and get back to you when I figure it out, maybe in a couple days. Thank you so much.

P.S.: I am learning lots of new useful commands like GetTextCharX, which seems to be working.

EDIT: Just found out I gotta hit ENTER first, then I can position the cursor and edit the text, but the cursor still isn't appearing so I can't see current position. I'll figure it out eventually and post back here. Might be a couple days due to day job.
laughingcoyote.net

Attachments

Login to view attachments
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: SKALD
Posted: 7th May 2025 05:33
Quote: "shouldn´t it be easier to use a GUI for AppGameKit ?"


I am thinking about buying AppGameKit Studio. If it includes an editable text box object with scroll bars so we don't have to do this, I will buy it immediately.
laughingcoyote.net
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th May 2025 13:03
I'm using classic, not studio. You shouldn't need to hit enter to move the cursor with the mouse. With arrow keys yes, cause I was initially doing something different so keyboard input was ignored until you hit enter first.
The cursor is drawn and not a sprite, did you add anything in the code to change the draw order?

Quote: "shouldn´t it be easier to use a GUI for AppGameKit ?"

There really isn't one. Nothing built-in anyway, but somebody might've made a library.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: SKALD
Posted: 8th May 2025 05:23
I didn't change the code at all, but for some reason before I can make any changes to the text, I have to press Enter (as well as click in the box before or after). Also the text cursor is never visible.

But this is more than enough code to go on, and I will definitely figure it out as soon as I have more time. I have to finish my main project by the end of the month, but then I will work on this app some more and post here again. Thank you, Phaelax.
laughingcoyote.net
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: SKALD
Posted: 8th May 2025 08:18 Edited at: 8th May 2025 08:19
Also, @Phaelax, can I put your name in the credits for the upcoming script editor and/or the games?

EDIT: Also, money is good because it means you don't have to work full-time and can spend more time coding your own stuff.
laughingcoyote.net

Login to post a reply

Server time is: 2025-05-09 04:22:27
Your offset time is: 2025-05-09 04:22:27