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.

Dark GDK / Text functions

Author
Message
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 25th Jul 2008 05:16 Edited at: 25th Jul 2008 05:19
I'm working on text for message boxes (think Final Fantasy and its blue boxes). The text functions are not well documented, and they aren't working correctly. At least I don't think they are.

I've written a class for Message Boxes. I have basic drawing functionality. Here is the declaration of the main menu's message box.



Now, I'm adding the ability to incorporate text. I'm having some issues. Here's the start (message_text = char*):



This prints no text at all when message_text is set as "Hello this is a test." Also, here is a screen of the main menu.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo

Attachments

Login to view attachments
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 26th Jul 2008 08:50 Edited at: 26th Jul 2008 08:51
Turns out I had the Ink color set to blue still. I made it red, and got the attached image. Not sure what is wrong.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo

Attachments

Login to view attachments
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 26th Jul 2008 09:00
Realized my mistake with pointers. Here's the current code:



message_text = "This is a test."

I get the attached when run. Am I making an obvious mistake?

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo

Attachments

Login to view attachments
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 26th Jul 2008 10:13
Quote: "Am I making an obvious mistake?"


Yes, you're passing the address to a char rather than a c-string to dbText, read this for info on how the data pointed to should be constructed.

Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 26th Jul 2008 11:17
Oops. I forgot that those aren't added automatically. Thanks. It works now.



Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Jul 2008 20:11
No follow up screenie? <sigh> LOL (Just playing with ya)

Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 26th Jul 2008 20:14
Well, if you'd like. XD

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 27th Jul 2008 06:21
I wanna see... D:
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jul 2008 07:17
Tada!

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-30 03:17:12
Your offset time is: 2024-09-30 03:17:12