CN116841550A - User interface generation method and device, electronic equipment and computer readable medium - Google Patents

User interface generation method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN116841550A
CN116841550A CN202310877622.1A CN202310877622A CN116841550A CN 116841550 A CN116841550 A CN 116841550A CN 202310877622 A CN202310877622 A CN 202310877622A CN 116841550 A CN116841550 A CN 116841550A
Authority
CN
China
Prior art keywords
user interface
control
script code
generating
file
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
CN202310877622.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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202310877622.1A priority Critical patent/CN116841550A/en
Publication of CN116841550A publication Critical patent/CN116841550A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • 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
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure relates to a method and a device for generating a user interface, electronic equipment and a computer readable medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring a UI design file of a user interface, and generating a corresponding UI design description file according to the UI design file; according to template files respectively corresponding to various UI controls contained in the user interface, converting the UI design description file into an executable UI script code; and sending the UI script code to a game terminal so that the game terminal executes the UI script code through game logic and generates a corresponding user interface. The method and the device can generate the executable UI script codes by using the template files corresponding to various UI controls, so that the efficiency is improved, different loading processes of game logic are facilitated, and the program efficiency and the game experience are greatly optimized.

Description

User interface generation method and device, electronic equipment and computer readable medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a method and device for generating a user interface, an electronic device and a computer readable medium.
Background
In the game making process, a game UI (User Interface) is generally edited by an art department using an editor and confirms an art effect, and a generated description file is generally described by using a general serialization format (such as json, xml format, etc.) in order to be as general as possible in different environments and game engines. Some systems also use binary sequences for optimization due to the long load resolution time, however, this part of the load work is typically performed more efficiently, but the code size is huge and difficult to expand.
In view of the foregoing, there is a need in the art for a method for generating a user interface that can optimize program efficiency while facilitating problem updates and functional maintenance.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to providing a method for generating a user interface, an apparatus for generating a user interface, an electronic device, and a computer readable medium, so as to improve the efficiency of generating a user interface at least to a certain extent, and facilitate the update of problems and the maintenance of functions.
According to a first aspect of the present disclosure, there is provided a method for generating a user interface, including:
acquiring a UI design file of a user interface, and generating a corresponding UI design description file according to the UI design file;
according to template files respectively corresponding to various UI controls contained in the user interface, converting the UI design description file into an executable UI script code;
and sending the UI script code to a game terminal so that the game terminal executes the UI script code through game logic and generates a corresponding user interface.
According to a second aspect of the present disclosure, there is provided a generation apparatus of a user interface, including:
the description file generation module is used for acquiring the UI design file of the user interface and generating a corresponding UI design description file according to the UI design file;
the script code generation module is used for converting the UI design description file into an executable UI script code according to template files respectively corresponding to various UI controls contained in the user interface;
and the script code sending module is used for sending the UI script code to a game terminal so that the game terminal executes the UI script code through game logic and generates a corresponding user interface.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of generating a user interface of any of the above via execution of the executable instructions.
According to a fourth aspect of the present disclosure, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method of generating a user interface as described in any of the above.
Exemplary embodiments of the present disclosure may have the following advantageous effects:
in the method for generating the user interface in the exemplary embodiment of the disclosure, on one hand, by using the template files corresponding to various UI controls to generate the executable UI script code, the post-processing flow after the game logic loads the UI files is reduced, so that all the post-processing logic can be realized by modifying the template files in the manufacturing stage, the effect that the UI script code can be used after being executed in the game logic is achieved, the UI display efficiency and the game experience are greatly optimized, and meanwhile, the game logic is also convenient to do different loading processes; on the other hand, the UI design file is more dependent on the production flow from the UI display stage to the game UI display stage, so that the efficiency consumption in the game running flow can be reduced, and after all UI logic scripting, the problem update and function maintenance are facilitated.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 shows a flow diagram of a method of generating a user interface of an example embodiment of the present disclosure;
FIG. 2 illustrates a flow diagram of generating UI scripting code according to an example embodiment of the present disclosure;
FIG. 3 illustrates a flow diagram of correcting a UI control that has an error according to an example embodiment of the present disclosure;
FIG. 4 illustrates a flow diagram for adding new controls in one embodiment according to the present disclosure;
FIG. 5 schematically illustrates a schematic diagram of in-memory copying of UI controls of the same type in one embodiment in accordance with the disclosure;
FIG. 6 illustrates a flow diagram of UI scripting code sent to a gaming side for user interface generation according to an example embodiment of the present disclosure;
FIG. 7 illustrates a flow diagram of a game side asynchronously loading texture resources in accordance with one embodiment of the present disclosure;
FIG. 8 illustrates a flow diagram of secondary packaging of a base control by game logic in accordance with a related embodiment of the present disclosure;
FIG. 9 shows a block diagram of a generating device of a user interface of an example embodiment of the present disclosure;
fig. 10 shows a schematic diagram of a computer system suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
For some engine system designs, interfaces need to be designed and reserved in advance to achieve the optimization requirements in some loads. Such as setting load texture path priorities, retrieving a list of textures used in a single UI, using asynchronous load textures as default options in a single control, etc.
In some related embodiments, these functions are typically implemented at the engine level because of efficiency issues, requiring recompilation each time a modification such as an iteration or repair is performed, the modification is costly and maintenance-intensive, and it is typically not possible to do the hot update to modify the loading logic of the UI. Because different basic controls are analyzed by using different codes, the execution efficiency of the partial codes is usually single in order to be robust and the program is run, and the development of various requirements is not facilitated. The newly added supporting control types or control attributes are required to be realized again, the loading flow is inconvenient to modify, and the supporting of some asynchronous loading schemes is weak. In the implementation of UI animation, the animation and the UI control are generally bound and generated during loading, and the loading efficiency is influenced by both the control and the animation.
Based on the above-described problems, the present exemplary embodiment first provides a generation method of a user interface. Referring to fig. 1, the method for generating a user interface may include the steps of:
s110, acquiring a UI design file of the user interface, and generating a corresponding UI design description file according to the UI design file.
And S120, converting the UI design description file into an executable UI script code according to template files respectively corresponding to various UI controls contained in the user interface.
And S130, transmitting the UI script code to the game terminal, so that the game terminal executes the UI script code through game logic and generates a corresponding user interface.
In the method for generating the user interface in the exemplary embodiment of the disclosure, on one hand, by using the template files corresponding to various UI controls to generate the executable UI script code, the post-processing flow after the game logic loads the UI files is reduced, so that all the post-processing logic can be realized by modifying the template files in the manufacturing stage, the effect that the UI script code can be used after being executed in the game logic is achieved, the UI display efficiency and the game experience are greatly optimized, and meanwhile, the game logic is also convenient to do different loading processes; on the other hand, the UI design file is more dependent on the production flow from the UI display stage to the game UI display stage, so that the efficiency consumption in the game running flow can be reduced, and after all UI logic scripting, the problem update and function maintenance are facilitated.
Next, the above steps of the present exemplary embodiment will be described in more detail with reference to fig. 2 to 8.
In step S110, a UI design file of the user interface is acquired, and a corresponding UI design description file is generated according to the UI design file.
In this exemplary embodiment, UI (User Interface) refers to an overall design of man-machine interaction, operation logic, and Interface beauty for software. The UI is a medium for interaction and information exchange between the system and the user, and can implement conversion between an internal form of information and a human acceptable form.
For an existing UI design file, a corresponding UI design description file may be generated by UI editing software. The UI design description file carries the most accurate description of the original UI design elements, and the format of the UI design description file may be json, xml, or the like, or a binary file with higher efficiency. In general, these files need to be parsed according to rules and organized into a structure of a node tree, showing the hierarchy and parent-child relationships of UI design elements, and the like.
In step S120, the UI design description file is converted into an executable UI script code according to the template files respectively corresponding to the various UI controls included in the user interface.
In this example embodiment, the UI control refers to a basic control or a set of basic controls, which facilitates multiplexing of the same UI template and can be used in a nested manner. The basic controls are basic elements constituting the UI, such as buttons, pictures, texts, input boxes, progress bars, and the like.
In the example embodiment, the UI design description file can be re-parsed by using Python structuring, the UI design is exported into Python codes which can be directly executed, and scripting of various UI loading optimization schemes is facilitated. Python is an object-oriented, interpreted computer programming language. Python provides an efficient, high-level data structure that can also be easily and efficiently programmed towards objects. Python grammar and dynamic type, as well as the nature of interpreted languages, make it a programming language for writing scripts and rapidly developing applications on most platforms. The compiling language firstly compiles the source code to generate the machine language, then the machine runs the machine code (binary system), the running efficiency is higher, the modifying cost is higher, and the hot updating is difficult. The interpreted language is existed relative to the compiled language, the source code is not directly translated into the machine language, but is translated into the intermediate code, then the intermediate code is interpreted and operated by the interpreter, the operation efficiency is low, the cross-platform universality is strong, and the hot update is naturally supported.
There are generally correspondingly perfect implementations in games for different UI controls. In the example embodiment, script codes of the whole UI file are generated by using different template files corresponding to various UI controls, and various logic originally needing post-processing can be realized by modifying the template files in the middle.
In this example embodiment, as shown in fig. 2, according to template files respectively corresponding to various UI controls included in the user interface, the UI design description file is converted into an executable UI script code, which may specifically include the following steps:
and S210, acquiring control types of all UI controls and UI information of all UI controls through the UI design description file, wherein the UI information comprises independent UI information and general UI information.
The control types of all the UI controls can be obtained through the UI design description file, and the UI information of all the UI controls is tidied. The control type of the UI control may be, for example, buttons, pictures, animations, progress bars, etc. The UI information may include independent UI information, which may be, for example, node attributes, animation descriptions, texture resource information, etc., and general UI information, which is general attribute information of the UI control, such as coordinates, dimensions, hierarchical information, etc.
And S220, determining a template file corresponding to the UI control according to the control type of the UI control, and obtaining a first control script code corresponding to the UI control according to the template file corresponding to the UI control and the independent UI information.
In this example embodiment, the template file is generated according to game logic obtained from the game terminal, and different control types correspond to different template files. By tightly combining the template file with the game logic, various efficiency and experience improvement on the game UI display can be brought, and optimization means such as asynchronous loading of each node, extraction of UI animation, efficient multiplexing of the nodes and the like can be conveniently realized.
And S230, obtaining a second control script code corresponding to the UI control according to the universal template file and the universal UI information, and obtaining the UI control script code of the UI control according to the first control script code and the second control script code.
And using the universal template file to realize code loading of the universal UI information, and then combining the first control script code and the second control script code to realize differentiated UI control script code generation.
And S240, obtaining UI script codes of the user interface according to the UI control script codes of all the UI controls contained in the user interface.
And finally, obtaining the UI script codes of the whole user interface according to the UI control script codes of all the UI controls contained in the user interface.
In the example embodiment, the derived UI script code may be adaptively modified according to the game logic, so that the game logic is very convenient to execute the UI script code, and post-processing after the game logic loads the UI file is greatly reduced. The large number of operations can implement the generation of all UI logic and descriptions by simply providing the corresponding interfaces and modifying the template tools prior to game creation.
In some related embodiments, the UI control needs to be re-edited and a new parsing file is exported when an error occurs in the UI control, and if the parsing code built in the game engine is in error, the installation package needs to be updated to realize the UI control.
The UI code in the present exemplary embodiment is script code and can be modified by a configuration template, so that a UI error on a line can also be repaired by a hot update. As shown in fig. 3, the method for correcting the UI control with the error specifically includes the following steps:
and S310, when errors occur in the UI control script codes corresponding to one or more UI controls in the user interface, correcting the original template file corresponding to the UI controls to obtain a corrected template file.
When a certain UI control is wrong or the corresponding UI control script code is wrong, the original template file corresponding to the UI control is directly corrected to obtain a corrected template file.
And S320, replacing the original template file corresponding to the UI control with the error with a corrected template file, and regenerating the UI script code of the user interface.
Replacing the original template file corresponding to the UI control with the corrected template file, regenerating the UI control script code according to the replaced template file, and further generating the UI script code of the user interface.
And S330, transmitting the corrected UI script code to the game terminal so that the game terminal repairs the user interface in a hot update mode.
Because the generated UI codes are script codes and naturally support the problem of hot update repair, the replacement of an installation package can be avoided, and the updating of a UI analysis file with larger volume is avoided. For problems in the UI parsing flow, the on-line problems may also be repaired by modifying the corresponding script code.
The method can simply solve the analysis error and even realize new functions by modifying the template. The design is also based on basic attributes, and is aided with a small amount of codes specific to special controls, so that modification and expansion are very convenient.
In some related embodiments, when the UI parsing flow is implemented using an engine, engine code needs to be replaced for both expansion and new support of the control, resulting in the online player updating the installation package to complete the experience.
In this example embodiment, when a new UI control is added in the user interface, a template file to be added corresponding to the UI control to be added may be obtained, and a UI control script code corresponding to the UI control to be added may be generated according to the template file to be added, so that the addition of the UI control and the update to the online environment may be conveniently performed in the production stage.
As shown in fig. 4, a flow chart of adding a new control in an embodiment of the present disclosure includes the following specific steps:
step S410, adding new control support in the UI editor.
New controls are added by using corresponding editing software in the UI design process, and corresponding support is needed in the game to enable the game performance to be consistent with the UI design.
And S420, adding a template file of the new control in the export tool.
And adding the template file of the control in the template file, so that support can be added for a new control in the production environment. And as the general attribute of the UI control is mostly free from adding template codes, only the existing basic template is needed to be inherited.
Step S430, using in the game and updating to the online environment.
After the script codes of the new control are converted, clients in the online operation environment can timely experience relevant functions of the new control in the game through hot update due to the natural support of the script codes, so that the time cost of replacing an installation package is reduced, and the game experience of a player is enhanced.
In practical game designs, a single UI often has multiple duplicate UI controls, but many duplicate performance costs are required due to subtle differences and for engine parsing code robustness.
In this example embodiment, UI controls included in the user interface may be classified according to control types of the UI controls, and UI control script codes corresponding to UI controls having the same control type may be generated by using a memory copy manner. By using multiplexing mode to reuse control in the process of converting UI code, the direct memory copy realizes loading acceleration, can realize composite use of similar basic or combined control, and greatly reduces performance consumption.
Fig. 5 schematically illustrates a schematic diagram of in-memory copying of UI controls of the same type in one embodiment according to the present disclosure. A single UI is composed of multiple controls that are interleaved and combined, some of which are combined controls that are bulky in content. Similar UI structures are extremely wasteful of performance for general UI parsing designs, and even with corresponding optimizations, later repair work requires modification of the design engine code resulting in a pack change risk. Through classifying UI controls while converting script codes, for the controls of the same type, the efficiency consumption of analysis is avoided by using a memory copying mode, then corresponding fine adjustment is carried out according to the original layout, and for relatively complex UI structures, the efficiency difference of the script language can be wiped out.
In this example embodiment, the interface code of the language conversion in the game may be nested in the template file corresponding to each UI control, so that when the game terminal executes the UI script code, the display of the user interface with multiple languages is implemented according to the interface code of the language conversion in the template file.
Generally, implementing a multi-language UI requires providing multiple UI files or performing traversal substitutions within the game logic after the UI parsing loading is completed, which can be time and space compromised. By nesting the interface code for language conversion in the game in the template file corresponding to each UI control, the requirement can be realized in the manufacturing stage.
For a single-language UI design file, the UI designer does not need to consider different language replacement problems in the game in the design stage. In the process of converting the UI design file into script codes, the template file is modified, the interface codes of multi-language conversion in the game are nested, and the generated script codes are complete codes without post-processing. When the UI is displayed in the game, the script code converted by the method can be directly executed without performing operations such as traversing replacement and the like on the node tree after the UI is analyzed and loaded, and the multi-language UI can be displayed.
In the embodiment of the invention, all post-processing logic can be realized by modifying the template file in the manufacturing stage, so that the effect that UI codes are available after being executed in the game logic is achieved, and the program efficiency and the game experience are greatly optimized.
In step S130, the UI script code is transmitted to the game terminal, so that the game terminal executes the UI script code through the game logic and generates a corresponding user interface.
In the example embodiment, the generated UI script code is an interpreted language code, and the game terminal can directly run and realize the hot update of all UI functions, so that the efficiency consumption in the game running process is reduced, and the UI display efficiency and the game experience are improved.
In this example embodiment, after the UI script code is sent to the game end, for texture resources in the UI control, a manner of asynchronous loading may be used to reduce the stuck condition in the loading process. As shown in fig. 6, the UI script code is sent to the game terminal, so that the game terminal executes the UI script code through the game logic and generates a corresponding user interface, which specifically includes the following steps:
and S610, generating a texture resource list of the user interface according to texture resource information of all UI controls contained in the user interface.
In the script code conversion stage, texture resources can be extracted and sorted according to texture resource information of all UI controls contained in the user interface, a texture resource list of the user interface is generated, and a structure is provided for inquiring game logic.
And S620, transmitting the UI script code and the texture resource list of the user interface to the game terminal, so that the game terminal asynchronously loads all texture resources according to the texture resource list, and then executing the UI script code and generating a corresponding user interface through game logic.
FIG. 7 is a flow chart of asynchronous loading of texture resources by a gaming side in one embodiment of the present disclosure. Different controls on a single UI may include buttons, pictures, progress bars, etc., and due to the complexity of the functionality, game UI interfaces typically have a large number of UI controls doped into a single UI, and each of these controls has its texture resources required, with the texture resources used being more diffuse. After the UI script code and the texture resource list of the user interface are sent to the game terminal, the game terminal asynchronously loads all texture resources into the memory according to the texture resource list, and the implementation codes of the controls are returned by other interfaces, so that the huge UI description file is prevented from being analyzed before asynchronous loading. The game end asynchronously loads texture resources as follows:
and S710, loading a texture resource list in advance.
The loading flow in the game logic can conveniently asynchronously load all texture resources used in the UI, and all texture resources are loaded into the memory at one time.
And S720, controlling the UI display time through the game logic.
The game logic controls the UI display time, for example, a transition interface is used in the asynchronous loading process, and the UI is displayed after loading is completed. The specific loading order and strategy may be implemented by external logic.
And S730, loading a UI control list.
When the display is needed, the control codes are executed according to the UI control list by using another interface, and the problem that resources in the control are not ready to be blocked at this time is avoided.
And S740, implementing other game logic.
And finally, other game logics are realized according to the requirements. For example, the UI control and the animation data loading interface are distinguished, the loading sequence is determined by external logic, and the UI control and the animation data can be loaded respectively according to the requirement.
In addition, the game terminal can also reserve all UI related interface rewriting schemes in a configurable mode, and can be matched with game logic to carry out differentiated control loading, for example, UI display with different screen sizes is adapted.
FIG. 8 is a flow chart illustrating secondary packaging of a base control by game logic in a related embodiment of the present disclosure, the specific steps of the flow chart are as follows:
step S810, converting the UI design file into a UI sequence file.
Step S820, the game engine loads the UI sequence file.
Step S830, the script layer traverses the whole node tree.
And S840, packaging according to the node type.
In some related embodiments, the UI design file may be converted to a generic sequence file, which is reloaded by the game engine to construct the underlying UI structure, often requiring secondary traversal and encapsulation of the node number by the game logic, to implement the game function.
In this example embodiment, the template file may be modified during the manufacturing phase to accommodate the game logic. The code thus converted is already the complete code meeting the packaging requirements of the controls in the game logic. Therefore, during game running, the UI node does not need to be subjected to subsequent processing, and therefore efficiency is improved.
Meanwhile, since the generated script code, such as Python code, is interpreted language code, hot update of all UI functions can be realized. When the UI editor or the game logic needs to have new UI attributes, the new UI control can be realized by only adding a corresponding export template and modifying a small amount of script codes without recompiling part of the underlying engine. The general loading optimization items in the game logic can be realized in combination in the export template of the tool, including but not limited to batch loading of resources, asynchronous loading of UI, texture batching, acceleration loading of UI repetition nodes, and the like.
It should be noted that although the steps of the methods in the present disclosure are depicted in the accompanying drawings in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
Further, the present disclosure also provides a device for generating a user interface. Referring to fig. 9, the generating means of the user interface may include a description file generating module 910, a script code generating module 920, and a script code transmitting module 930. Wherein:
the description file generation module 910 may be configured to obtain a UI design file of the user interface, and generate a corresponding UI design description file according to the UI design file;
the script code generating module 920 may be configured to convert the UI design description file into an executable UI script code according to template files corresponding to various UI controls included in the user interface, respectively;
the script code transmitting module 930 may be used to transmit the UI script code to the game terminal, so that the game terminal executes the UI script code through the game logic and generates a corresponding user interface.
In some example embodiments of the present disclosure, the script code generating module 920 may include a UI information acquiring unit, a first control script code generating unit, a UI control script code generating unit, and a UI script code generating unit. Wherein:
the UI information obtaining unit may be configured to obtain, through the UI design description file, a control type of each UI control, and UI information of each UI control, where the UI information includes independent UI information and general UI information;
the first control script code generating unit may be configured to determine a template file corresponding to the UI control according to a control type of the UI control, and obtain a first control script code corresponding to the UI control according to the template file corresponding to the UI control and independent UI information;
the UI control script code generating unit can be used for obtaining a second control script code corresponding to the UI control according to the universal template file and the universal UI information, and obtaining the UI control script code of the UI control according to the first control script code and the second control script code;
the UI script code generating unit may be configured to obtain the UI script code of the user interface according to the UI control script codes of all the UI controls included in the user interface.
In some exemplary embodiments of the present disclosure, the script code generating module 920 may further include a corrected template file acquiring unit, a template file replacing unit, and a corrected template file transmitting unit.
Wherein:
the corrected template file obtaining unit may be configured to correct an original template file corresponding to the UI control to obtain a corrected template file when an error occurs in a UI control script code corresponding to one or more UI controls in the user interface;
the template file replacing unit can be used for replacing an original template file corresponding to the UI control with an error into a corrected template file and regenerating a UI script code of the user interface;
the corrected template file sending unit may be configured to send the corrected UI script code to the game terminal, so that the game terminal repairs the user interface by means of hot update.
In some exemplary embodiments of the present disclosure, the script code generating module 920 may further include a UI control adding unit, which may be configured to obtain a template file to be added corresponding to a UI control to be added when a new UI control is added in a user interface, and generate a UI control script code corresponding to the UI control to be added according to the template file to be added.
In some exemplary embodiments of the present disclosure, the script code generating module 920 may further include a UI control classifying unit, which may be configured to classify UI controls included in the user interface according to control types of the respective UI controls, and generate UI control script codes corresponding to UI controls having the same control types in a memory copy manner.
In some exemplary embodiments of the present disclosure, the script code transmitting module 930 may include a texture resource list generating unit and a texture resource list transmitting unit. Wherein:
the texture resource list generating unit may be configured to generate a texture resource list of the user interface according to texture resource information of all UI controls included in the user interface;
the texture resource list sending unit may be configured to send the UI script code and the texture resource list of the user interface to the game terminal, so that after the game terminal asynchronously loads all texture resources according to the texture resource list, the game logic executes the UI script code and generates a corresponding user interface.
In some exemplary embodiments of the present disclosure, the script code generating module 920 may further include a language conversion interface code nesting unit, which may be configured to nest in-game language conversion interface codes in template files corresponding to respective UI controls, so that when the UI script codes are executed by a game terminal, display of a user interface with multiple languages is implemented according to the language conversion interface codes in the template files.
In some exemplary embodiments of the present disclosure, the template file is generated from game logic obtained from the gaming side.
Specific details of each module/unit in the above-mentioned generating device of the user interface are already described in the corresponding method embodiment section, and will not be repeated here.
Fig. 10 shows a schematic diagram of a computer system suitable for use in implementing embodiments of the present disclosure.
It should be noted that, the computer system 1000 of the electronic device shown in fig. 10 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present disclosure.
As shown in fig. 10, the computer system 1000 includes a Central Processing Unit (CPU) 1001, which can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage section 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output portion 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk or the like; and a communication section 1009 including a network interface card such as a LAN card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The drive 1010 is also connected to the I/O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in the drive 1010, so that a computer program read out therefrom is installed as needed in the storage section 1008.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1009, and/or installed from the removable medium 1011. When executed by a Central Processing Unit (CPU) 1001, performs various functions defined in the system of the present disclosure.
It should be noted that the computer readable medium shown in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present disclosure also provides a computer-readable medium that may be contained in the electronic device described in the above embodiments; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to implement the method as described in the above embodiments.
It should be noted that although in the above detailed description several modules of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules described above may be embodied in one module in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module described above may be further divided into a plurality of modules to be embodied.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. A method for generating a user interface, comprising:
acquiring a UI design file of a user interface, and generating a corresponding UI design description file according to the UI design file;
according to template files respectively corresponding to various UI controls contained in the user interface, converting the UI design description file into an executable UI script code;
and sending the UI script code to a game terminal so that the game terminal executes the UI script code through game logic and generates a corresponding user interface.
2. The method for generating a user interface according to claim 1, wherein the converting the UI design description file into the executable UI script code according to the template files respectively corresponding to the various UI controls included in the user interface includes:
acquiring control types of all UI controls and UI information of all the UI controls through the UI design description file, wherein the UI information comprises independent UI information and general UI information;
determining a template file corresponding to the UI control according to the control type of the UI control, and obtaining a first control script code corresponding to the UI control according to the template file corresponding to the UI control and the independent UI information;
obtaining a second control script code corresponding to the UI control according to the universal template file and the universal UI information, and obtaining the UI control script code of the UI control according to the first control script code and the second control script code;
and obtaining the UI script codes of the user interface according to the UI control script codes of all the UI controls contained in the user interface.
3. The method of generating a user interface of claim 2, further comprising:
when one or more UI control script codes corresponding to the UI controls in the user interface have errors, correcting an original template file corresponding to the UI controls to obtain a corrected template file;
replacing the original template file corresponding to the UI control with the error with the corrected template file, and regenerating the UI script code of the user interface;
and sending the corrected UI script code to a game terminal so that the game terminal repairs the user interface in a hot update mode.
4. The method of generating a user interface of claim 2, further comprising:
and when a new UI control is added in the user interface, acquiring a template file to be added corresponding to the UI control to be added, and generating UI control script codes corresponding to the UI control to be added according to the template file to be added.
5. The method of generating a user interface of claim 2, further comprising:
classifying the UI controls contained in the user interface according to the control types of the UI controls, and generating UI control script codes corresponding to the UI controls with the same control types in a memory copy mode.
6. The method for generating a user interface according to claim 2, wherein the UI information includes texture resource information of the UI control, and the sending the UI script code to a game terminal, so that the game terminal executes the UI script code through game logic and generates a corresponding user interface, includes:
generating a texture resource list of the user interface according to texture resource information of all the UI controls contained in the user interface;
and sending the UI script code of the user interface and the texture resource list to a game terminal, so that the game terminal asynchronously loads all texture resources according to the texture resource list, and then executing the UI script code and generating a corresponding user interface through game logic.
7. The method of generating a user interface of claim 2, further comprising:
and nesting the interface codes converted in the game in the template files corresponding to the UI controls, so that the game terminal realizes the display of the user interfaces with multiple languages according to the interface codes converted in the template files when executing the UI script codes.
8. The method of claim 1, wherein the template file is generated based on game logic obtained from the game side.
9. A user interface generating apparatus, comprising:
the description file generation module is used for acquiring the UI design file of the user interface and generating a corresponding UI design description file according to the UI design file;
the script code generation module is used for converting the UI design description file into an executable UI script code according to template files respectively corresponding to various UI controls contained in the user interface;
and the script code sending module is used for sending the UI script code to a game terminal so that the game terminal executes the UI script code through game logic and generates a corresponding user interface.
10. An electronic device, comprising:
a processor; and
a memory for storing one or more programs that, when executed by the processor, cause the processor to implement the method of generating a user interface as claimed in any one of claims 1 to 8.
11. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a method of generating a user interface according to any of claims 1 to 8.
CN202310877622.1A 2023-07-17 2023-07-17 User interface generation method and device, electronic equipment and computer readable medium Pending CN116841550A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310877622.1A CN116841550A (en) 2023-07-17 2023-07-17 User interface generation method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310877622.1A CN116841550A (en) 2023-07-17 2023-07-17 User interface generation method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN116841550A true CN116841550A (en) 2023-10-03

Family

ID=88166955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310877622.1A Pending CN116841550A (en) 2023-07-17 2023-07-17 User interface generation method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN116841550A (en)

Similar Documents

Publication Publication Date Title
CN110825362B (en) Low-code application software development system and method
CN114115857B (en) Machine learning model automatic production line construction method and system
CN110376959B (en) Soft PLC configuration software generation system based on FPGA platform
US9442744B2 (en) Multilingual build integration for compiled applications
US8448132B2 (en) Systems and methods for modifying code generation templates
CN110149800B (en) Apparatus for processing abstract syntax tree associated with source code of source program
JPH08202545A (en) Object-oriented system and method for generation of target language code
CN107704382A (en) Towards Python function call path generating method and system
CN112416788A (en) Hierarchical standard Web application UI automatic test method
CN112000334A (en) Page development method, device, server and storage medium
CN114706616A (en) Applet construction method and device
US8935657B2 (en) Model-to-model transformation by kind
Schönberger et al. Algorithmic support for model transformation in object‐oriented software development
CN104063231A (en) Test resource rapid access method based on HIT-TENA
CN117075909A (en) Compiling method, electronic device and medium for realizing parallel programming
CN112269602A (en) WebAssembly loading method and device and storage medium
CN116841550A (en) User interface generation method and device, electronic equipment and computer readable medium
CN115964042A (en) Menu generation method and device, storage medium and electronic equipment
US9026985B2 (en) Dynamically configurable model-to-model transformation engine
CN114943795A (en) Model rendering method and device, electronic equipment and storage medium
CN114064218A (en) Mirror image generation method, system, medium and application for machine learning component
CN114115899A (en) Project development method and device, electronic equipment and storage medium
CN107918958B (en) Visualization and customizable three-dimensional rendering system and method
CN113688603B (en) Model file processing method and device, storage medium and electronic equipment
CN114077433B (en) Cross-platform modularized shader language universal integration 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