1 import("piece_theme.lua")
2 import("shogi_themelib.lua")
10 theme
.options
= OptList
{
11 BoolOpt("moves_overlay", "Moves overlay", true)
14 function addChar(char
, promoted
)
15 return function(i
, size
)
16 i
:draw_glyph(Rect(0,0,size
,size
), "Shogi.ttf", char
,
17 promoted
and "#d00000" or "#004000",
23 function shogi_piece(char
, white
, promoted
, ratio
, ...)
24 return addShadow(overlay(tile(white
, ratio
),
26 addChar(char
, promoted
)))
29 theme
.black_king
= shogi_piece("0x6B", false, false, 1,
32 {-1,-1},{0,-1},{1,-1})
33 theme
.black_rook
= shogi_piece("0x72", false, false, 0.96,
34 {-1,0,1},{1,0,1},{0,-1,1},{0,1,1})
35 theme
.black_p_rook
= shogi_piece("0x52", false, true, 0.96,
36 {-1,0,1},{1,0,1},{0,-1,1},{0,1,1},
37 {-1,-1},{1,-1},{-1,1},{1,1})
38 theme
.black_bishop
= shogi_piece("0x62", false, false, 0.93,
39 {-1,-1,1},{1,-1,1},{-1,1,1},{1,1,1})
40 theme
.black_p_bishop
= shogi_piece("0x42", false, true, 0.93,
41 {-1,-1,1},{1,-1,1},{-1,1,1},{1,1,1},
42 {-1,0},{1,0},{0,-1},{0,1})
43 theme
.black_gold
= shogi_piece("0x67", false, false, 0.9,
46 theme
.black_silver
= shogi_piece("0x73", false, false, 0.9,
49 theme
.black_p_silver
= shogi_piece("0x53", false, true, 0.9,
52 theme
.black_knight
= shogi_piece("0x68", false, false, 0.86,
54 theme
.black_p_knight
= shogi_piece("0x48", false, true, 0.86,
57 theme
.black_lance
= shogi_piece("0x6C", false, false, 0.83,
59 theme
.black_p_lance
= shogi_piece("0x4C", false, true, 0.83,
62 theme
.black_pawn
= shogi_piece("0x70", false, false, 0.8,
64 theme
.black_p_pawn
= shogi_piece("0x50", false, true, 0.8,
68 theme
.white_king
= shogi_piece("0x6B", true, false, 1,
71 {-1,-1},{0,-1},{1,-1})
72 theme
.white_rook
= shogi_piece("0x72", true, false, 0.96,
73 {-1,0,1},{1,0,1},{0,-1,1},{0,1,1})
74 theme
.white_p_rook
= shogi_piece("0x52", true, true, 0.96,
75 {-1,0,1},{1,0,1},{0,-1,1},{0,1,1},
76 {-1,-1},{1,-1},{-1,1},{1,1})
77 theme
.white_bishop
= shogi_piece("0x62", true, false, 0.93,
78 {-1,-1,1},{1,-1,1},{-1,1,1},{1,1,1})
79 theme
.white_p_bishop
= shogi_piece("0x42", true, true, 0.93,
80 {-1,-1,1},{1,-1,1},{-1,1,1},{1,1,1},
81 {-1,0},{1,0},{0,-1},{0,1})
82 theme
.white_gold
= shogi_piece("0x67", true, false, 0.9,
85 theme
.white_silver
= shogi_piece("0x73", true, false, 0.9,
88 theme
.white_p_silver
= shogi_piece("0x53", true, true, 0.9,
91 theme
.white_knight
= shogi_piece("0x68", true, false, 0.86,
93 theme
.white_p_knight
= shogi_piece("0x48", true, true, 0.86,
96 theme
.white_lance
= shogi_piece("0x6C", true, false, 0.83,
98 theme
.white_p_lance
= shogi_piece("0x4C", true, true, 0.83,
101 theme
.white_pawn
= shogi_piece("0x70", true, false, 0.8,
103 theme
.white_p_pawn
= shogi_piece("0x50", true, true, 0.8,
107 -- To be able to adapt this theme to chess too
108 -- should use a Free King (\u5954\u738b) instead
109 theme
.black_queen
= theme
.black_gold
110 theme
.white_queen
= theme
.white_gold