提问人:Frazer 提问时间:7/3/2023 最后编辑:Frazer 更新时间:7/10/2023 访问量:17
我需要加载一个 XML 文件并将其用作用户界面
I need to load an XML file and use it as a user interface
问:
下面是我需要在游戏菜单的上下文中加载的文件示例:
<?xml version="1.0" encoding="UTF-8"?>
<Menus version="1.0">
<Menu number ="0" type ="1" title ="Start Menu" bgbitmap ="bg01.png">
<Button position ="0" title ="New\nGame" bitmap ="newgame.png" vsize ="1" hsize ="3">
<Action type ="onclick" command ="startNewGame">
<Parameter name ="authority" value ="admin" />
<Parameter name ="disabled" value ="false" />
</Action>
</Button>
<Button position ="1" title ="Load\nGame" bitmap ="load game.png" vsize ="1" hsize ="3">
<Action type ="onclick" command ="loadGame">
<Parameter name ="authority" value ="admin" />
<Parameter name ="disabled" value ="false" />
</Action>
</Button>
</Menu>
<Menu number ="1" type ="1" title ="Settings Menu" bgbitmap ="bg01.png">
<Button position ="0" title ="VSync Off" bitmap ="vsync.png" vsize ="1" hsize ="1">
<Action type ="onload" command ="loadVsyncValue" />
<Action type ="onclick" command ="toggleVsync">
<Parameter name ="authority" value ="admin" />
<Parameter name ="disabled" value ="false" />
</Action>
</Button>
<Button position ="1" title ="FullScreen Off" bitmap ="fullscreen.png" vsize ="1" hsize ="1">
<Action type ="onload" command ="loadFSValue" />
<Action type ="onclick" command ="toggleFS">
<Parameter name ="authority" value ="admin" />
<Parameter name ="disabled" value ="false" />
</Action>
</Button>
</Menu>
</Menus>
是否可以加载一种平铺菜单并使用 Javascript 与 Canvas 元素一起显示它? 我对 HTML/CSS/JS 有少量经验,但并不真正了解 XML 解析或类似的东西
我之前看过票,但没有一个详细说明这个项目需要什么。
任何形式的帮助将不胜感激!
编辑 - 我应该提到我想使用 Canvas 元素来显示 XML 文件中提到的图像。
答: 暂无答案
评论
"