#defcfunc の中では,ほかの #defcfunc で宣言された関数を利用できなぃらしぃ.

This commit is contained in:
2023-07-10 01:24:27 +09:00
parent 6c894c9bde
commit f148df36ed
4 changed files with 82 additions and 127 deletions
+1 -90
View File
@@ -1,90 +1 @@
いうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもや(ゆ)よらりるれろわゐーゑをん!?・…がぎぐげござじずぜぞだぢづでどばびぶべぼぱぴぷぺぽぁぃぅぇぉゃ,ゅ.ょ
+6 -4
View File
@@ -43,6 +43,8 @@
ChDir "assets"
#endif ; not _DEBUG
Font MSGOTHIC, 96
ViewCalc VPTYPE_2D, Double (gInfo_winX) / DISPLAY_WIDTH, Double (gInfo_winY) / DISPLAY_HEIGHT
; 背景
@@ -87,10 +89,7 @@
Show@Keyboard
Pos 100, 100
NoteSel test
NoteLoad "test.txt"
NoteUnsel
Text = New@Char (test)
Text = New@Char ("")
size@Char.Text = 240
Repeat
@@ -101,6 +100,9 @@
Draw@Goatoh Goatoh
Draw@Char
Draw@Keyboard
a = GetChar@Keyboard ()
text@Char.Text = text@Keyboard
ReDraw True
Await LOOP_INTERVAL
+55 -17
View File
@@ -8,9 +8,10 @@ Char
New \
str p_text
If insNum <= 0 {
NoteSel charDict
NoteLoad "dict.dat"
NoteUnsel
SDim charDict, 384
SDim text, 1024
BLoad "dict.dat", charDict
}
text.insNum = p_text
@@ -34,31 +35,68 @@ Destroy \
#deffunc local \
Draw \
local cnt_,\
local found,\
local zoom
local l_cnt,\
local l_found
Repeat insNum
If exists.cnt {
cnt_ = cnt
l_cnt = cnt
NoteSel charDict
Repeat StrLen (text.cnt_) / 3
Pos posX.cnt_ + cnt * size.cnt_, posY.cnt_
Repeat StrLen (text.l_cnt) / 3
l_found = MyInStr (charDict, 0, StrMid (text.l_cnt, cnt * 3, 3)) / 3
found = NoteFind (StrMid (text.cnt_, cnt * 3, 3))
If found = -1 {
found = UNKNOWN
If darw_found < 0 {
l_found = UNKNOWN
}
zoom = Double (size.cnt_) / CHAR_WIDTH
CelPut BUFFER_CHAR, found, zoom, zoom
Pos posX.l_cnt + cnt * size.l_cnt, posY.l_cnt
l_zoom = Double (size.l_cnt) / CHAR_WIDTH
CelPut BUFFER_CHAR, l_found, l_zoom, l_zoom
Loop
NoteUnsel
}
Loop
Return
#defcfunc local \
MyInStr \
str p_haystack,\
int p_offset,\
str p_needle
myInStr_haystack = p_haystack
myInStr_flag = True
Repeat StrLen (myInStr_haystack) / 3
SDim myInStr_work, 3
myInStr_cnt = cnt
Repeat 3
Poke myInStr_work, cnt, Peek (myInStr_haystack, myInStr_cnt * 3 + cnt)
Loop
If myInStr_work = p_needle {
myInStr_flag = False
Break
}
Loop
If myInStr_flag {
Return -1
}
Return myInStr_cnt * 3
#defcfunc local \
MyStrMid \
str p_string,\
int p_offset,\
int p_length,\
int p_test
myStrMid_string = p_string
SDim myStrMid_return, p_length
Return myStrMid_return
#global
+18 -14
View File
@@ -15,33 +15,37 @@ Hide
Return
#defcfunc local \
GetChar \
local l_ids,\
local l_touchInfo,\
local l_charId,\
local l_char
GetChar
if showing = False {
Return ""
}
MTList l_id
MTList getChar_id
If stat = 0 {
touching = False
Return ""
}
MTInfo l_touchInfo, l_id.0
If l_touchInfo.2 < 1920 - 480 {
If touching {
Return ""
}
l_charId = (1080 - l_touchInfo.1) / 96 * 5 + (l_touchInfo.2 - (1920 - 480)) / 96
MTInfo getChar_touchInfo, getChar_id.0
NoteSel charDict@Char
NoteGet l_char, l_charId
text += l_char
NoteUnsel
If getChar_touchInfo.2 < 1920 - 480 {
Return ""
}
getChar_charId = (1080 - getChar_touchInfo.1) / 96 * 5 + (getChar_touchInfo.2 - (1920 - 480)) / 96
getChar_textLength = StrLen (text)
Repeat 3
Poke text, getChar_textLength + cnt, Peek (charDict@Char, getChar_charId * 3 + cnt)
Loop
touching = True
Return ""