Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / wxwindows gui for a game

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxwindows gui for a game
#2950
Posted by: 2003-11-22 22:14:10
H i im in a bit of a jam ive made a card game in c++, but am having difficulties designing the ui in wxwindows is there any person with some knowledge of the application that can take a look at my game and show me how to start. iknow what the interface needs to do but am having problems undrsnding how to implement the ideas in wxwindows
i would be ver grateful

thanx

faisal
Message2. Re: wxwindows gui for a game
#2952
Posted by: upCASE 2003-11-23 02:32:40
Hi!
If I can be of help, I'll try :)
Tell me what you need and give me some time.
I'm quite sure that there are others in this forum who could help you, so maybe wait a little while and I guess they'll show up.

Anyway: If it's urgent, mail me or post here and I'll try to have a look at it.

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: wxwindows gui for a game
#2953
Posted by: 2003-11-23 23:09:10
Thanx upcase I do appreciate the assistance let me just get my code in classes and ill send u a copy
I basically have designed a game that plays blackjack21 and require a gui

Thanx for the reply
Message4. Re: wxwindows gui for a game
#2956
Posted by: 2003-11-23 23:39:01
sorry having problems attatching if you give me your email address i can mail the images to u

faisal
Message5. Re: wxwindows gui for a game
#2958
Posted by: upCASE 2003-11-24 03:45:42
Hi!
I deleted your other postings about not beeing able to add the picture. I guess one can add zip files but not pictures themself.

Well, it's not going to be that easy to implement the interface the way as it's shown on the picture you send me.
For the cards I suggest having a look at the sources of "forty", a gard game demo written with wxWindows, located in the /demo/forty dir of your wxWindows release. Pay attention to the sources for pile and card, because I guess that's what you need.
For the scores: Implement a seperate panel using static texts and LED controls. LED controls can be found in the gizmos classes located in the contrib/gizmos dir. Use wxLEDNumberCtrl of the gizmos classes to display the scores.
The buttons and background will be the hardest part. You could use wxBitmapButton to put a bitmap on the buttons. But that would still draw a gray button with a bitmap on it instead of a label. Another way to do it involves writing your own button class, subclassing from wxControl, which would be something like a static bitmap behaving like a button when it is clicked. To display an image on the background panel you would also have to do this by creating your own control.
Currently wxWindows doesn't support skins/themes directly. In the next version it will be possible to change the renderers, but I don't think it to be a real "skinning engine". I wrote skinned versions of different controls, but due to the lack of interest never released them. They're written in a not very nice style and I don't intend to work on them at the moment. When the next version of wxWindows is out, I'll see if I can add them as a renderer. Currently they use a zip file to be loaded.

Hope this helps a little.

upcase



Post Edited (11-24-03 03:46)
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message6. Re: wxwindows gui for a game
#2966
Posted by: 2003-11-24 19:54:13
Sorry i cant find the dir, as for the background then i just want it to be green
as for the cards i was assuming they might be an array of images
Message7. Re: wxwindows gui for a game
#2967
Posted by: upCASE 2003-11-24 20:24:39
Hi!
I just mailed you the sources you missed.

For the background use a panel and call SetBackgroundColour().

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message8. Re: wxwindows gui for a game
#2989
Posted by: upCASE 2003-11-27 00:35:13
Hi!
Qouting from your last email:
"I had a look at the card class and as im a first time wx user it was chinese
to me.
Basically dont really know how to implement this but i have a game with an
array cards so im assuming ill need a frame which has an array of images for
cards, i also have a score variable that can out score to the screen but how
to make this ???????????????????????
...
in the mean time you think u could give me an understandable for a window
containing a green background and a score LED and  7 button 4 grouped to the
lest and 3 to the right
Sorry to be a pain. Ithought this will allow me to understand it better and
later i can add stuff to it gradually."

I guess you should firstly try to write some simple "hello world" apps to learn about the event handling system and the sizers. Read the API and look at some of the basic examples included in the wxWindows package.

Sure, you can use an array of images. You can use whatever you like... You can surely output the score, be it in a LED control or a simple text control.
But this is what I mean: I can understand that wxWindows may be hard for a beginner and that the API may not be well written in some places, but therefor you should try to write some simple apps before switching to a bigger prioject like you game.

I could write you an example app when I find some time, but the question is if you'd really learn something from it.
Have a look again at the classes I mentioned in my previous post and try to understand them.

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2023-2-4  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0