开发者

Adding Buttons in DOS [closed]

开发者 https://www.devze.com 2023-03-11 18:07 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reaso开发者_开发百科nably answered in its current form.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reaso开发者_开发百科nably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

How can I add a button in a c++ dos evironment? One where when you click it, it creates a response from the game. (If there is a library and an A file, I can add those)


... in which case I would suggest Allegro 4.2 for DOS. But that only works in 80386 and higher CPUs, not 16-bit computers.


Would this help ?

http://www.stanq.com/dosbuttons.html Or we have Allegro I would recommend Allegro

You can have a look of a review of allegro here on my blog. And get the UI Button and other widget manual here

To learn allegro you can read: Game Programming All In One by Jonathan S. Harbour. . It is a good one for beginners.


Command line is pretty much text only. If you want to use the mouse, or any kind of non-text GUI you will need a library and the library you use depends entirely on what you want to do.


You should use a UI library if you want to create UI type things. MFC, QT or Win32 API are one's I know about for windows. In the Console, I think it would be very hard to create buttons.


You will need to get the coordinates of the mouse click and determine if they are within the with button. If they are within the button, you should change the button's color to indicate a press, then perform some action (or execute through a function pointer).

This is how most GUI frameworks handle buttons.

(You may want to move away from DOS and use a Graphics Framework for Windows.)

0

精彩评论

暂无评论...
验证码 换一张
取 消