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 Classic Chat / Free Code: Scrolling textbox

Author
Message
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Jul 2012 13:03 Edited at: 25th Jul 2012 13:06
I just made this command set for my current project to display some Terms & Conditions from a ".txt" file. It will display anything the font set will allow and will make the text fit the box. It can be scrolled using the mouse pointer of dragged on touch devices.

EDIT: Putting [b.] without the dot at the start of a line or paragraph will make it bold.

It's a bit slow loading large files but it makes the job simpler

Sample project attached, here's the code:



this.mess = abs(sin(times#))

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Jul 2012 13:03 Edited at: 25th Jul 2012 13:04
Here's what it looks like in my game:



this.mess = abs(sin(times#))

Attachments

Login to view attachments
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 25th Jul 2012 13:34
That's amazing baxslash!

Another one of your fantastic functions. I figure that if I wait long enough, an entire game will be written for me.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Jul 2012 13:41
Maybe one day there'll be enough of my functions on here that you could actually make a game by putting the pieces together...


this.mess = abs(sin(times#))
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Jul 2012 19:57
Excellent, will probably be replacing my own text system with this. Mine fades in beautifully , but doesn't scroll

3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 31st Jul 2012 18:28 Edited at: 31st Jul 2012 18:33
wish someone would convert all your demo code to c++. Alt+ shift+ convert, Know it is done. I convert them manually, but it would be nice if each function that you have displayed on the forums might be in both tiers.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 31st Jul 2012 19:31 Edited at: 31st Jul 2012 19:32
Here is the basic translation to C++:




Though, logic with boxText you have to figure out yourself, because as for now it probably won't work. I am too tired at the moment, sorry.

Follow me on twitter! @MotionStruct
Motion Struct blog
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 31st Jul 2012 21:02
thanks Kamac, very fast translation by the way.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Aug 2012 11:58
I thought I'd share something regarding how I'm using this code now that makes it twenty times faster. If you can convert the text string inserting "chr(10)" in for every line break into just one huge string then save it to a text file using "writeString" just once for the complete string, subsequent loading times are massively reduced. Read the whole thing in using a single "readString" command and make just one text object for the whole thing.

I found that converting the whole string into hard coded text was no faster as it is the createText commands that are taking the time. By making just one single text object and reading just one string (albeit a long one!) is far quicker...

If I get time I'll upload an easily usable version of what my code does now.


this.mess = abs(sin(times#))
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 8th Aug 2012 18:10
Sweet! Looking forward to the update.

Login to post a reply

Server time is: 2024-04-16 06:56:38
Your offset time is: 2024-04-16 06:56:38