====== Lớp Giao Diện ====== Lớp cho giao diện Giao Diện [[developer_center:developer_editor:script|Trở về trang trước]] ------ ==== Cách Viết Sự Kiện ===== ScriptSupportEvent:registerEvent([[Tên Sự Kiện]],tên_hàm_thực_thi) ==== Ví Dụ ==== function Button_Click (event) local playerid,ElementID = e.eventobjid,e.uielement end ScriptSupportEvent:registerEvent([[UI.Button.Click]],Button_Click) ===== Danh Sách Sự Kiện ===== ^ Tên Sự Kiện ^ Giá Trị Nhận Được ^ Miêu tả ^ | UI.Button.Click | eventobjid,CustomUI,uielement | Bất kỳ UI nào được nhấn | | UI.Button.TouchBegin | eventobjid,CustomUI,uielement | Bất kỳ UI nào được bắt đầu chạm vào | | UI.Hide | eventobjid,CustomUI | Bất kỳ UI nào đóng | | UI.LostFocus | eventobjid,CustomUI,uielement,content | Bất kỳ khu vực nhập dữ liệu nào nhập hoàn tất | | UI.Show | eventobjid,CustomUI | Bất kỳ UI nào được mở | ===== Danh Sách API ===== ==== Toàn Cục ==== API này có thể gọi toàn cục. ^ API ^ Giá Trị Trả Về ^ Miêu Tả ^ | Player:openUIView(objid:kiểu số, uiid:kiểu chuỗi) | ErrorCode.OK | Mở UI chỉ định cho người chơi. | | Player:hideUIView(objid:kiểu số, uiid:kiểu chuỗi) | ErrorCode.OK | Đóng UI của người chơi. | ==== Cục Bộ ==== API này có thể gọi trong kịch bản Giao Diện ^ API ^ Giá Trị Trả Về ^ Miêu Tả ^ | Customui:setText(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi, text:kiểu chuỗi) | ErrorCode.OK |Đặt nội dung hiển thị của thành phần văn bản của người chơi| | Customui:setTexture(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi, url:kiểu chuỗi) | ErrorCode.OK |Đặt mẫu thành phần hình ảnh của người chơi| | Customui:setSize(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi, width:kiểu số, height:kiểu số) | ErrorCode.OK |Đặt kích thước của thành phần của người chơi| | Customui:setFontSize(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi, size:kiểu số) | ErrorCode.OK |Đặt kích thước phông chữ của thành phần văn bản của người chơi| |Customui:setColor(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi, color:kiểu chuỗi(Hex color)) | ErrorCode.OK |Đặt màu thành phần của người chơi| | Customui:showElement(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi) | ErrorCode.OK |Hiển thị thành phần cho người chơi| | Customui:hideElement(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi) | ErrorCode.OK |Ẩn thành phần để chơi| | Customui:rotateElement(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi, rotate:kiểu số | ErrorCode.OK |Xoay thành phần chống lại người chơi| | Customui:setState(playerid:kiểu số, uiid:kiểu chuỗi, statename:kiểu chuỗi) | ErrorCode.OK |Chuyển đổi trạng thái trang của người chơi| | Customui:setAlpha(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi, alpha:kiểu số) | ErrorCode.OK |Đặt độ mờ thành phần| | Customui:setPosition(playerid:kiểu số, uiid:kiểu chuỗi, elementid:kiểu chuỗi, x:kiểu số, y:kiểu số) | ErrorCode.OK |Đặt vị trí thành phần| | Customui:getItemIcon(itemid:kiểu số) | ErrorCode.OK, iconid:kiểu số(props) |Nhận biểu tượng của biểu tượng loại prop| | Customui:getMonsterObjIcon(objid:kiểu số) | ErrorCode.OK, iconid:Creature iconID |Nhận biểu tượng sinh vật| | Customui:getMonsterIcon(actorid:nmumber) | ErrorCode.OK, iconid:Creature type iconID |Nhận biểu tượng loại sinh vật| | Customui:getStatusIcon(buffid:kiểu số) | ErrorCode.OK, iconid:Buff iconID |Nhận biểu tượng loại trạng thái| | Customui:getBlockIcon(blockid:kiểu số) | ErrorCode.OK, iconid:Block iconID |Nhận biểu tượng loại khối| | Customui:getRoleIcon(playerid:kiểu số) | ErrorCode.OK, iconid:Role iconID |Nhận biểu tượng loại ký tự| | Customui:getShuctIcon(playerid:kiểu số, ix:kiểu số) | ErrorCode.OK, iconid:Role iconID |Nhận biểu tượng prop thanh tắt (ix)|