文字板接口:Graphics
?彼得兔
更新時間: 2024-08-27 11:12:18
具體函數名及描述如下:序號?? ?函數名?? ?函數描述
1?? ?makeGraphicsText(...)?? ?創建文字板信息
2?? ?makeflotageText(...)?? ?創建漂浮文字信息
3?? ?makeGraphicsProgress(...)?? ?創建進度條信息
4?? ?makeGraphicsArrowToPos(...)?? ?生成指向位置的箭頭數據
5?? ?makeGraphicsLineToPos(...)?? ?生成指向位置的線數據
6?? ?makeGraphicsSurfaceToPos(...)?? ?生成指向位置的面數據
7?? ?makeGraphicsArrowToActor(...)?? ?生成指向對象的箭頭數據
8?? ?makeGraphicsLineToActor(...)?? ?生成指向對象的線數據
9?? ?makeGraphicsSurfaceToActor(...)?? ?生成指向對象的面數據
10?? ?createGraphicsTxtByPos(...)?? ?在位置上創建文字板
11?? ?createGraphicsTxtByActor(...)?? ?在生物身上創建文字板
12?? ?createflotageTextByPos(...)?? ?在位置上創建漂浮文字
13?? ?createflotageTextByActor(...)?? ?在生物身上創建漂浮文字
14?? ?createGraphicsProgressByPos(...)?? ?在位置上創建進度條
15?? ?createGraphicsProgressByActor(...)?? ?在生物身上創建進度條
16?? ?removeGraphicsByPos(...)?? ?刪除位置上的圖文信息
17?? ?removeGraphicsByObjID(...)?? ?刪除生物的圖文信息
18?? ?updateGraphicsTextById(...)?? ?更新圖文信息的文字內容
19?? ?updateGraphicsProgressById(...)?? ?更新進度條的進度
20?? ?createGraphicsArrowByActorToPos(...)?? ?創建生物指向位置的箭頭
21?? ?createGraphicsArrowByActorToActor(...)?? ?創建生物指向生物的箭頭
22?? ?createGraphicsArrowByPosToPos(...)?? ?創建位置指向位置的箭頭
23?? ?createGraphicsArrowByPosToActor(...)?? ?創建位置指向生物的箭頭
24?? ?createGraphicsLineByActorToPos(...)?? ?創建生物與位置的線
25?? ?createGraphicsLineByActorToActor(...)?? ?創建指向生物的線
26?? ?createGraphicsLineByPosToPos(...)?? ?創建位置指向位置的線
27?? ?createGraphicsLineByPosToActor(...)?? ?創建位置指向生物的線
28?? ?createGraphicsSurfaceByActorToPos(...)?? ?創建指向位置的面
29?? ?createGraphicsSurfaceByActorToActor(...)?? ?創建指向生物的面
30?? ?createGraphicsSurfaceByPosToPos(...)?? ?創建位置指向位置的面
31?? ?createGraphicsSurfaceByPosToActor(...)?? ?創建位置指向生物的面
32?? ?snycGraphicsInfo2Client(...)?? ?刷新信息至客機,在更新圖文信息接口之后調用
33?? ?makeGraphicsImage(...)?
創建圖片信息
34?? ?createGraphicsImageByActor(...)?
在生物身上創建圖片
35?? ?createGraphicsImageByPos(...)
在位置上創建圖片
?
makeGraphicsText
參數及類型:title:string顯示的文字標題
font:number字體大小
apha:number不透明度
itype:number文字板的編號
autoWrap:bolean是否自動換行,可缺省,默認值為ture
返回值及類型:info:table文本信息內容
該方法的主要作用:創建文字板信息。當autoWrap參數為ture時,保持以前的固定寬度自動換行的表現當autoWrap參數為false時候,不會自動換行。當在文本中識別到/n 字符時候,會將文本換行具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local title="這是一個文字板"--文字內容
?? ?local font=15--字體大小
?? ?local alpha=100--背景透明度(0:完全透明 100:不透明)
?? ?local itype=1--文字板編號
?? ?--創建一個文字板信息,存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeGraphicsText(title, font, alpha, itype)
?? ?local x,y,z=event.x,event.y+1,event.z--顯示信息的坐標
?? ?local x2,y2=0,0--偏移量
?? ?local result,graphid=Graphics:createGraphicsTxtByPos(x, y, z, graphicsInfo, x2, y2)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
makeflotageText
參數及類型:title:string顯示的文字標題
font:number字體大小
itype:number漂浮文字的編號
返回值及類型:array:table
該方法的主要作用:創建漂浮文字信息具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local title="這是一個漂浮文字"--文字內容
?? ?local font=15--字體大小
?? ?local itype=1--漂浮文字編號
?? ?--創建一個漂浮文字信息存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeflotageText(title, font, itype)
?? ?local x,y,z=event.x,event.y+1,event.z--顯示漂浮文字的坐標
?? ?local x2,y2=0,0--水平偏移距離
?? ?--在位置上顯示漂浮文字
?? ?local result,graphid=Graphics:createflotageTextByPos(x, y, z, graphicsInfo, x2, y2)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
makeGraphicsProgress
參數及類型:v1:number進度條的當前值
v2:number進度條的最大值
color:number進度條的顏色
itype:number進度條的編號
返回值及類型:array:table
該方法的主要作用:創建進度條信息具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local v1=50--進度條當前值
?? ?local v2=100--進度條最大值
?? ?local color=0xff0000--進度條的顏色
?? ?local itype=1--進度條編號
?? ?--創建一個進度條信息,存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeGraphicsProgress(v1, v2, color, itype)
?? ?local x,y,z=event.x,event.y+1,event.z--顯示進度條的坐標
?? ?local x2,y2=0,0--水平偏移距離
?? ?--在位置上顯示進度條
?? ?local result,graphid = Graphics:createGraphicsProgressByPos(x, y, z, graphicsInfo, x2, y2)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
makeGraphicsArrowToPos
參數及類型:pos:number位置
size:number大小
color:number顏色
id:number編號
返回值及類型:array:table
該方法的主要作用:生成指向位置的箭頭數據具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--箭頭大小
?? ?local color=0xff0000--箭頭顏色
?? ?local id=1--箭頭數據編號
?? ?--創建一個指向位置的箭頭數據
?? ?local info=Graphics:makeGraphicsArrowToPos(x, y, z, size, color, id)?? ?local objid=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=10,z=0}--偏移方向
?? ?local offset=10--偏移距離
?? ?--在生物身上創建指向坐標的箭頭
?? ?Graphics:createGraphicsArrowByActorToPos(objid, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
makeGraphicsLineToPos
參數及類型:pos:number位置
size:number大小
color:number顏色
id:number編號
返回值及類型:array:table
該方法的主要作用:生成指向位置的線數據具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--線的尺寸
?? ?local color=0xff0000--線的顏色
?? ?local id=1--線數據編號
?? ?--創建一個指向位置的線數據
?? ?local info=Graphics:makeGraphicsLineToPos(x, y, z, size, color, id)?? ?local objid=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=0,z=0}--偏移方向
?? ?local offset=0--偏移距離
?? ?--在生物身上創建指向坐標的箭頭
?? ?Graphics:createGraphicsLineByActorToPos(objid, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
makeGraphicsSurfaceToPos
參數及類型:pos:number位置
size:number大小
color:number顏色
id:number編號
返回值及類型:array:table
該方法的主要作用:生成指向位置的面數據具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--面的尺寸
?? ?local color=0xff0000--面的顏色
?? ?local id=1--面數據編號
?? ?--創建指向位置的面數據
?? ?local info=Graphics:makeGraphicsSurfaceToPos(x, y, z, size, color, id)
? ? --基于創建的數據創建一個面
? ? Graphics:MakeGraphicsArrowToPos(event.eventobjid, info, {x=0,y=0,z=0}, 0)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
makeGraphicsArrowToActor
參數及類型:objid:number生物id
size:number大小
color:number顏色
id:number編號
返回值及類型:array:table
該方法的主要作用:生成指向對象的箭頭數據具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--箭頭大小
?? ?local color=0xff0000--箭頭顏色
?? ?local id=1--箭頭數據編號
?? ?--創建一個指向對象的箭頭數據
?? ?local info=Graphics:makeGraphicsArrowToActor(objid, size, color, id)?? ?local objid2=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=10,z=0}--偏移方向
?? ?local offset=10--偏移距離
?? ?--在玩家身上創建指向生物的箭頭
?? ?Graphics:createGraphicsArrowByActorToActor(objid2, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
makeGraphicsLineToActor
參數及類型:objid:number生物id
size:number大小
color:number顏色
id:number編號
返回值及類型:array:table
該方法的主要作用:生成指向對象的線數據具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--線的尺寸
?? ?local color=0xff0000--線的顏色
?? ?local id=1--線數據編號
?? ?--創建一個指向對象的線數據
?? ?local info=Graphics:makeGraphicsLineToActor(objid, size, color, id)?? ?local objid2=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=0,z=0}--偏移方向
?? ?local offset=0--偏移距離
?? ?--在玩家身上創建指向生物的線
?? ?Graphics:createGraphicsLineByActorToActor(objid2, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
makeGraphicsSurfaceToActor
參數及類型:objid:number生物id
size:number大小
color:number顏色
id:number編號
返回值及類型:array:table
該方法的主要作用:生成指向對象的面數據具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--面的尺寸
?? ?local color=0xff0000--面的顏色
?? ?local id=1--面數據編號
?? ?--創建一個指向對象的面數據
?? ?local info=Graphics:makeGraphicsSurfaceToActor(objid, size, color, id)?? ?local objid2=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=0,z=0}--偏移方向
?? ?local offset=0--偏移距離
?? ?--在玩家身上創建指向生物的面
?? ?Graphics:createGraphicsSurfaceByActorToActor(objid2, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
createGraphicsTxtByPos
參數及類型:x,y,z:number位置
graphicInfo:table圖文設置的屬性信息
x2:number2d平面上x軸的偏移量
y2:number2d平面上y軸的偏移量
返回值及類型:ErrorCode.OK
graphid:number
該方法的主要作用:在位置上創建文字板具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local title="這是一個文字板"--文字內容
?? ?local font=15--字體大小
?? ?local alpha=100--背景透明度(0:完全透明 100:不透明)
?? ?local itype=1--文字板編號
?? ?--創建一個文字板信息,存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeGraphicsText(title, font, alpha, itype)
?? ?local x,y,z=event.x,event.y+1,event.z--顯示信息的坐標
?? ?local x2,y2=0,0--偏移量
?? ?local result,graphid=Graphics:createGraphicsTxtByPos(x, y, z, graphicsInfo, x2, y2)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsTxtByActor
參數及類型:objid:number生物objid
graphicInfo:table圖文設置的屬性信息
dir:table圖文信息在生物身上的朝向
offset:number在方向上的偏移
x2:number2d平面上x軸的偏移量
y2:number2d平面上y軸的偏移量
返回值及類型:ErrorCode.OK
graphid:number
該方法的主要作用:在生物身上創建文字板具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local title="這是一個文字板"--文字內容
?? ?local font=15--字體大小
?? ?local alpha=100--背景透明度(0:完全透明 100:不透明)
?? ?local itype=1--文字板編號
?? ?--創建一個文字板信息,存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeGraphicsText(title, font, alpha, itype)
?? ?local objid=event.toobjid--顯示信息的實體id
?? ?local dir={x=0,y=10,z=0}--偏移方向
?? ?local offset=10--方向上的偏移距離
?? ?local x2,y2=0,0--水平偏移距離
?? ?--在實體上顯示文字板
?? ?local result,graphid=Graphics:createGraphicsTxtByActor(objid, graphicsInfo, dir, offset, x2, y2)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
createflotageTextByPos
參數及類型:x,y,z:number位置
graphicInfo:table圖文設置的屬性信息
返回值及類型:ErrorCode.OK
graphid:number
該方法的主要作用:在位置上創建漂浮文字具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local title="這是一個漂浮文字"--文字內容
?? ?local font=15--字體大小
?? ?local itype=1--漂浮文字編號
?? ?--創建一個漂浮文字信息存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeflotageText(title, font, itype)
?? ?local x,y,z=event.x,event.y+1,event.z--顯示漂浮文字的坐標
?? ?local x2,y2=0,0--水平偏移距離
?? ?--在位置上顯示漂浮文字
?? ?local result,graphid=Graphics:createflotageTextByPos(x, y, z, graphicsInfo, x2, y2)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createflotageTextByActor
參數及類型:objid:number生物objid
graphicInfo:table圖文設置的屬性信息
dir:table圖文信息在生物身上的朝向
offset:number在方向上的偏移
返回值及類型:ErrorCode.OK
graphid:number
該方法的主要作用:在生物身上創建漂浮文字具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local title="這是一個漂浮文字"--文字內容
?? ?local font=15--字體大小
?? ?local itype=1--漂浮文字編號
?? ?--創建一個漂浮文字信息存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeflotageText(title, font, itype)
?? ?local objid=event.toobjid--顯示文字的生物實體id
?? ?local dir={x=0,y=0,z=0}--偏移方向
?? ?local offset=0--方向上的偏移距離
?? ?local x2,y2=0,0--水平偏移距離
?? ?--在生物身上顯示漂浮文字
?? ?local result,graphid = Graphics:createflotageTextByActor(objid, graphicsInfo, dir, offset, x2, y2)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
createGraphicsProgressByPos
參數及類型:x,y,z:number位置
graphicInfo:table進度條設置的屬性信息
x2:number2d平面上x軸的偏移量
y2:number2d平面上y軸的偏移量
返回值及類型:ErrorCode.OK
graphid:number
該方法的主要作用:在位置上創建進度條具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local v1=50--進度條當前值
?? ?local v2=100--進度條最大值
?? ?local color=0xff0000--進度條的顏色
?? ?local itype=1--進度條編號
?? ?--創建一個進度條信息,存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeGraphicsProgress(v1, v2, color, itype)
?? ?local x,y,z=event.x,event.y+1,event.z--顯示進度條的坐標
?? ?local x2,y2=0,0--水平偏移距離
?? ?--在位置上顯示進度條
?? ?local result,graphid = Graphics:createGraphicsProgressByPos(x, y, z, graphicsInfo, x2, y2)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsProgressByActor
參數及類型:objid:number生物objid
graphicInfo:table進度條設置的屬性信息
dir:table圖文信息在生物身上的朝向
offset:number在方向上的偏移
x2:number2d平面上x軸的偏移量
y2:number2d平面上y軸的偏移量
返回值及類型:ErrorCode.OK
graphid:number
該方法的主要作用:在生物身上創建進度條具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local v1=50--進度條當前值
?? ?local v2=100--進度條最大值
?? ?local color=0xff0000--進度條的顏色
?? ?local itype=1--進度條編號
?? ?--創建一個進度條信息,存到graphicsInfo中
?? ?local graphicsInfo=Graphics:makeGraphicsProgress(v1, v2, color, itype)
?? ?local objid=event.toobjid--顯示進度條的實體id
?? ?local dir={x=0,y=10,z=0}--偏移方向
?? ?local offset=10--方向上偏移距離
?? ?local x2,y2=0,0--水平偏移距離
?? ?--在生物上顯示進度條
?? ?local result,graphid = Graphics:createGraphicsProgressByActor(objid, graphicsInfo, dir, offset, x2, y2)end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
removeGraphicsByPos
參數及類型:x,y,z:number位置
itype:number圖文信息組類型
graphType:number圖文類型枚舉值
返回值及類型:ErrorCode.OK
該方法的主要作用:刪除位置上的圖文信息具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event,y+1,event.z--要移除圖文信息的坐標
?? ?local itype=1--要移除圖文信息的編號
?? ?local graphType=1--要移除圖文信息的類型(1表示文字板,其他見常量列表)
?? ?--移除被點擊方塊上面一格編號為1的文字板
?? ?Graphics:removeGraphicsByPos(x, y, z, itype, graphType)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
removeGraphicsByObjID
參數及類型:objid:number生物objid
itype:number圖文信息組類型
graphType:number圖文類型枚舉值
返回值及類型:ErrorCode.OK
該方法的主要作用:刪除生物的圖文信息具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--要移除圖文信息的實體
?? ?local itype=1--要移除圖文信息的編號
?? ?local graphType=1--要移除圖文信息的類型(1表示文字板,其他見常量列表)
?? ?--移除被點擊生物身上編號為1的文字板
?? ?Graphics:removeGraphicsByObjID(objid, itype, graphType)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
updateGraphicsTextById
參數及類型:graphid:number已創建的圖文信息ID
title:string文字內容
fontsize:number字體大小(可不填值)
aphanumber
返回值及類型:ErrorCode.OK
該方法的主要作用:更新圖文信息的文字內容具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local graphid=1--此處要改為create文字板返回的graphid值,表示文字板的id
?? ?local title="更新了文字板"--更新之后顯示的內容
?? ?local fontsize=20--文字大小
?? ?local alpha=100--背景透明度
?? ?--更新id為graphid的文字板的內容
?? ?Graphics:updateGraphicsTextById(graphid, title, fontsize, alpha)
?? ?--刷新信息至客機(避免房主以外的玩家看不到更新內容)
?? ?Graphics:snycGraphicsInfo2Client()
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
updateGraphicsProgressById
參數及類型:graphid:number已創建的圖文信息ID
curval:number進度條的當前值
maxval:number進度條的最大值
返回值及類型:ErrorCode.OK
該方法的主要作用:更新進度條的進度具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local graphid=1--此處要改為create進度條返回的graphid值,表示進度條的id
?? ?local val1,val2=80,100--更新后顯示的進度條當前值和最大值
?? ?--更新id為graphid的進度條的內容
?? ?Graphics:updateGraphicsProgressById(graphid, val1, val2)
?? ?--刷新信息至客機(避免房主以外的玩家看不到更新內容)
?? ?Graphics:snycGraphicsInfo2Client()
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsArrowByActorToPos
參數及類型:objid:number生物id
info:table箭頭信息
dir:table朝向
offset:number偏移
返回值及類型:ErrorCode.OK
該方法的主要作用:創建生物指向位置的箭頭具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--箭頭大小
?? ?local color=0xff0000--箭頭顏色
?? ?local id=1--箭頭數據編號
?? ?--創建一個指向位置的箭頭數據
?? ?local info=Graphics:makeGraphicsArrowToPos(x, y, z, size, color, id)?? ?local objid=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=10,z=0}--偏移方向
?? ?local offset=10--偏移距離
?? ?--在生物身上創建指向坐標的箭頭
?? ?Graphics:createGraphicsArrowByActorToPos(objid, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsArrowByActorToActor
參數及類型:objid:number生物id
info:table箭頭信息
dir:table朝向
offset:number偏移
返回值及類型:ErrorCode.OK
該方法的主要作用:創建生物指向生物的箭頭具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--箭頭大小
?? ?local color=0xff0000--箭頭顏色
?? ?local id=1--箭頭數據編號
?? ?--創建一個指向對象的箭頭數據
?? ?local info=Graphics:makeGraphicsArrowToActor(objid, size, color, id)?? ?local objid2=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=10,z=0}--偏移方向
?? ?local offset=10--偏移距離
?? ?--在玩家身上創建指向生物的箭頭
?? ?Graphics:createGraphicsArrowByActorToActor(objid2, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
createGraphicsArrowByPosToPos
參數及類型:pos:table位置
info:table箭頭信息
返回值及類型:ErrorCode.OK
該方法的主要作用:創建位置指向位置的箭頭具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--箭頭大小
?? ?local color=0xff0000--箭頭顏色
?? ?local id=1--箭頭數據編號
?? ?--創建一個指向位置的箭頭數據
?? ?local info=Graphics:makeGraphicsArrowToPos(x, y, z, size, color, id)?? ?local result,x2,y2,z2=Actor:getPosition(event.eventobjid)--獲取玩家所在位置
?? ?--在玩家位置創建指向坐標的箭頭
?? ?Graphics:createGraphicsArrowByPosToPos(x2, y2, z2, info)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsArrowByPosToActor
參數及類型:pos:table位置
info:table箭頭信息
返回值及類型:ErrorCode.OK
該方法的主要作用:創建位置指向生物的箭頭具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--箭頭大小
?? ?local color=0xff0000--箭頭顏色
?? ?local id=1--箭頭數據編號
?? ?--創建一個指向對象的箭頭數據
?? ?local info=Graphics:makeGraphicsArrowToActor(objid, size, color, id)?? ?local result,x,y,z=Actor:getPosition(event.eventobjid)--獲取玩家坐標
?? ?--在玩家位置創建指向生物的箭頭
?? ?Graphics:createGraphicsArrowByPosToActor(x, y, z, info)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
createGraphicsLineByActorToPos
參數及類型:objid:number生物id
info:table線信息
dir:table朝向
offset:number偏移
返回值及類型:ErrorCode.OK
該方法的主要作用:創建生物與位置的線具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--線的尺寸
?? ?local color=0xff0000--線的顏色
?? ?local id=1--線數據編號
?? ?--創建一個指向位置的線數據
?? ?local info=Graphics:makeGraphicsLineToPos(x, y, z, size, color, id)?? ?local objid=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=0,z=0}--偏移方向
?? ?local offset=0--偏移距離
?? ?--在生物身上創建指向坐標的箭頭
?? ?Graphics:createGraphicsLineByActorToPos(objid, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsLineByActorToActor
參數及類型:objid:number生物id
info:table線信息
dir:table朝向
offset:number偏移
返回值及類型:ErrorCode.OK
該方法的主要作用:創建指向生物的線具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--線的尺寸
?? ?local color=0xff0000--線的顏色
?? ?local id=1--線數據編號
?? ?--創建一個指向對象的線數據
?? ?local info=Graphics:makeGraphicsLineToActor(objid, size, color, id)?? ?local objid2=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=0,z=0}--偏移方向
?? ?local offset=0--偏移距離
?? ?--在玩家身上創建指向生物的線
?? ?Graphics:createGraphicsLineByActorToActor(objid2, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
createGraphicsLineByPosToPos
參數及類型:pos:table位置
info:table線信息
返回值及類型:ErrorCode.OK
該方法的主要作用:創建位置指向位置的線具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--線的尺寸
?? ?local color=0xff0000--線的顏色
?? ?local id=1--線數據編號
?? ?--創建一個指向位置的線數據
?? ?local info=Graphics:makeGraphicsLineToPos(x, y, z, size, color, id)?? ?local result,x2,y2,z2=Actor:getPosition(event.eventobjid)--獲取玩家坐標
?? ?--在玩家位置上生成指向坐標的線
?? ?Graphics:createGraphicsLineByPosToPos(x2, y2, z2, info)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsLineByPosToActor
參數及類型:pos:table位置
info:table線信息
返回值及類型:ErrorCode.OK
該方法的主要作用:創建位置指向生物的線具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--線的尺寸
?? ?local color=0xff0000--線的顏色
?? ?local id=1--線數據編號
?? ?--創建一個指向對象的線數據
?? ?local info=Graphics:makeGraphicsLineToActor(objid, size, color, id)?? ?local result,x,y,z=Actor:getPosition(event.eventobjid)--獲取玩家坐標
?? ?--在玩家坐標上創建指向生物的線
?? ?Graphics:createGraphicsLineByPosToActor(x, y, z, info)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
createGraphicsSurfaceByActorToPos
參數及類型:objid:number生物id
info:table面信息
dir:table朝向
offset:number偏移
返回值及類型:ErrorCode.OK
該方法的主要作用:創建指向位置的面具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--面的尺寸
?? ?local color=0xff0000--面的顏色
?? ?local id=1--面數據編號
?? ?--創建一個指向位置的面數據
?? ?local info=Graphics:makeGraphicsSurfaceToPos(x, y, z, size, color, id)?? ?local objid=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=0,z=0}--偏移方向
?? ?local offset=0--偏移距離
?? ?--在生物身上創建指向坐標的箭頭
?? ?Graphics:createGraphicsSurfaceByActorToPos(objid, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsSurfaceByActorToActor
參數及類型:objid:number生物id
info:table面信息
dir:table朝向
offset:number偏移
返回值及類型:ErrorCode.OK
該方法的主要作用:創建指向生物的面具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--面的尺寸
?? ?local color=0xff0000--面的顏色
?? ?local id=1--面數據編號
?? ?--創建一個指向對象的面數據
?? ?local info=Graphics:makeGraphicsSurfaceToActor(objid, size, color, id)?? ?local objid2=event.eventobjid--在玩家身上創建
?? ?local dir={x=0,y=0,z=0}--偏移方向
?? ?local offset=0--偏移距離
?? ?--在玩家身上創建指向生物的面
?? ?Graphics:createGraphicsSurfaceByActorToActor(objid2, info, dir, offset)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
createGraphicsSurfaceByPosToPos
參數及類型:pos:table位置
info:table面信息
返回值及類型:ErrorCode.OK
該方法的主要作用:創建位置指向位置的面具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local x,y,z=event.x,event.y,event.z--指向坐標
?? ?local size=0.5--面的尺寸
?? ?local color=0xff0000--面的顏色
?? ?local id=1--面數據編號
?? ?--創建一個指向位置的面數據
?? ?local info=Graphics:makeGraphicsSurfaceToPos(x, y, z, size, color, id)?? ?local result,x2,y2,z2=Actor:getPosition(event.eventobjid)--獲取玩家坐標
?? ?--在玩家位置上生成指向坐標的面
?? ?Graphics:createGraphicsSurfaceByPosToPos(x2, y2, z2, info)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
createGraphicsSurfaceByPosToActor
參數及類型:pos:table位置
info:table面信息
返回值及類型:ErrorCode.OK
該方法的主要作用:創建位置指向生物的面具體使用案例如下:
--玩家點擊生物時,執行此函數
local function clickactor(event)
?? ?local objid=event.toobjid--指向對象
?? ?local size=0.5--面的尺寸
?? ?local color=0xff0000--面的顏色
?? ?local id=1--面數據編號
?? ?--創建一個指向對象的面數據
?? ?local info=Graphics:makeGraphicsSurfaceToActor(objid, size, color, id)?? ?local result,x,y,z=Actor:getPosition(event.eventobjid)--獲取玩家坐標
?? ?--在玩家坐標上創建指向生物的面
?? ?Graphics:createGraphicsSurfaceByPosToActor(x, y, z, info)
end
ScriptSupportEvent:registerEvent([=[Player.ClickActor]=], clickactor)
Lua
snycGraphicsInfo2Client
參數及類型:
返回值及類型:
該方法的主要作用:刷新信息至客機,在更新圖文信息接口之后調用
具體使用案例如下:
--玩家點擊方塊時,執行此函數
local function clickblock(event)
?? ?local graphid=1--此處要改為create圖文信息返回的graphid值,表示圖文信息的id
?? ?--更新id為graphid的文字板的內容
?? ?Graphics:updateGraphicsTextById(graphid, "更新了文字板", 20, 100)
?? ?--刷新信息至客機(避免房主以外的玩家看不到更新內容)
?? ?Graphics:snycGraphicsInfo2Client()
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Lua
?makeGraphicsImage
參數及類型:
imgid:number圖片ID
scale:number圖片大小縮放
apha:number圖片透明度
id:number圖片的編號
返回值及類型:
array:table
該方法的主要作用:創建圖片信息
具體使用案例如下:
local result = Graphics:makeGraphicsImage(v1, v2, color, itype)
Lua
?createGraphicsImageByActor
參數及類型:
objid:table生物或玩家ID
info:table圖片信息(makeGraphicsImage生成)
dir:table圖文信息在生物身上的朝向
offest:number在方向上的偏移
x2:number2d平面上x軸的偏移量
y2:number2d平面上y軸的偏移量
返回值及類型:
ErrorCode.OK
該方法的主要作用:創建位置指向生物的面
具體使用案例如下:
local result = Graphics:createGraphicsImageByActor(objid,info,dir,offest,x2,y2)
Lua
?createGraphicsImageByPos
參數及類型:
x,y,z:table位置坐標信息
info:table圖片信息(makeGraphicsImage生成)
x2:number2d平面上x軸的偏移量
y2:number2d平面上y軸的偏移量
返回值及類型:
ErrorCode.OK
該方法的主要作用:創建位置指向生物的面
具體使用案例如下:
local result = Graphics:createGraphicsImageByPos(x,y,z, info,x2,y2)
Lua
?