#module
#defcfunc wordchk var s, int ichi
if ichi < 0 : return -1
chk = peek(s, ichi)
if (chk > 128 & chk < 160) | chk > 223 : return 1
if chk = 0 : return -1 : else : return 0
#deffunc timemes var string, array speed, local cx, local cy, local tmps, local count, local bmscr
mref bmscr, 67
cx = ginfo_cx : cx.1 = cx : cy = ginfo_cy
repeat strlen(string)
tmps = strmid(string, cnt, wordchk(string, cnt) + 1)
// 改行1バイト
if wordchk(string, cnt) = 0 & chk = 13 {
chk = peek(string, cnt + 1)
cx = cx.1 : cy += bmscr.32 // 文字の高さ分増やす
continue cnt + (chk = 10) + 1
}
pos cx, cy : mes tmps
cx += bmscr.32 / (2 - wordchk(string, cnt)) // 文字幅(高さ÷2)を取得しカレントポジションの変更
memset tmps, , 4
if count < length(speed) : wait speed.count
count++
continue cnt + wordchk(string, cnt) + 1
loop
pos cx.1, cy + bmscr.32
return
#global
sdim txt, 200
txt = {"
ゆっくりテキストを表示させるテスト。
文字毎にウェイトを設定できるので、
細かな制御が出来るものの、
その都度、間を設定するのは面倒だし、
設定後の再編集(メンテ)もやりにくいことこの上ない・・・。
"}
dim time, 95
time.0 = 60, 20, 5, 20, 5, 5, 5, 5, 20, 5, 5, 5, 5, 10, 5, 5, 20, 60
time.18 = 5, 5, 5, 20, 5, 5, 5, 5, 20, 5, 5, 5, 5, 5, 5, 20, 40
time.35 = 5, 5, 5, 5, 5, 20, 5, 5, 5, 5, 5, 20, 40
time.48 = 5, 5, 40, 40, 40, 20, 5, 5, 5, 5, 5, 5, 5, 5, 5, 20, 40
time.66 = 5, 5, 5, 20, 5, 5, 20, 60, 0, 0, 20, 60, 20, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 60, 60, 60, 60, 60
pos 50, 50 : timemes txt, dummy // 徐々にではなく、ウェイトを掛けず一括表示する
color 255
pos 50, 50 : timemes txt, time // 文字毎にウェイトを掛けて、徐々に表示させる
color
mes "- 完 -"
|