# Mini-map Management

Before using the Mini-map API, you need to create a Mini-map API Management object as follows:

local MapMark = class.MapMark.new()

The specific function name and description are as follows:

Serial number Function name Description
1 newShape(...) Add a shape (line, rectangle, circle)
2 deleteShape(...) Delete a shape
3 setShapeColor(...) Set shape color
4 showShape(...) Set shape display or hide
5 updateLine(...) Update shape (line), pass in start and end coordinates
6 updateRectangle(...) Update shape (rectangle), pass in start coordinates and size
7 updateCircle(...) Update shape (circle), pass in center coordinates and radius

# newShape

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Add a shape (line, rectangle, circle)
  • The specific use cases are as follows:
--Create a black line on the map and display it (seems to have no effect)
--The first parameter 0 is the shape type:0 line 1 rectangle 2 round
--Whether the second parameter is displayed:true is false or not
--The last three parameters are the shape color,namely R,G,B (red,green and blue)
local result,shapeid=MapMark:newShape(0,true,0,0,0)
--Show in chat box
Chat:sendSystemMsg("A black line was created!")

# deleteShape

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Delete a shape
  • The specific use cases are as follows:
--Delete the shape with id 1,the parameter 1 is the shape id to be deleted
MapMark:deleteShape(1)
--Show in chat box
Chat:sendSystemMsg("The shape with id 1 is deleted!")

# setShapeColor

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Set shape color
  • The specific use cases are as follows:
--Set the shape with id 1 to black
--The first parameter is the shape id
--The last three parameters are the colors to be changed,namely R,G,B (red,green and blue)
MapMark:setShapeColor(1,0,0,0)
--Show in chat box
Chat:sendSystemMsg("The shape with id 1 is set to black!")

# showShape

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Set shape display or hide
  • The specific use cases are as follows:
--hide the shape with id 1
--The first parameter is the shape id
--The second parameter is whether to hide,true display false hide
MapMark:showShape(1,false)
--Show in chat box
Chat:sendSystemMsg("The shape with id 1 is hidden!")

# updateLine

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Update shape (line), pass in start and end coordinates
  • The specific use cases are as follows:
--Set the shape with id 1 (only a straight line) from (0,0) to (1,1)
--The first parameter 1 is the linear shape id
--The second and third parameters 0,0 are the coordinates of the starting point of the line
--The last two parameters 1,1 are the coordinates of the end point of the line
MapMark:updateLine(1,0,0,1,1)
--Show in chat box
Chat:sendSystemMsg("The line with id 1 is set to go from(0,0) to(1,1)")

# updateRectangle

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Update shape (rectangle), pass in start coordinates and size
  • The specific use cases are as follows:
--Set the shape with id 1 (can only be a rectangle) to a rectangle with width and height of 1 and 1 starting from (0,0)
--The first parameter 1 is the rectangular shape id
--The second and third parameters 0,0 are the coordinates of the starting point of the rectangle
--The last two parameters 1,1 are the width and height of the rectangle
MapMark:updateRectangle(1,0,0,1,1)
--Show in chat box
Chat:sendSystemMsg("The rectangle with id 1 is set to start at(0,0),and the width and height are 1 and 1 respectively")

# updateCircle

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Update shape (circle), pass in center coordinates and radius
  • The specific use cases are as follows:
--Set the shape with id 1 (can only be a circle) to a circle with a center of (0,0) and a radius of 1
--The first parameter 1 is the circular shape id
--The second and third parameters 0,0 are the coordinates of the center of the circle
--The last parameter 1 is the radius of the circle
MapMark:updateCircle(1,0,0,1)
--Show in chat box
Chat:sendSystemMsg("The circle with id 1 is set so that the center of the circle is at(0,0) and the radius is 1")
Last Update: 6/11/2020, 9:30:46 PM