Created
October 28, 2011 18:09
-
-
Save chanwit/1322937 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <zk apply="zk.grails.Hangman"> | |
| <vbox> | |
| <hbox> | |
| Number of Wrong Guess: <label id="count" /> | |
| </hbox> | |
| <image id="imgStep"/> | |
| <hbox> | |
| The Word: | |
| <label id="answer"/> | |
| </hbox> | |
| Chracters: | |
| <hbox id="buttons"/> | |
| <hbox id="buttons"/> | |
| <box height="20px"/> | |
| <label value="New Game?" id="lblNewGame" | |
| style="cursor: pointer; text-decoration: underline; color: maroon;" /> | |
| </vbox> | |
| </zk> | |
| class HangmanComposer { | |
| } | |
| class HangmanViewModel { | |
| static binding = { | |
| count 'value,style':'count' | |
| imgStep src:"hangmanStep" | |
| } | |
| def hangmanStep = { "images/hangman/step${hangman.wrong+1}.gif" } | |
| def count = { | |
| if (hangman.win) | |
| [style:"color: green", value: "YOU WIN !!"] | |
| else if(hangman.gameOver) | |
| [style:"color: red", value: "GAME OVER"] | |
| else | |
| [style:"color: black", value: hangman.wrong] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment