# UI Management

Before using UI API, you need to create a UI API Management object as follows:

local UI = class.UI.new()

The specific function name and description are as follows:

Serial number Function name Description
1 setGBattleUI(...) Set the battle ended UI
2 world2RadarPos(...) Convert world coordinates to Mini-map
3 world2RadarDist(...) Convert world length to Mini-map
4 setMinimapRenderMode(...) Set Mini-map rander mode:1. The 45 degree rotation view angle; 2.The overall view Angle
5 setShapeLine(...) Map marker shape set to Line Shape
6 setShapeCircle(...) Map marker shape set to Circle Shape
7 ShowScreenEffect(...) display screen effects

# setGBattleUI

  • Parameters and types:
    • name:string Set name
    • value:string or boolean Set value
  • Return value and types:
  • The main role of this method: Set the battle ended UI
  • The specific use cases are as follows:
--Set the game end interface (some seem to have no effect)
--Set the left title,only need to modify the second parameter
UI:setGBattleUI("left_title","here is the left title")
--Set the right title,only need to modify the second parameter
UI:setGBattleUI("rigjt_title","here is the right title")
--Set the left description,only need to modify the second parameter
UI:setGBattleUI("left_desc","here is the left description")
--Set left brief,only need to modify the second parameter
UI:setGBattleUI("left_title_desc","Here is a brief description of the left")
--Set up on the right,only need to modify the second parameter
UI:setGBattleUI("right_title_desc","Here is a brief description on the right")
--Set whether to display the score navigation panel button,true display false display
UI:setGBattleUI("battle_btn",true)
--Set whether to display the match result,true display false display
UI:setGBattleUI("result",true)
--Set whether the bottom panel of the match result is displayed,true is displayed false is not displayed
UI:setGBattleUI("result_bkg",true)
--Set whether to show the button for another game,true display false not display
UI:setGBattleUI("reopen",true)
--Display a prompt in the chat box
Chat:sendSystemMsg("Animate emoticons to end the game to view the effect")
--Whenever the player makes an animated expression,the game will end
--This function is executed when the player makes an animated expression
local function Player_PlayAction(event)
	--End Game
Game:doGameEnd(nil)
end
--Register an animated expression listener,execute the above function when the event occurs
ScriptSupportEvent:registerEvent([=[Player.PlayAction]=],Player_PlayAction)

# world2RadarPos

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Convert world coordinates to Mini-map
  • The specific use cases are as follows:
--Get the coordinates of the location of (100,100) in the archive on the map
local result,x,z=UI:world2RadarPos(100,100)
--Show in chat box
Chat:sendSystemMsg("Coordinates(100,100) on the current map are("..x..","..z..")")

# world2RadarDist

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Convert world length to Mini-map
  • The specific use cases are as follows:
--Get the length of the 100-square distance on the map in the archive
local result,length=UI:world2RadarDist(100)
--Show in chat box
Chat:sendSystemMsg("The length of the 100 grid distance in the archive on the map is "..length)

# setMinimapRenderMode

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Set Mini-map rander mode:1. The 45 degree rotation view angle; 2.The overall view Angle
  • The specific use cases are as follows:
--Set the map viewing mode to 45-degree rotating viewing angle
--Parameter 0:Default 1:45 degree rotation angle of view 2:Fixed top view angle for full image
UI:setMinimapRenderMode(1)
--Show in chat box
Chat:sendSystemMsg("Set the map view mode to 45-degree rotating viewing angle")

# setShapeLine

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Map marker shape set to Line Shape
  • The specific use cases are as follows:
local result = UI:setShapeLine(uiname, p1x, p1y, p2x, p2y)

# setShapeCircle

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Map marker shape set to Circle Shape
  • The specific use cases are as follows:
local result = UI:setShapeCircle(uiname, x, y, radius)

# ShowScreenEffect

  • Parameters and types:
  • Return value and types:
  • The main role of this method: display screen effects
  • The specific use cases are as follows:
--Display fog effect (seems to have no effect)
--The first parameter is the screen effect id:1 speedline 2 powerline 3 fog
--The second parameter is whether to loop:true is false or not
--The third parameter is the growth rate
UI:ShowScreenEffect(3,false,1)
--Show in chat box
Chat:sendSystemMsg("Show fog effect")
Last Update: 6/11/2020, 9:30:46 PM