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 / I can't figure out dbBox

Author
Message
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 02:18
The description gives no help, and messing with it just confused me. How does it work?

dbBox ( int iLeft, int iTop, int iRight, int iBottom )

It just doesn't make sense to me how it can draw without being given a starting (x, y) value.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 02:21
You give it the top-left corner's coordinates, and the bottom-right corner's coordinates. You do give it a starting '(x, y) value'.




My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 02:22
Hmm.... they could have made that more clear with something like:

dbBox ( int start_x, int start_y, int end_x, int end_y );
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 02:29 Edited at: 10th Jul 2008 02:30
They could have, but I've never seen a box command like that. I come from a background of MS-DOS programming, where simulating windows with ASCII frames is the way to get things done. Every generic border function that I wrote, and all those that I saw used the "Top, Left, Right, Bottom" system. The idea is to distinguish it from drawing a line.


My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 02:31
True. Thanks, though.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 02:58 Edited at: 10th Jul 2008 03:00
Thanks for the help. Using it to draw message boxes. Is that the way to go?

EDIT: I cannot get it to put an image in a message!

Attachments

Login to view attachments
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 06:59
I assume you're not using the Windows API command, MessageBox(), and that you've made something yourself using the GDK. You'll have to post your code and be a bit more specific.


My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 07:10
The image attached to my last post shows what I'm using the dbBox command to draw. My edit was referring to the fact that I can't get an image to show in a post, only attached.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 07:26
Ah! That makes more sense.

Anyway, nice box.


My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 07:34
Thanks. I'm currently working on how to best implement text for the message boxes. I'm thinking skillful use of dbText or dbPrint. Any suggestions?
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 07:47
This is a very tough thing to do properly. What you want to do is create a word wrapping system, so that if you're text is going to run out of the message box, it'll go to the next line. I had a working system for this when I was developing for Nintendo's DS, but that was only for fonts in which all the characters are the same width, in terms of pixels.


My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 08:00
1( would you recommend trying to use dbText?

2( tell me more about developing for the DS.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 08:07 Edited at: 10th Jul 2008 08:11
For the first question, I don't know what would be best. dbText() would probably be better, because you can position the text in the same command that you print. As for detecting the end of a line and wrapping, I don't know what you should do.

On question two, DS dev isn't like working with Windows, or for that matter PC. It's quite a bit more difficult to understand, because you are working directly with the hardware, rather than with DarkGDK, which then controls DirectX, then the graphics card's driver, which gets to hardware. That being said, it's still not as complicated as Direct3D providing you use DevKitARM (A compiler like the one that comes in Visual Studio, but designed to compile C into code for ARM7 and ARM9 cpus, instead of the typical x86 CPU architecture of a PC running Windows) and PAlib (the NDS equivalent of DarkGDK, though much lower-level control, less is done for you). All of that established, homebrew development requires expensive hardware that isn't cost-effective, unless you REALLY love making DS applications.
Some sites to check out include:
http://www.devkitpro.org/
http://www.ndshb.com/
http://forum.palib.info/


My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 17:50
I'll work the text scrolling out myself, just curious about using dbText.

That's pretty cool. I knew it was ARM, but wasn't sure what options there were to compile and make graphics. Thanks.

Login to post a reply

Server time is: 2024-09-30 01:25:39
Your offset time is: 2024-09-30 01:25:39