Is there any way to use HTML/CSS to do the user interface for a XNA game? I would need to programmatically be able to updat开发者_如何学Ce the HTML, as well as handle events.
Or is there another framework I should be using? This thread looks promising: UI library for XNA
Also, whatever I use has to work on the Xbox 360.
Some of the libraries mentioned in that other SO thread are basically the direction you will need to take (at least for UI rendering). There is no built-in way of taking HTML/CSS and rendering it using the XNA libraries. I mean, it's not to say that someone couldn't do it, but it would not be practical because there is no simple way of drawing things like there was in GDI+.
Most XNA text rendering is glyph based, meaning that each character in a given font is turned into a texture which can then be rendered onto some 3d geometry
No support for HTML/CSS in XNA. No support for Silverlight controls in the XNA GSE 4.0 CTP, either.
The other Stack Overflow thread is likely to be your best bet.
So to understand that - there is no HTML/CSS/JavaScript support in XNA framework and unless someone port Webkit to XBox (http://gpl.ea.com/skate3.html) or Microsoft will add Silverlight support, which might come with some WebView components (see here: http://www.winrumors.com/microsoft-may-announce-silverlight-for-xbox-next-week/), we are out of luck?
BR STeN
The only problem with the examples in the other thread are that they only support windows-like gui interfaces. In that case windows forms is indeed the best solution (on the site of xna creators club there is a tutorial about that), but for more complex texture-based gui it's not good enough (like having buttons with a special form,...)
You could try out Awesomium with the AwesomiumDotNet wrapper. I'm not too familiar with XNA, so I'm not sure if this will work on the Xbox though. I did get a simple test of drawing a webpage that also showed the game's total elapsed time up and running very quickly.
精彩评论