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.

Newcomers AppGameKit Corner / how do i set text in the same string to be on the next line when displaying?

Author
Message
dandrews
3
Years of Service
User Offline
Joined: 26th Jun 2020
Location:
Posted: 12th Aug 2022 19:06
my goal ids to have SetVirtualButtonText(gunsort.gun,"Sort by gun")
read like this:
Sort
by
gun

but i cant find how to enter the next line
Zappo
Valued Member
19
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 13th Aug 2022 00:12
You can use Chr(10) to insert a carriage return character into text. It doesn't work great on virtual buttons as the text is not centred vertically, but it does work. Use something like this to test it:

dandrews
3
Years of Service
User Offline
Joined: 26th Jun 2020
Location:
Posted: 13th Aug 2022 04:39
thank you zappo the buttons are only temporary but that did work for now.
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 13th Aug 2022 22:03 Edited at: 13th Aug 2022 22:14
Sounds like you're planning on creating an RPG game, maybe you will be wanting an info scroller of some kind?
I threw this together earlier just in case you want a first-in first-out kind of scroller, you may need to modify it but the basics are in there.

Main reason for me including this code is because it's sort of similar to the multiline text you say you wanted, apart from this one scrolls instead of planting line text on a button. Still uses the same text commands that you'll need for what you were talking about further up.

P.S: The info that scrolls up the screen is not important, in case you were wondering, it just text from a file in another game project I did a few months back.

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 15th Aug 2022 19:19 Edited at: 15th Aug 2022 19:21
dandrews, I have something that might work. This is a small window that is scaleable and dragable. It will generate scroll bars based on the content, text alignment can be set , A string is turned into buttons that are displayed on the window. You could use it for multiple choice as well. It also takes a text array or a file location or image source or image id array. It is part of the GUI-api im working on atm if interested just message me on discord. Smerf#6033


Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-25 22:00:15
Your offset time is: 2024-04-25 22:00:15