Jump to content
  • Advertisement
Sign in to follow this  
rhm3769

XNA 4 tutorials....

This topic is 3036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Decided to try XNA 4 for a board game I've been trying to program. I've programmed alittle bit with Visual Basic for Applications inside of Excel and some years ago with c++. Planning on learning c++ again later on but I decided I'd do this XNA thing. I'm just having problems finding some 2d tutorials for a windows game, everything I'm finding either is going too far in depth for what I need or they're for the windows phone and xbox. Anyone know of any?

Share this post


Link to post
Share on other sites
Advertisement
XNA 4 comes with full documentation that is easy enough to follow, it also has a nice 'how to' section that covers common needs.

The EDUCATION section of creators.xna.com has tons and tons of articles covering most things you can think of.

Don't worry about the phone or xbox stuff. The API is like 90-95% similar across those platforms. All the same C# techniques will apply.

Share this post


Link to post
Share on other sites
I haven't quite looked through everything yet, but I'm wondering, if I'm only requiring a few basic forms as long as the controls on them can be changed as needed, would it be easier designing my own GUI or sticking with Windows Forms? I know, for the most part, Windows Forms, but I kind of want to stay away from those as I eventually plan to move to c++ and DirectX, and I haven't been able to find any GUI stuff for XNA 4. Also, planning on having this game run full screen, been told that Windows Forms and full screen don't work.

Creating my own could be as simple as drawing a box and drawing whatever "buttons" and text I would need and reading mouse inputs for the area covered by the "buttons" correct? Could I even create the forms I need in paint or something and have the file loaded with everything on it already and just draw whatever text is needed over that and get the inputs?

Or are there any GUI's made for XNA 4 yet? Assuming no since it's beta still?

Share this post


Link to post
Share on other sites
GUIs really aren't an XNA topic. It's no different in XNA than it would be anywhere else.

Draw your buttons to the screen, and when the users clicks the mouse, check the cursor location against their boundaries. Then process whatever action is supposed to happen when the buttons get clicked.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daaark
GUIs really aren't an XNA topic. It's no different in XNA than it would be anywhere else.

Draw your buttons to the screen, and when the users clicks the mouse, check the cursor location against their boundaries. Then process whatever action is supposed to happen when the buttons get clicked.


it was more of a way of asking if there are any GUI's for xna 4 without asking, but I think I'm gonna work with windows forms for now if I can find a way to modify the appearance of the game window xna creates to simulate full screen. I've seen a thread or two on here about it but the answer I found didn't look like c# and it didn't say what it was.

Share this post


Link to post
Share on other sites
Quote:
Original post by rhm3769
it was more of a way of asking if there are any GUI's for xna 4 without asking, but I think I'm gonna work with windows forms for now if I can find a way to modify the appearance of the game window xna creates to simulate full screen. I've seen a thread or two on here about it but the answer I found didn't look like c# and it didn't say what it was.


Write what you mean next time.

XNA 4 is still in beta at the moment. I doubt there are any good libraries out there for it right now. But googling 'XNA 4 GUI Library' isn't hard.

Using Windows Forms with XNA is easy. There are tutorials on the creators.xna.com site in the education section.

There window XNA creates doesn't have to simulate fullscreen, just toggle fullscreen. There is actually a ToggleFullscreen() function that will do it for you, or you can just start in fullscreen mode by setting the proper FullScreen bool to true in the constructor of Game1 where the GraphicsDevice is initialized.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daaark
Quote:
Original post by rhm3769
it was more of a way of asking if there are any GUI's for xna 4 without asking, but I think I'm gonna work with windows forms for now if I can find a way to modify the appearance of the game window xna creates to simulate full screen. I've seen a thread or two on here about it but the answer I found didn't look like c# and it didn't say what it was.


Write what you mean next time.

XNA 4 is still in beta at the moment. I doubt there are any good libraries out there for it right now. But googling 'XNA 4 GUI Library' isn't hard.

Using Windows Forms with XNA is easy. There are tutorials on the creators.xna.com site in the education section.

There window XNA creates doesn't have to simulate fullscreen, just toggle fullscreen. There is actually a ToggleFullscreen() function that will do it for you, or you can just start in fullscreen mode by setting the proper FullScreen bool to true in the constructor of Game1 where the GraphicsDevice is initialized.


it's been googled quite a few times xna 4 gui, xna 4 c# gui, c# gui, c sharp xna4 gui, it's just not returning anything relevent or it comes back with tutorials on customizing the look of Windows Forms, which I figured out on my own. I was only asking in case someone here knew of some that google wasn't finding. I prefer simulating fullscreen as opposed to actual fullscreen because on a test run I did, the windows form didn't show correctly. I found what I was looking for eventually doing numerous google searches similar to what I did above, I saw it before by accident and couldn't find it until yesterday. I was trying to avoid using windows forms since I pretty much knew how to use them from needing to use them for a program I wrote in VB and what I had to teach myself for that and when I first started trying to program this game.

The game ended up being more of recorded macros instead of me actually programming it, and it wasn't VB, it was VB for Applications inside of Excel so.... Wanting a more polished look than what I got from VBA so I'm starting it over in XNA.... I lost the file, so if I can't remember how I did it in VBA and I can't find it through google, my next question is gonna be on passing data from forms back to the game.... I know about setting everything to public but I don't remember if I had the part of the program needing stuff from the form call the form and that's why I had the forms show up when they did or it just made sense to call them that way....

Not too big of a deal as I'm not planning on seeing any immediate results as of yet, I'm seeing how to do stuff and trying different GUI options out to see what works better and what is more logical and would make sense to someone other than me since I know the game flow and how to use whatever GUI system I decide on so what I'm planning now will probably end up changing by the time I'm done with it. What I'm learning now will still be useful as I'll have to implement it later as some parts of the gui won't change and there's a chance particular stuff I'm planning on now that I'll end up taking out might be added in to something later on.

On another note, I start my intro programming class the middle of october and everything goes from there, although I think most of the classes are c++ with some java. The intro class won't be anything new, the c++ tutorials I've went through follow the same basic path the intro course did I took 8 years ago....

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!