Ctrl+F11设计的测试界面,在单机里面看不到文字效果。
附上代码:local _parent = GUI:Win_Create("test_openui", 0, 0, 0, 0, false, false, true, false)if _parent then
local winSize = SL:GetScreenSize()
local x = winSize.width / 2
local y = winSize.height / 2
local w = winSize.width
local h = winSize.height
local bg_close = GUI:Image_Create(_parent, "bg_close", 0, 0, "res/01/010010.png")
if bg_close then
GUI:setContentSize(bg_close, {width = w, height = h})
GUI:setTouchEnabled(bg_close, true)
GUI:addOnClickEvent(bg_close, function()
GUI:Win_Close(_parent)
end)
end
local ImageView = GUI:Image_Create(_parent, "ImageView", 13.00, 319.00, "res/public/bg_npc_10.jpg")
GUI:setTouchEnabled(ImageView, false)
GUI:setTag(ImageView, -1)
-- Create Text
local Text = GUI:Text_Create(ImageView, "Text", 100.00, 210.00, 16, "#ffffff", [[测试一下啊]])
GUI:setTouchEnabled(Text, false)
GUI:setTag(Text, -1)
GUI:Text_enableOutline(Text, "#000000", 1)
-- Create Button
local Button = GUI:Button_Create(ImageView, "Button", 88.00, 34.00, "res/public/1900000612.png")
GUI:Button_loadTexturePressed(Button, "res/public/1900000611.png")
GUI:Button_loadTextureDisabled(Button, "res/private/gui_edit/Button_Disable.png")
GUI:Button_setTitleText(Button, "启动")
GUI:Button_setTitleColor(Button, "#ffffff")
GUI:Button_setTitleFontSize(Button, 14)
GUI:Button_titleEnableOutline(Button, "#000000", 1)
GUI:setTouchEnabled(Button, true)
GUI:setTag(Button, -1)
end
已经解决:前端文件编码格式必须是UTF-8
页:
[1]