【Lua与汉化】Lua字库阵列汉化法核心代码揭秘
本帖最后由 shane007 于 2011-3-24 22:00 编辑Lua汉化的核心原理,就是把字幕内容修改为数字,然后映射到字库阵列上。
我把核心演示代码发出来,大家一看就明白了。
这个程序在lua里测试通过。
local text_for_test1 = "769"
function DispText(text)
local font_no
local font_char_id
if text>="1" and text<= "256" then
font_no = 1
elseif text>="257" and text<= "512" then
font_no = 2
elseif text>="513" and text<= "768" then
font_no = 3
else
font_no = 4
end
font_char_id = text % 256 -1
print(font_no)
print(font_char_id)
end
DispText(text_for_test1)
看看先 007,建议你用code的功能
直接复制好像有防复制码什么的
使用办法
【code】内容【/code】
【】替换为[]
显示:内容
页:
[1]