Skip to content

Latest commit

 

History

History
1481 lines (1083 loc) · 40.5 KB

File metadata and controls

1481 lines (1083 loc) · 40.5 KB

API 参考说明

目录

基本
属性设置
默认属性设置
显示
交互
图片配置
Json
Csv
存档
文本库
时间
其他

基本

function Color(name)

name: 颜色名,或者使用编码#RRGGBBAA

颜色定义函数 有效颜色名:

名字 说明
white 白色
black 黑色
blue 蓝色
clear
gray 灰色
grey 灰色
green 绿色
magenta 紫红色
red 红色
yellow 黄色
    Color("red")
    Color("#ff00ff")

function Color(r, g, b, a=1)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

颜色定义函数

Color(1, 1, 1)

function GetWordCount(str, richedit=false)

str: 字符串, 文本内容 richedit: 布尔型, 是否启用富文本(默认为false)

计算文本字符数。小于0x7f的字符计为1,另外计为2

local count = GetWordCount("Hello World!")

function GetDisplayLength(str, fontsize=[Config.FontSize], richedit=false)

str: 字符串, 文本内容 richedit: 布尔型, 是否启用富文本(默认为false) fontsize: 数值型, 字体尺寸(默认为当前字体尺寸)

计算文本宽度。

local width = GetDisplayLength("Hello World!")

function GetStringBar(str, count)

str: 字符串, 文本内容 count: 数值, 数量

生成一个文本条

local bar1 = GetStringBar("*", 10) -- bar = "**********"
local bar1 = GetStringBar("-", 20) -- bar = "--------------------"

function Space(count)

count: 数值, 空格数量

生成空格数量

function StrConv(str, convmode)

str: 字符串, 文本内容, 需要转换的字符串 convmode: 值枚举, 转换枚举

字符串按模式转换

枚举 转换模式
STRCONV_UPPER 转换为大写
STRCONV_LOWER 转换为小写
STRCONV_WIDE 转换为宽字符
STRCONV_NARROW 转换为窄字符
local str1 = StrConv("ABC123", STRCONV_LOWER) -- str1 = "abc123"
local str2 = StrConv("ABC123", STRCONV_WIDE) -- str2 = "ABC123"

属性设置

function SetFlags(flags)

flags: 表, 标识

设置标识表, 标识说明表

键名 说明
isbutton 是否为按钮, 建议使用Button系列函数
underline 下划线
strickout 删除线
richedit 富文本
monospaced 等宽字符, 默认为true
gradient 渐变
outline 描边
shadow 阴影
bold 粗体
italic 斜体
SetFlags({
    underline = true,
    richedit = true,
    monospaced = true,
})

function GetFlags()

过去当前标识表

function PushFlags()

当前标识配置压入存储栈

function PopFlags()

弹出存储栈到当前标识配置

PushFlags()
SetFlags({underline = true})
-- ...
PopFlags()

function DefaultFlags()

恢复默认标记配置, 默认标记配置参看这里

function SetColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置打印文本颜色

function SetColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置打印文本颜色

function GetColor()

获取当前打印文本颜色

function PushColor()

当前打印文本颜色压入存储栈

function PopColor()

弹出存储栈到当前打印文本颜色

function DefaultColor()

恢复默认打印文本颜色

function SetGradientColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置打印渐变文本颜色

function SetGradientColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置打印渐变文本颜色

function GetGetGradientColor()

获取当前打印渐变文本颜色

function PushGradientColor()

当前打印渐变文本颜色压入存储栈

function PopGradientColor()

弹出存储栈到当前打印渐变文本颜色

function DefaultGradientColor()

恢复默认打印渐变文本颜色

function SetShadowColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置打印渐变文本颜色

function SetShadowColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置打印阴影文本颜色

function GetShadowColor()

获取当前打印阴影文本颜色

function PushShadowColor()

当前打印阴影文本颜色压入存储栈

function PopShadowColor()

弹出存储栈到当前打印阴影文本颜色

function DefaultShadowColor()

恢复默认打印阴影文本颜色

function SetOutlineColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置打印描边文本颜色

function SetOutlineColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置打印描边文本颜色

function GetOutlineColor()

获取当前打印描边文本颜色

function PushOutlineColor()

当前打印描边文本颜色压入存储栈

function PopOutlineColor()

弹出存储栈到当前打印描边文本颜色

function DefaultOutlineColor()

恢复默认打印描边文本颜色

function SetImageColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置图片颜色

function SetImageColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置图片颜色

function GetImageColor()

获取当前图片颜色

function PushImageColor()

当前图片颜色压入存储栈

function PopImageColor()

弹出存储栈到当前图片颜色

function DefaultImageColor()

恢复默认图片颜色

function PushAllConfig()

当前所有配置压入存储栈

function PopAllConfig()

弹出存储栈到所有配置

function DefaultAllConfig()

恢复所有默认配置

function SetButtonStyle(normal, highlighted, pressed, disabled)

normal: 颜色, 普通状态颜色 highlighted: 颜色, 高亮状态颜色 pressed: 颜色, 按下状态颜色 disabled: 颜色, 禁用状态颜色

设置按钮状态

SetButtonStyle(Color("white"), Color("#ff0000"), Color(1,1,0,1), Color("gray"))

function ClearButtonStyle()

清空按钮状态

function SetStyle(name, flags, color, gradient_color, shadow_color, outline_color, image_color, button_style, line_height)

name: 字符串, 风格名字 flags: 表, 标识表 colors: 颜色, 文本颜色 gradient_color: 颜色, 渐变颜色 shadow_color: 颜色, 阴影颜色 outline_color: 颜色, 描边颜色 image_color: 颜色, 图片颜色 button_style: 表, 按钮风格表 line_height: 数值, 行高

设置风格

function PushStyle(name)

name: 字符串, 风格名字

当前所有配置压入存储栈, 并使用当前风格

function PopStyle()

弹出存储栈到所有配置, 包括按钮风格

function SetLineHeight(height)

height: 数值, 行高

设置行高

function GetLineHeight()

获取行高

function DefaultLineHeight()

恢复默认行高

默认属性设置

function SetDefaultFlags(flags)

flags: 表, 标识

设置默认标识表,标识说明表

function GetDefaultFlags()

获取默认标识表

function SetDefaultColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置默认颜色

function SetDefaultColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置默认颜色

function GetDefaultColor()

获取默认颜色

function SetDefaultGradientColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置默认渐变颜色

function SetDefaultGradientColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置默认渐变颜色

function GetDefaultGradientColor()

获取默认渐变颜色

function SetDefaultShadowColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置默认阴影颜色

function SetDefaultShadowColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置默认阴影颜色

function GetDefaultShadowColor()

获取默认阴影颜色

function SetDefaultOutlineColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置默认描边颜色

function SetDefaultOutlineColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置默认描边颜色

function GetDefaultOutlineColor()

获取默认描边颜色

function SetDefaultImageColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置默认图片颜色

function SetDefaultImageColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置默认图片颜色

function GetDefaultImageColor()

获取默认图片颜色

function SetDefaultSize(size)

size: 数值, 文本大小

设置默认文本大小

function GetDefaultSize()

获取默认文本大小

function SetDefaultLineHeight(height)

height: 数值, 行高

设置默认行高

function GetDefaultLineHeight()

获取默认行高

显示

function Print(str)

str: 字符串, 文本内容

打印字符串

Print("Hello World!")

function PrintLn(str)

str: 字符串, 文本内容

打印字符串,并换行

PrintLn("Hello World!")

function PrintF(format, ...)

format: 字符串, 格式化文本 ...: 可变参数

打印格式化字符串。格式化文本表

字符 说明 示例 输出
C 货币 PrintF("{0:C3}", 2) $2.000
F 浮点 PrintF("{0:F3}", 2) 2.000
G 常规 PrintF("{0:G}", 2) 2
N 用逗号分隔的数值 PrintF("{0:N1}", 250000) 250,000.0
P 百分比 PrintF("{0:P}", 0.5) 50.00%
E 科学计算法 PrintF("{0:E2}", 100000000) 1.00E+008
自定义 PrintF("{0:#.0000}", 1.23) 1.2300
PrintF("{0:C3}", 2)
PrintF("{0:F3}", 2)
PrintF("{0:G}", 2)
PrintF("{0:N}", 250000)
PrintF("{0:P}", 0.5)
PrintF("{0:E2}", 100000000)
PrintF("{0:#.0000}", 1.23)

function PrintFLn(format, ...)

format: 字符串, 格式化文本 ...: 可变参数

打印格式化字符串,并换行。格式化文本参考列表

function PrintT(t, align, str)

t: 数值, 对其字符数 align: 数值, 对齐枚举 str: 字符串, 文本内容

打印对齐文本, 对齐枚举表

枚举 说明
ALIGN_LEFT 左对齐
ALIGN_CENTER 居中对齐
ALIGN_RIGHT 右对齐
PrintT(20, ALIGN_LEFT, "left")      --"left                "
PrintT(20, ALIGN_CENTER, "center")  --"       center       "
PrintT(20, ALIGN_RIGHT, "right")    --"               right"

function PrintTLn(t, align, str)

t: 数值, 对其字符数 align: 数值, 对齐枚举 str: 字符串, 文本内容

打印对齐文本, 并换行

PrintTLn(20, ALIGN_LEFT, "left")  
PrintTLn(20, ALIGN_CENTER, "center") 
PrintTLn(20, ALIGN_RIGHT, "right") 

function PrintTF(t, align, format, ...)

t: 数值, 对其字符数 align: 数值, 对齐枚举 format: 字符串, 格式化文本 ...: 可变参数

打印对齐格式化文本

PrintTF(20, ALIGN_CENTER, "Value: {0}", 123)

function PrintTFLn(t, align, format, ...)

t: 数值, 对其字符数 align: 数值, 对齐枚举 format: 字符串, 格式化文本 ...: 可变参数

打印对齐格式化文本, 并换行

function Image(name, x, y, w, h, tiled=false)

name: 字符串, 图片名 x: 数值, x像素偏移 y: 数值, y像素偏移 w: 数值, 宽, 单位像素 h: 数值, 高, 单位像素 tiled: 布尔型, 平铺

打印图片

Image("img", 10, 0, 100, 100)

function ImageP(name, x, y, tiled=false)

name: 字符串, 图片名 x: 数值, 字符数偏移 y: 数值, 行偏移 w: 数值, 宽, 单位字符宽 h: 数值, 高, 单位行高 tiled: 布尔型, 平铺

打印图片

ImageP("img", 10, 0)

function ImageW(name, w, tiled=false)

name: 字符串, 图片名 w: 数值, 宽, 单位字符宽 tiled: 布尔型, 平铺

打印图片

ImageW("img", 20)

function ImageH(name, h, tiled=false)

name: 字符串, 图片名 h: 数值, 高, 单位行高 tiled: 布尔型, 平铺

打印图片

ImageH("img", 5)

function ImageS(name, w, h, tiled=false)

name: 字符串, 图片名 w: 数值, 宽, 单位字符宽 h: 数值, 高, 单位行高 tiled: 布尔型, 平铺

打印图片

ImageS("img", 10, 5)

function ImagePS(name, x, y, w, h, tiled=false)

name: 字符串, 图片名 x: 数值, 字符数偏移 y: 数值, 行偏移 w: 数值, 宽, 单位字符宽 h: 数值, 高, 单位行高 tiled: 布尔型, 平铺

打印图片

ImagePS("img", 0, 0, 10, 5)

function Button(code, text)

code: 字符串, 按钮码 text: 字符串, 文本

打印按钮

function ButtonLn(code, text)

code: 字符串, 按钮码 text: 字符串, 文本

打印按钮, 并换行

function ButtonF(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看PrintF

打印按钮

function ButtonFLn(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看PrintFLn

打印按钮, 并换行

function ButtonT(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看PrintT

打印按钮

function ButtonTLn(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看PrintTLn

打印按钮, 并换行

function ButtonTF(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看PrintTF

打印按钮

function ButtonTFLn(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看PrintTFLn

打印按钮, 并换行

function ButtonImage(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看Image

打印图片按钮

function ButtonImageP(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看ImageP

打印图片按钮

function ButtonImageW(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看ImageW

打印图片按钮

function ButtonImageH(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看ImageH

打印图片按钮

function ButtonImageS(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看ImageS

打印图片按钮

function ButtonImagePS(code, ...)

code: 字符串, 按钮码 ...: 可变参数, 参看ImagePS

打印图片按钮

function ShiftLine(count=1, roll_to_bottom=true)

count: 数值, 换行数 roll_to_bottom: 布尔型, 滚动到底部

换行

function RemoveLine(count)

count: 数值, 移除行数

移除指定数量的行

function Clear()

清空所有内容

function MovePosByPixel(count)

count: 数值, 移动打印位置, 单位像素

移动打印位置

function MovePosByWord(count)

count: 数值, 移动打印位置, 单位字符宽

移动打印位置

function ResetPosByPixel(count)

count: 数值, 重置打印位置, 单位像素

重置打印位置

function ResetPosByWord(count)

count: 数值, 重置打印位置, 单位字符宽

重置打印位置

function GetCurrentPos()

获得当前打印位置, 单位像素

function SetAutoLine(line_count)

line_count: 数值, 自动换行字符数, 0表示不自动换行

设置自动换行字符数

function GetAutoLine()

获取自动换行字节数

function GetStringLines(str, richedit, count)

str: 字符串, 文本 richedit: 布尔型, 是否为富文本 count: 数值, 换行字符数

获取自动换行结果文本表

function SetBackgroundColor(name)

name: 颜色名, 或者使用编码#RRGGBBAA, 配置表参看这里

设置背景颜色

function SetBackgroundColor(r, g, b, a)

r: 数值, R通道, [0, 1] g: 数值, G通道, [0, 1] b: 数值, B通道, [0, 1] a: 数值, Alpha通道, 默认值为1, [0, 1]

设置背景颜色

function SetBackgroundImage(name, tiled=false, keep_aspect=false)

name: 字符串, 图片名 tiled: 布尔型, 是否平铺 keep_aspect: 布尔型, 是否保持比例

设置背景图片

function BeginSection(line, clearflag=false)

line: 数值, 行数 clearflag: 布尔型, 是否清除上一个Section

开始一个Section区域

BeginSection(20)
-- ...
EndSection()

function EndSection()

结束一个Section区域

function GetSectionCurrentLine()

获取当前Section中打印行数

function GetSectionLine()

获取当前Section定义的行数

function ClearSectionCurrentLine()

清空当前Section中打印行数

交互

function SetMsg(msg)

msg: 字符串

设置消息

function GetMsg()

获取当前记录的消息

function ClearMsg()

清空消息

function EmptyMsg(need_content=false)

need_content: 布尔型, 是否剔除空字符串

检查消息是否为空

function WaitMsg(need_content=false)

need_content: 布尔型, 是否剔除空字符串

等待消息结果,并返回消息。以下为实现代码,可以根据需求修改

function WaitMsg(need_content)
    while EmptyMsg(need_content) do
        coroutine.yield()
    end
    return GetMsg()
end

function WaitMsgAndClear(need_content=false)

need_content: 布尔型, 是否剔除空字符串

等待消息结果,并返回消息后清空消息

图片配置

function SetResourcePath(path, location)

path: 字符串, 路径名。如果相对路径,Standalone模式下工作路径为ProjectPath,Android模式下工作路径为PersistentDataPath location: 数值

枚举名 说明
FILE_SYSTEM 文件系统模式
PACKAGE 包文件模式

function GetResourcePath()

获取当前资源路径

function SetSpriteImage(name, file, rect, border, hidden=false)

name: 字符串, 图名字 file: 字符串, 图片路径 rect: 表, 图片偏移尺寸 border: 表, 图片Border, 九宫格配置 hidden: 布尔型, 是否隐藏

设置图片数据

SetSpriteImage("moon", "moon.png", {0, 0, 512, 512}, nil, false)

function SetSpriteImages(sprites)

sprites: 表, 图片配置

设置图片数据

SetSpriteImages({
    {"moon", "moon.png", {0, 0, 512, 512}},
    {"small_moon", "small_moon.png", {0, 0, 32, 32}},
})

function SetSpriteAnimation(name, fps, sprites)

name: 字符串, 动画名字 fps: 数值, 动画帧率 sprites: 表, 动画帧表

设置动画数据

SetSpriteAnimation("anim", 30, {
    "frame01",      -- {"frame01", 1}
    {"frame02_06", 5},
    {"frame07_08", 2},
    "frame08",
})

function SetSpriteAnimations(anims)

anims: 表, 动画配置

设置动画数据

SetSpriteAnimations({
    {
        "anim", 30,
        {
            "frame01",      -- {"frame01", 1}
            {"frame02_06", 5},
            {"frame07_08", 2},
            "frame08",
        }
    }
})

function SetAnimationLoop(count)

count: 数值, 播放次数。ANIMATION_LOOP_COUNT为无限循环

设置动画播放次数

SetAnimationLoop(ANIMATION_LOOP_COUNT)

function CheckSprite(name)

name: 字符串

检查Sprite是否存在

Json

function JsonEncode(value)

value: 数据

Json编码

local json = JsonEncode({1, 2, 3}) -- "[1, 2, 3]"

function JsonDecode(json)

json: 字符串, json文本

Json解码

local t = JsonDecode("[1, 2, 3]") -- t = {1, 2, 3}

Csv

function SetCsvPath(path=["Csv"])

path: 字符串, Csv路径

设置Csv路径

function GetCsvPath()

返回Csv路径

function CsvDecode(name, haskey=false, dictflag=false)

name: 字符串, Csv文件名, 无需.csv后缀名 haskey: 布尔型, 是否包含列头 dictflag: 布尔型, 是否解码字典格式

Csv解码, 优先读取Resources/Csv/下文件

--[[
    Project Path/Csv/test.csv
content:
    a, b, c
    1, 2, 3
    4, 5, 6
    7, 8, 9
]]

SetCsvPath("Csv")
local t1 = CsvDecode("test") 
-- t1 = {{"a", "b", "c"},{"1", "2", "3"},{"4", "5", "6"},{"7", "8", "9"}}
local t2 = CsvDecode("test", true)
-- t2 = {{a="1", b="2", c="3"},{a="4", b="5", c="6"},{a="7", b="8", c="9"}}
local t3 = CsvDecode("test", true, true)
--[[ t2 = {
           ["1"]={a="1", b="2", c="3"}, 
           ["4"]={a="4", b="5", c="6"},
           ["7"]={a="7", b="8", c="9"},
        }]]

存档

function SetSavePath(path=["Save"])

path: 字符串, Save路径

设置Save路径

function GetSavePath()

返回Save路径

function Save(name, content, password=nil)

name: 字符串, 文件名 content: 数据, 存储内容 password: 字符串, 密码

存储数据

function SaveString(name, content, password=nil)

name: 字符串, 文件名 content: 字符串, 存储内容 password: 字符串, 密码

存储字符串

function SaveTable(name, content, password=nil)

name: 字符串, 文件名 content: 表, 存储表 password: 字符串, 密码

存储表

function LoadString(name, password=nil)

name: 字符串, 文件名 password: 字符串, 密码

读取字符串

function LoadTable(name, password=nil)

name: 字符串, 文件名 password: 字符串, 密码

读取表

function Exist(name)

name: 字符串, 文件名

检查存档是否存在

function Delete(name)

name: 字符串, 文件名

删除存档文件

function EnumSaves()

枚举存档文件

文本库

function SetTextWeightList(name, table)

name: 字符串, 文本表名 table: 表, 权重文本表

设置权重文本表

SetTextWeightList("family_name", 
{
    {"", 2000},
    {"", 2000},
    {"", 2000},
    {"", 2000},
    {"", 1500},
    {"", 1500},
    {"", 1500},
    {"", 1500},
})

function SetTextList(name, table)

name: 字符串, 文本表名 table: 表, 文本表

设置文本表

SetTextWeightList("family_name", 
{
    "",
    "",
    "",
    "",
    "",
    "",
    "",
    "",
})

function GetTextListCount(name)

name: 字符串, 文本表名

获取文本表中文本条目数

function GetTextListWeight(name)

name: 字符串, 文本表名

获取文本表的总权重值, 如果非权重表, 权重值等于条目数

function GetTextByIndex(name, index)

name: 字符串, 文本表名 index: 数值, 索引值

获取文本表中某一条文本

function GetTextByWeight(name, weight)

name: 字符串, 文本表名 weight: 数值, 权重值

获取文本表中某一条文本, 并返回该文本索引

时间

function NowStamp()

返回当前时间戳

function Now()

返回当前时间表, 时间表

说明
Year
Month
Day
Hour 小时
Minue 分钟
Second
DayOfYear 当年总日数
DayOfWeek 星期

function DateToStamp(date_table)

date_table: 表, 时间表

时间表转换为时间戳

function DateToStamp(year, month, day, hour, min, sec)

year: 数值, 年 month: 数值, 月 day: 数值, 日 hour: 数值, 小时 min: 数值, 分钟 sec: 数值, 秒

转换为时间戳

function Date(year, month, day, hour, min, sec)

year: 数值, 年 month: 数值, 月 day: 数值, 日 hour: 数值, 小时 min: 数值, 分钟 sec: 数值, 秒

生成时间表

function StampToDate(stamp)

stamp: 数值, 时间戳

时间戳转换为时间表

其他

function SetMaxLineCount(count)

count: 设置最大行数

设置最大行数

function GetMaxLineCount()

获取最大行数

function ShowFPS(value)

value: 布尔型, 是否显示FPS

显示FPS

function SetTargetFrame(count)

count: 数值, 帧率

设置帧率

function SetOrientation(orientation)

orientation: 枚举, 显示方向枚举

设置方向, 方向枚举表

枚举 说明
SCREEN_PORTRAIT 竖屏
SCREEN_PORTRAIT_UPSIDE 正向竖屏
SCREEN_LANDSCAPE_LEFT 左面朝上横屏
SCREEN_LANDSCAPE 横屏
SCREEN_LANDSCAPE_RIGHT 右面朝上横屏
SCREEN_AUTO_ROTATION 自动旋转

function SetDragEnable(value)

value: 布尔型, 拖动是否有效

设置是否允许拖动

function DataPath()

获取Data路径

function PersistentDataPath()

获取PersistentDataPath

function ProjectPath()

获取Project路径

function IsMobilePlatform()

获取是否Modile

function Platform()

获取平台名

function RunInBackground()

获取是否允许运行在后台

function SetRunInBackground(value)

value: 布尔型, 是否允许后台运行

设置是否允许后台运行

function OpenURL(url)

url: 字符串, 地址

打开Url地址

function SetResolution(w, h)

w: 数值, 设置宽 h: 数值, 设置高

设置分辨率

function GetResolution()

返回分辨率

function SetConsoleBorder(left, top, right, bottom)

left: 数值, 左边边框值 top: 数值, 顶边边框值 right: 数值, 右边边框值 bottom: 数值, 底边边框值

设置显示边框