0

LWJGL ゲームで画面上に六角形を作成しようとしています。私は気の利いたGUIを使用しています。現在2画面ありますが、プログラムで六角形を描く画面に切り替えたいです。

画面用の私のxmlは次のとおりです

<?xml version="1.0" encoding="UTF-8"?>

<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
<useStyles filename="nifty-default-styles.xml" />
<useControls filename="nifty-default-controls.xml" />
<screen id="start" controller="StartScreen">
    <layer id="background" childLayout="center">
        <image filename="util/img/menuTexture.png" />
    </layer>
    <layer id="title" childLayout="vertical">
        <image align="center" height="20%" width="80%" filename="util/img/title.png" />
        <panel id="subactions" childLayout="absolute" marginTop="40%" height="13%">
            <image align="left" height="100%" width="30%" x="0px" y="0px" filename="util/img/rules.png">
                <interact onClick="showRules()" />
            </image>
            <image align="right" height="100%" width="30%" x="70%" y="0px" filename="util/img/exit.png">
                <interact onClick="exitGame()" />
            </image>
        </panel>
        <image align="center" height="20%" width="80%" filename="util/img/start game.png" marginTop="5%">
            <interact onClick="startGame()" />
        </image>
    </layer>
</screen>
<screen id="rules" controller="StartScreen">
    <layer id="background" childLayout="center">
        <image filename="util/img/menuTexture.png" />
    </layer>
    <layer id="transparent" backgroundColor="#D1D1D1A7" childLayout="vertical">
        <panel id="rulesPanel" childLayout="center">
            <image filename="util/img/game rules.png" width="100%" height="100%" />
        </panel>
        <panel id="goToStartPanel" childLayout="center" width="100%" height="13%">
            <image height="100%" filename="util/img/exit.png">
                <interact onClick="goToStartScreen()" />
            </image>
        </panel>
    </layer>
</screen>

そのような画面に切り替えて (nifty.gotoScreen() を使用しますか?)、レンダリング ループを初期化するにはどうすればよいですか?

サンプルコードは役に立ちます。どうもありがとうございました。

4

1 に答える 1