Skip to content

Commit c3d8669

Browse files
authored
Merge pull request #57 from yuchanns/fix/ime-rect
fix: new ime rect api and color
2 parents 45c47e8 + e81a715 commit c3d8669

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎asset/gameplay/ui.dl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ cardlist :
5151
editbox :
5252
cursor_speed : 20
5353
cursor_color : 0x0000ff
54+
preedit_color : 0x000000

‎core/keyboard.lua‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ local fontcobj = font.cobj()
1111
local CURRENT_EDITBOX
1212
local CURSOR_SPEED <const> = ui.cursor_speed
1313
local CURSOR_COLOR <const> = ui.cursor_color
14+
local PREEDIT_COLOR <const> = ui.preedit_color
1415
local KEY_LEFT <const> = 263
1516
local KEY_RIGHT <const> = 262
1617
local KEY_ESC <const> = 256
@@ -113,7 +114,13 @@ function keyboard.editbox(desc)
113114
if x ~= desc.ime_rect_x or y ~= desc.ime_rect_y then
114115
desc.ime_rect_x = x
115116
desc.ime_rect_y = y
116-
app.set_ime_rect(x, y, cw, ch)
117+
app.set_ime_rect {
118+
x=x,
119+
y=y,
120+
width=cw,
121+
height=ch,
122+
text_color=PREEDIT_COLOR,
123+
}
117124
end
118125
desc.cursor = cursor
119126
desc.text = text

0 commit comments

Comments
 (0)