initial checkin
[org.ibex.widgets.git] / src / org / ibex / games / reversi / square.t
1 <ibex  xmlns:theme="ibex.theme"  \r
2        xmlns="org.ibex.theme.win2k" \r
3        xmlns:games="org.ibex.games"\r
4        xmlns:reversi="org.ibex.games.reversi">\r
5 \r
6 <ui:box shrink="true" fill="black">\r
7 Press1 ++= function (f) {\r
8 ibex.log.info("caught click: " + f + " on box");\r
9 ibex.log.info("color is: " + thisbox.color);\r
10 }\r
11 \r
12 pos ++= function(p)\r
13 {\r
14 //if both are even or both are odd, be lighter color\r
15 if ( (thisbox.boardx/2 == ibex.math.round(thisbox.boardx/2) and\r
16      thisbox.boardy/2 == ibex.math.round(thisbox.boardy/2)) or\r
17      (thisbox.boardx/2 != ibex.math.round(thisbox.boardx/2) and\r
18      thisbox.boardy/2 != ibex.math.round(thisbox.boardy/2))\r
19       )  {\r
20   thisbox.fill="#1E9393";\r
21   } \r
22 else {\r
23   thisbox.fill="#0D8080";\r
24   }\r
25 }\r
26 \r
27 <bevel form="up">\r
28 <ui:box width="50" height="50" />\r
29 \r
30 \r
31 </bevel>\r
32 </ui:box>\r
33 </ibex>