Note that there are some explanatory texts on larger screens.

plurals
  1. POBooks for UI development in XNA 4.0
    primarykey
    data
    text
    <p>I'm hoping to develop a basic (at first) custom UI for a game I'm working on. It will be used for the game itself as well as the modding tools. I have looked at the Game State Management Sample, but it just gives a bunch of code with no real explanation as to why things are working. My learning style is such that I have to know the why before I can understand the how if I'm really going to understand something. This is why I would like to get a book rather than just download another code sample.</p> <p>I can create the visual part of the UI object without any issue (the easy part) and I have an idea as to how I'll use them (with event handlers) but I'm having a hard time connecting an event handler that is fired by either key press or by mouse click to a button on the screen in XNA.</p> <p>Any suggestions for books or online tutorials / lectures would be great. Code samples, although appreciated, are not very helpful without an accompanying tutorial or book. On the other hand, tutorials or books without source code aren't very useful to me either. Also, no ziggyware tutorials please. I loved them, but they are down :(</p> <p>Edit:</p> <p>An alternative approach I've thought of (but don't like much) is when a menu pops up, it pauses the game (if needed) and displays the menu. Then, whenever the mouse is clicked it checks the coordinates of the mouse click and checks to see if they intersect with one of the menu items. It's a possibility, but it seems like it's too messy and I feel like I should be able to tap into the event handlers. In fact, I know I can because the Game State Management Sample used them, although I'm not clear how.</p> <p><strong>Link</strong></p> <p>using the tutorial <a href="http://davisxna.wordpress.com/2011/03/31/xna-controls-buttons-labels-pictureboxes-2/" rel="nofollow">here</a> I was able to understand how to use events with custom controls in xna. I was helped most by part 3, where it talked about making buttons. I then saw it referenced a class in the Game State Management sample (InputState). I read through InputState again and the code that used it in part three and I feel like I understand it fairly well.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload