Graphic 模块提供窗口相关操作
-
LoadImageFromFile(path):从文件中加载图像
-
LoadImageFromData(data):从缓冲区中加载图像
-
CreateNode():创建一个节点对象
-
LoadFontFromFile(path):从文件中加载图像
-
LoadFontFromData(data):从缓冲区中加载图像
-
CreateTextImage(font, content, [, color], textPattern, codeFormat):创建一个文本图像
-
Image 对象成员函数
-
Image:SetImageDynamic(isDynamic, frameAmount, width, height):设置图像是否为动态
-
Image:SetRendererFlip(mode):设置图像的翻转模式
-
Image:GetAnchorPoint():获取图像的锚点
-
Image:SetAnchorPoint(x, y):设置图像的锚点
-
Image:GetImageRect():获取图像截取的矩形
-
Image:SetImageRect(x, y, w, h):设置图像截取的矩形
-
Image:GetAlpha():获取图像的Alpha通道值(不透明度)
-
Image:SetAlpha(alpha):设置图像的Alpha通道值(不透明度)
-
Image:GetAngle():获取图像的旋转角度
-
Image:SetAngle(angle):设置图像的旋转角度
-
注意事项:以下函数只有属性为动态的图片才可使用
-
Image:GetPlaySpeed():获取属性为动态的图像的帧切换速度(speed 帧/次)
-
Image:SetPlaySpeed(speed = 60):设置属性为动态的图像的帧切换速度(speed 帧/次)
-
Image:GetCurrentFrame():获取属性为动态的图像的当前帧
-
Image:SetCurrentFrame(frame):设置属性为动态的图像的当前帧
-
-
Node 对象成员函数
-
Node:GetImage():获取该节点对应的图像
-
Node:SetImage(image):设置该节点对应的图像
-
Node:GetCopyRect():获取该节点的绘制矩形
-
Node:SetCopyRect(rect):设置该节点的绘制矩形
-
Node:GetParent():获取该节点的父节点
-
Node:SetParent(parent):设置该节点的父节点
-
Node:GetDepth():获取该节点的深度(值越小越先绘制)
-
Node:SetDepth():设置该节点的深度
-
Node:AddChild(child):向该节点的子节点列表中添加一个子节点
-
Node:DeleteChild():删除该节点的子节点列表中对应索引的节点
-
Node:RunAction(action1, action2, action3...):让该节点运行参数中的动作
-
Node:SetPause(isRunning):设置该节点是否持续更新
-
-
Font 对象成员函数
-
Font:GetStyle():获取该字体的风格
-
Font:SetStyle():设置该字体的风格
-
Font:GetOutlineWidth():获取已加载字体的轮框线宽度
-
Font:SetOutlineWidth(width):设置已加载字体的轮框线宽度
-
Font:GetKerning():获取字体间距
-
Font:SetKerning(kerning):设置字体间距
-
Font:GetHeight():获取字体高度
-
Font:GetTextSize():获取字体大小
-
Font:GetUTF8TextSize():设置UTF-8格式字体大小
-
-
Text 对象成员函数
-
Text:ResetText(font, content, [, color], textPattern, codeFormat):重新设置文本图像
-
Text:GetContent():获取文本图像的文字内容
-