CN112882697A - Construction method of irregular path based on cos2djs - Google Patents

Construction method of irregular path based on cos2djs Download PDF

Info

Publication number
CN112882697A
CN112882697A CN202110303608.1A CN202110303608A CN112882697A CN 112882697 A CN112882697 A CN 112882697A CN 202110303608 A CN202110303608 A CN 202110303608A CN 112882697 A CN112882697 A CN 112882697A
Authority
CN
China
Prior art keywords
coordinate
path
cos2djs
building
path based
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110303608.1A
Other languages
Chinese (zh)
Inventor
张汉东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ultimate Attainment Interactive Network Technical Concern Co ltd In Xiamen
Original Assignee
Ultimate Attainment Interactive Network Technical Concern Co ltd In Xiamen
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ultimate Attainment Interactive Network Technical Concern Co ltd In Xiamen filed Critical Ultimate Attainment Interactive Network Technical Concern Co ltd In Xiamen
Priority to CN202110303608.1A priority Critical patent/CN112882697A/en
Publication of CN112882697A publication Critical patent/CN112882697A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a construction method of an irregular path based on cocos2djs, which comprises the following steps: s1, making a path building tool by using a CocosBuilder interface editor; s2, importing the map to be edited into the path building tool; s3, selecting a plurality of path points in the map to be edited to form a path curve; s4, recording the coordinates of the path points by the path building tool to form a coordinate queue, analyzing the coordinate queue and putting the analysis result into a shear plate; and S5, pasting the analysis result into an Excel table. The method solves the time-consuming problem of manually writing a large number of coordinate points and the problem that the large number of coordinate points need to be repeatedly modified after the requirement changes, and greatly improves the working efficiency.

Description

Construction method of irregular path based on cos2djs
Technical Field
The invention relates to the technical field of computers, in particular to a construction method of an irregular path based on cos2 djs.
Background
In the map playing method, in order to make a player feel attacking places slightly, a large number of city pools are arranged on a map, the city pools are connected by irregular roads, in order to create an online atmosphere of multiple people, a person needs to be virtualized on each road irregularly, and the person can walk from one city pool to another city pool along the routes, so that programmers need to calculate the track of each irregular route and move the person along the track.
However, the trajectory of each route is different and irregular, and cannot be calculated by a conventional mathematical formula, and if a programmer records each coordinate point of the trajectory by handwriting, the workload is huge and time is consumed, and if the planner wants to adjust the positions and paths of several urban pools, the programmer needs to repeat a lot of operations, which is inefficient.
Disclosure of Invention
In order to solve the problems, the invention provides a construction method of an irregular path based on cos2djs, so as to improve the planning and construction efficiency of the path.
The invention adopts the following technical scheme:
a construction method of an irregular path based on cos2djs comprises the following steps:
s1, making a path building tool by using a CocosBuilder interface editor;
s2, importing the map to be edited into the path building tool;
s3, selecting a plurality of path points in the map to be edited to form a path curve;
s4, recording the coordinates of the path points by the path building tool to form a coordinate queue, analyzing the coordinate queue and putting the analysis result into a shear plate;
and S5, pasting the analysis result into an Excel table.
Further, step S6 is included, emptying the coordinate queue.
Further, the coordinate queue comprises a plurality of coordinates, wherein X represents a serial number of the coordinates, X is (1,2,3 … n), X is an integer, and when X is n, the n-th coordinate is represented, and a value of each coordinate is composed of an abscissa value and an ordinate value.
Further, the step S4 is specifically as follows:
s41, setting X to be 1, reading the Xth coordinate of the coordinate queue, putting the abscissa value into the array A, and putting the ordinate value into the array B;
s42, determining whether the current coordinate is the last coordinate, if so, performing the next step, otherwise, making X equal to X +1, and repeating steps S41 to S42;
s43, separating each numerical value in the array A by a first symbol in sequence to form a character string C, and separating each numerical value in the array B by a first symbol in sequence to form a character string D;
s44, separating the character string C and the character string D by a second symbol to form a character string E;
and S45, putting the character string E into the clipboard.
Further, the first symbol is "|", "-", "/", "_", "&", "! "," @ "," # "," $ ","% "or" - ".
Further, the second symbol is "\ t".
Further, the path building tool comprises a map area and a button; the map area is used for loading and displaying a map to be edited and supports up-down left-right sliding and infinite extension; a ScrollView control is placed in the map area; the buttons include a record button, a export button, and a reset button, and the buttons are used to implement a map editing function.
Further, the recording button is used for recording the coordinates of the path points and forming a coordinate queue.
Further, the export button is used for analyzing the coordinate queue and exporting the coordinate queue to an Excel table.
Further, the reset button is used to empty the coordinate queue.
After adopting the technical scheme, compared with the background technology, the invention has the following advantages:
according to the method, the path is quickly edited and built on the map by using the path building tool to form the coordinate queue, then the coordinate queue of the path is divided and spliced by using the symbols and is placed into the shear plate for the user to directly stick to the Excel document, so that the problems that time is consumed when a large number of coordinate points are manually written and the coordinate points need to be repeatedly modified after the demand changes are solved, and the working efficiency is greatly improved.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention;
FIG. 2 is a schematic view of the construction tool interface structure of the present invention;
FIG. 3 is a flowchart illustrating step S4 according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Examples
As shown in fig. 1, a method for building an irregular path based on cos2djs includes the following steps:
s1, making a path building tool by using a CocosBuilder interface editor;
the path building tool comprises a map area and a button; the map area is used for loading and displaying a map to be edited and supports up-down left-right sliding and infinite extension; the buttons include a record button, a export button, and a reset button, and the buttons are used to implement a map editing function.
The path building tool is manufactured as follows:
A. placing a ScrollView control in a map area on a CocosBuilder interface, wherein the control is used for loading and displaying a map to be edited and supports up-down, left-right sliding and infinite extension;
B. placing a red point in the map area, wherein the red point is used for dragging a user to form a path point;
C. three buttons of 'record', 'export' and 'reset' are placed at the top of the interface, and the structure of the interface is shown in FIG. 2;
D. the function of 'draggable' is added to the red point, the function of 'adding the current coordinates of the red point into the coordinate queue' is added to the 'record' button, the function of 'analyzing and writing the coordinate queue into the clipboard' is added to the 'export' button, and the function of 'adding the coordinate queue condition' is added to the 'reset' button.
S2, importing the map to be edited into the path building tool;
when the path building tool is used, the ccbi file exported from the interface is placed in a project based on a cos2djs engine, and the whole map is loaded into the ScrollView control when the interface is opened, so that the map to be edited can be imported into the path building tool.
S3, selecting a plurality of path points in the map to be edited to form a path curve;
s4, recording the coordinates of the path points by the path building tool to form a coordinate queue, analyzing the coordinate queue and putting the analysis result into a shear plate;
the coordinate queue comprises a plurality of coordinates, wherein X represents the serial number of the coordinates, X is (1,2,3 … n), X is an integer, when X is n, the n-th coordinate is represented, and the value of each coordinate consists of an abscissa value and an ordinate value.
As shown in fig. 3, the step S4 is specifically as follows:
s41, setting X to be 1, reading the Xth coordinate of the coordinate queue, putting the abscissa value into the array A, and putting the ordinate value into the array B;
s42, determining whether the current coordinate is the last coordinate, if so, performing the next step, otherwise, making X equal to X +1, and repeating steps S41 to S42;
s43, sequentially separating each numerical value in the a array by a first symbol "|", forming a character string C, such as x1| x2| x3|. | -xn; each numerical value in the B array is sequentially separated by a first symbol "|", forming a string D, y1| y2| y3|. | -;
s44, separating the character string C from the character string D by a second symbol of't', and forming a character string E, wherein x1| x2| x3|. xn \ ty1| y2| y3|.. | -yn;
and S45, putting the character string E into the clipboard.
And S5, pasting the analysis result into an Excel table. The user can paste the character string in the clipboard into the Excel table through the key of the keyboard 'Ctrl + V'.
The symbols "/" and "\ t" are used for segmenting and splicing the coordinate queue of the path and are placed in a clipboard, so that a user can conveniently and directly paste the path into an Excel document.
Step S6 is further included, emptying the coordinate queue. The planner can repeat the production of different paths.
The embodiment is provided with a path building tool, the tool can be provided for a planning staff to use, the planning staff can build a curve formed by a plurality of small line segments only by dragging a red point and recording the red point with a mouse, meanwhile, the tool can record the coordinate of the clicking position of the planning staff into a memory to form a coordinate queue, after the planning staff makes a complete path, the tool can analyze the coordinate queue into a character string and guide the character string into an Excel table, and therefore the problem of low handwriting efficiency is solved, if the planning staff wants to adjust the position and the path, new path data can be obtained only by making the mouse again, and a large number of repeated operations are also saved.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A construction method of an irregular path based on cos2djs is characterized in that: the method comprises the following steps:
s1, making a path building tool by using a CocosBuilder interface editor;
s2, importing the map to be edited into the path building tool;
s3, selecting a plurality of path points in the map to be edited to form a path curve;
s4, recording the coordinates of the path points by the path building tool to form a coordinate queue, analyzing the coordinate queue and putting the analysis result into a shear plate;
and S5, pasting the analysis result into an Excel table.
2. The method for building an irregular path based on cos2djs as claimed in claim 1, wherein: step S6 is further included, emptying the coordinate queue.
3. The method for building an irregular path based on cos2djs as claimed in claim 1, wherein: the coordinate queue comprises a plurality of coordinates, wherein X represents the serial number of the coordinates, X is (1,2,3 … n), X is an integer, when X is n, the n-th coordinate is represented, and the value of each coordinate consists of an abscissa value and an ordinate value.
4. A construction method of irregular path based on cos2djs as claimed in claim 3, characterized in that: the step S4 is specifically as follows:
s41, setting X to be 1, reading the Xth coordinate of the coordinate queue, putting the abscissa value into the array A, and putting the ordinate value into the array B;
s42, determining whether the current coordinate is the last coordinate, if so, performing the next step, otherwise, making X equal to X +1, and repeating steps S41 to S42;
s43, separating each numerical value in the array A by a first symbol in sequence to form a character string C, and separating each numerical value in the array B by a first symbol in sequence to form a character string D;
s44, separating the character string C and the character string D by a second symbol to form a character string E;
and S45, putting the character string E into the clipboard.
5. The method for building an irregular path based on cos2djs as claimed in claim 4, wherein: the first symbol is "|", "-", "/", "_", "&", "! "," @ "," # "," $ ","% "or" - ".
6. The method for building an irregular path based on cos2djs as claimed in claim 5, wherein: the second symbol is "\ t".
7. The method for building an irregular path based on cos2djs as claimed in claim 1, wherein: the path building tool comprises a map area and a button; the map area is used for loading and displaying a map to be edited and supports up-down left-right sliding and infinite extension; a ScrollView control is placed in the map area; the buttons include a record button, a export button, and a reset button, and the buttons are used to implement a map editing function.
8. The method for building an irregular path based on cos2djs as claimed in claim 7, wherein: the recording button is used for recording the coordinates of the path points and forming a coordinate queue.
9. The method for building an irregular path based on cos2djs as claimed in claim 8, wherein: and the export button is used for analyzing the coordinate queue and exporting the coordinate queue to an Excel table.
10. The method for building an irregular path based on cos2djs as claimed in claim 9, wherein: the reset button is used to empty the coordinate queue.
CN202110303608.1A 2021-03-22 2021-03-22 Construction method of irregular path based on cos2djs Pending CN112882697A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110303608.1A CN112882697A (en) 2021-03-22 2021-03-22 Construction method of irregular path based on cos2djs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110303608.1A CN112882697A (en) 2021-03-22 2021-03-22 Construction method of irregular path based on cos2djs

Publications (1)

Publication Number Publication Date
CN112882697A true CN112882697A (en) 2021-06-01

Family

ID=76041698

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110303608.1A Pending CN112882697A (en) 2021-03-22 2021-03-22 Construction method of irregular path based on cos2djs

Country Status (1)

Country Link
CN (1) CN112882697A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020080A (en) * 2011-09-23 2013-04-03 鸿富锦精密工业(深圳)有限公司 Method and system for rapidly reading point cloud document
KR20130039605A (en) * 2011-10-12 2013-04-22 (주) 한양지에스티 Surveying system
CN108721895A (en) * 2018-05-23 2018-11-02 福州趣乐互动科技有限公司 A kind of game level edit methods, terminal and storage medium based on unity engines
CN109084789A (en) * 2018-07-02 2018-12-25 四川斐讯信息技术有限公司 A kind of smartwatch air navigation aid, smartwatch and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020080A (en) * 2011-09-23 2013-04-03 鸿富锦精密工业(深圳)有限公司 Method and system for rapidly reading point cloud document
KR20130039605A (en) * 2011-10-12 2013-04-22 (주) 한양지에스티 Surveying system
CN108721895A (en) * 2018-05-23 2018-11-02 福州趣乐互动科技有限公司 A kind of game level edit methods, terminal and storage medium based on unity engines
CN109084789A (en) * 2018-07-02 2018-12-25 四川斐讯信息技术有限公司 A kind of smartwatch air navigation aid, smartwatch and system

Similar Documents

Publication Publication Date Title
EP0637812B1 (en) Method for dynamically maintaining multiple structural interpretations in graphics system
US20070176922A1 (en) Information display apparatus, information display method, information display program, graphical user interface, music reproduction apparatus, and music reproduction program
CN102141876A (en) Linking and managing mathematical objects
CN110544411B (en) Staff fingering quick marking method and system
CN109035364A (en) Method for rapidly drawing profile map based on CAD topographic map
JP2003132361A (en) Object selecting device and method
JP4611116B2 (en) Information processing apparatus and program used for presentation
US20080208543A1 (en) Land plan development
CN112882697A (en) Construction method of irregular path based on cos2djs
JP2015001874A (en) Information processing device, information processing method, and computer-readable recording medium
Chappell AutoCAD Civil 3D 2014 Essentials: Autodesk Official Press
CN114511240A (en) Mine excavation plan generation method and storage medium
JP2018018458A (en) Input support device and input support program
JP4879134B2 (en) Ladder diagram editing method
Hardy et al. Cartography, Database and GIS: Not Enemies, but Allies!
Boardman Getting Started in 3D with 3ds Max: Model, Texture, Rig, Animate, and Render in 3ds Max
CN102254542B (en) Display control method, display control unit and program
US20040171363A1 (en) Graphics selecting method, graphics selecting device, graphic selecting program, graphic ediding method, graphic ediding device, graphic ediding program, and recording medium where the programs are recorded
Chappell AutoCAD Civil 3D 2015 Essentials: Autodesk Official Press
Oldknow Mathematics from still and video images
JPH10222689A (en) Method for displaying graphic and device therefor and storage medium for storing graphic display program
Terry Set-based user interaction
EP4328810A1 (en) Display program, display method, and information processing apparatus
Alshaghdari Geological mapping using open source QGIS
JP4146324B2 (en) Figure move method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210601