Method and device for creating graphic tool, computer equipment and storage medium
By creating an enumeration graphical tool within the graphical programming tool, the problem that the graphical tools in the toolbar could not meet personalized programming needs was solved, enabling flexible programming operations and an efficient programming process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-10-18
- Publication Date
- 2026-04-21
AI Technical Summary
In existing graphical programming tools, the graphical tools in the toolbar cannot meet personalized programming needs, resulting in high programming difficulty and low efficiency.
The graphical programming tool allows users to create multiple enumeration values of the same data type according to their actual needs. The toolbar and creation interface simplify the operation and provide a customizable enumeration graphical tool.
It meets personalized programming needs, reduces programming complexity, improves programming efficiency and readability, and enhances human-computer interaction efficiency.
Smart Images

Figure CN121900745A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for creating graphical tools. Background Technology
[0002] With the development of computer technology, graphical programming tools have emerged. These tools include a workspace and a toolbar. The toolbar displays graphical tools for users to use, which they can drag and drop into the workspace to create their own graphical representations for programming. By using graphical tools instead of traditional text, graphical programming tools are more intuitive and easier to understand, reducing the difficulty of programming.
[0003] However, the graphical tools displayed in the toolbar are usually general-purpose graphical tools created by technicians and cannot meet personalized programming needs. Summary of the Invention
[0004] This application provides a method, apparatus, computer device, and storage medium for creating graphical tools, which supports the creation of enumeration graphical tools within graphical programming tools. This allows for programming using enumeration graphical tools, meeting personalized programming needs, simplifying programming operations, and improving programming efficiency. The technical solution is as follows:
[0005] On the one hand, a method for creating a graphical tool is provided, the method comprising:
[0006] A graphical interface for displaying graphical programming tools, the graphical interface including a toolbar;
[0007] In response to a target creation operation, an enumeration graphical tool is created and displayed in the toolbar. The target creation operation is an operation that instructs the creation of the enumeration graphical tool, which includes multiple enumeration values belonging to the same data type.
[0008] The graphic tools in the toolbar are tools used to edit virtual elements in the virtual scene.
[0009] On the other hand, an apparatus for creating graphical tools is provided, the apparatus comprising:
[0010] The first display module is used to display the graphical interface of the graphical programming tool, and the graphical interface includes a toolbar;
[0011] Create a module to create an enumeration of graphical tools in response to a target creation operation;
[0012] The second display module is used to display the enumeration graphic tool in the toolbar. The target creation operation is an operation that indicates the creation of the enumeration graphic tool. The enumeration graphic tool includes multiple enumeration values belonging to the same data type.
[0013] The graphic tools in the toolbar are tools used to edit virtual elements in the virtual scene.
[0014] In one possible implementation, the toolbar displays enumerated category labels;
[0015] The creation module is configured to display a creation control in the toolbar in response to a trigger operation on the enumeration category label. The creation control is used to create an enumeration graphical tool. In response to a trigger operation on the creation control, the enumeration graphical tool is created.
[0016] In one possible implementation, the creation module includes:
[0017] The display unit is used to respond to the target creation operation by displaying the creation interface in the display area where the toolbar is located. The creation interface displays multiple data types.
[0018] A determining unit is configured to determine a target data type from the plurality of data types, and to determine a plurality of target enumeration values belonging to the target data type;
[0019] The first creation unit is used to create the enumeration graphics tool, which includes multiple target enumeration values belonging to the target data type.
[0020] In one possible implementation, the creation interface includes a type selection control for displaying the plurality of data types.
[0021] In one possible implementation, the determining unit is configured to display multiple enumeration value input boxes in the creation interface; and determine the enumeration value belonging to the target data type entered in each enumeration value input box as the target enumeration value.
[0022] In one possible implementation, each enumeration value input box displays a default enumeration value;
[0023] The determining unit is configured to, in response to an editing operation on an enumeration value displayed in any enumeration value input box, obtain the edited enumeration value; if the data type of the edited enumeration value is the same as the target data type, determine the edited enumeration value as the target enumeration value; if the data type of the edited enumeration value is different from the target data type, display a prompt message, the prompt message being used to prompt the input of an enumeration value belonging to the target data type; and determine the enumeration value belonging to the target data type obtained by further editing as the target enumeration value.
[0024] In one possible implementation, the first creation unit is configured to create the enumeration graphical tool in response to a closing operation of the creation interface.
[0025] In one possible implementation, the creation module further includes:
[0026] The second creation unit is used to create an enumeration object in response to the target creation operation, the enumeration object including an array of enumeration value objects;
[0027] The first creation unit is used to store the enumeration value objects corresponding to the plurality of target enumeration values in the enumeration value object array, wherein the enumeration value object includes the corresponding target enumeration value and the data type of the target enumeration value; and to create an enumeration graphical tool associated with the enumeration object.
[0028] In one possible implementation, the graphical interface further includes a workspace, and the device further includes:
[0029] The third display module is used to drag the enumeration graphic tool into the first graphic tool in the work area, and to display the first enumeration value among the plurality of enumeration values in the enumeration graphic tool, so that the first enumeration value is used as the input parameter of the function represented by the first graphic tool, and the first enumeration value is any one of the plurality of enumeration values.
[0030] In one possible implementation, the third display module is further configured to display multiple enumeration values in the enumeration graphical tool in response to an enumeration value switching operation; and to display the second enumeration value in the enumeration graphical tool in response to a selection operation of the second enumeration value, such that the second enumeration value serves as an input parameter of the function represented by the first graphical tool.
[0031] In one possible implementation, the third display module is configured to, in response to an enumeration value switching operation, query the enumeration object associated with the enumeration graphical tool, the enumeration object including an array of enumeration value objects; obtain multiple enumeration values from the array of enumeration value objects; and display the multiple enumeration values.
[0032] In one possible implementation, the device further includes:
[0033] The fourth display module is used to edit the virtual elements associated with the first graphics tool in the virtual scene during the process of running the function according to the input parameters; and to display the editing results of the virtual elements.
[0034] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to perform the operations performed by the method for creating the graphics tool as described above.
[0035] On the other hand, a computer-readable storage medium is provided that stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the method for creating the graphics tool as described above.
[0036] On the other hand, a computer program product is provided, including a computer program loaded and executed by a processor to perform the operations performed by the method for creating the graphics tool as described above.
[0037] The solution provided in this application supports the creation of custom enumeration graphical tools within graphical programming tools, thus offering a more flexible creation method. Users can easily and conveniently create enumeration graphical tools according to their actual programming needs, and then use these tools for programming. Therefore, this solution not only meets the personalized programming needs of technical personnel but also reduces programming complexity and improves programming efficiency. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0040] Figure 2 This is a flowchart illustrating a method for creating a graphical tool according to an embodiment of this application;
[0041] Figure 3 This is a schematic diagram of the graphical interface of a graphical programming tool provided in an embodiment of this application;
[0042] Figure 4 This is a flowchart of another method for creating a graphical tool provided in an embodiment of this application;
[0043] Figure 5 This is a flowchart of another method for creating a graphical tool provided in an embodiment of this application;
[0044] Figure 6 This is a schematic diagram of the graphical interface of another graphical programming tool provided in this application embodiment;
[0045] Figure 7 This is a schematic diagram of the graphical interface of another graphical programming tool provided in this application embodiment;
[0046] Figure 8 This is a flowchart of another method for creating a graphical tool provided in an embodiment of this application;
[0047] Figure 9 This is a flowchart of creating an enumeration object provided in an embodiment of this application;
[0048] Figure 10 This is a flowchart of another method for creating a graphical tool provided in an embodiment of this application;
[0049] Figure 11 This is a schematic diagram of the graphical interface of another graphical programming tool provided in this application embodiment;
[0050] Figure 12 This is a schematic diagram of the graphical interface of another graphical programming tool provided in this application embodiment;
[0051] Figure 13 This is a flowchart illustrating enumerated values provided in an embodiment of this application;
[0052] Figure 14 This is a flowchart of an editing method provided in an embodiment of this application;
[0053] Figure 15 This is a schematic diagram of the structure of a graphical tool creation device provided in an embodiment of this application;
[0054] Figure 16 This is a schematic diagram of the structure of another graphical tool creation device provided in an embodiment of this application;
[0055] Figure 17 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0056] Figure 18 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0058] It is understood that the terms "first," "second," etc., used in this application may be used to describe various concepts herein, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, a first enumeration value may be referred to as a second enumeration value, and similarly, a second enumeration value may be referred to as a first enumeration value.
[0059] Here, "at least two" means two or more. For example, "at least two enumeration values" can be any integer number of enumeration values greater than or equal to two, such as two enumeration values, three enumeration values, etc. "Each" means each of the at least two enumeration values. For example, "each enumeration value" means each of the at least two enumeration values. If the at least two enumeration values are three enumeration values, then "each enumeration value" means each of the three enumeration values.
[0060] It should be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals (including but not limited to signals transmitted between user terminals and other devices) involved in this application have all been fully authorized by the user or relevant parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0061] The method provided in this application embodiment is used in a computer device. Optionally, the computer device is a terminal or a server. Optionally, the terminal is a smartphone, computer, laptop, desktop computer, etc., but is not limited to these. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0062] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. See also... Figure 1 The implementation environment includes: terminal 101 and server 102, which are connected via a wired or wireless network.
[0063] Terminal 101 has a graphical programming tool 111 installed and running, and users of terminal 101 can use the graphical programming tool 111 to program. These users can be users or developers of the graphical programming tool 111. For example, after the graphical programming tool 111 is developed, it will be released, and ordinary users can download the graphical programming tool 111 to terminal 101 and use it for programming. Alternatively, developers may also download the graphical programming tool 111 to terminal 101 during the development process to understand its features, or to edit or update it.
[0064] Optionally, terminal 101 may refer to one of a number of terminals, including but not limited to: smartphones, computers, laptops, desktop computers, etc.
[0065] Those skilled in the art will understand that the number of terminals described above can be more or less. For example, there may be only one terminal, or there may be six, eight, or more terminals. This application does not limit the number of terminals or the type of device.
[0066] Optionally, server 102 may include at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Server 102 is used to host backend services, including functions such as user account management, graphical tool management, and programming project management. This application embodiment does not limit the functions of server 102.
[0067] Optionally, server 102 undertakes the main computing work and terminal 101 undertakes the secondary computing work; or, server 102 undertakes the secondary computing work and terminal 101 undertakes the main computing work; or, server 102 and terminal 101 use a distributed computing architecture for collaborative computing.
[0068] In this embodiment, the graphical programming tool 111 provides various graphical tools, which users can use for programming. The terminal 101 displays the graphical interface of the graphical programming tool 111, allowing users to create programming projects and arrange the graphical tools for the current project in the workspace to create applications. Furthermore, to meet users' personalized programming needs, users can also create personalized graphical tools, such as enumeration tools and function tools, using the graphical programming tool 111. The terminal 101 can display the user-created graphical tools in the graphical interface of the graphical programming tool 111, enabling users to program using these tools.
[0069] In addition, the graphical tools in the graphical programming tool 111 are tools for editing virtual elements in a virtual scene. Users can use the graphical programming tool 111 to create applications for editing virtual elements. During the programming process, users can also edit the selected virtual elements based on the graphical tools in the workspace, thereby previewing and displaying the editing effect of the virtual elements.
[0070] It should be noted that the above implementation environment is only an example. The method provided in this application embodiment can also be executed by the terminal 101 alone, or in other implementation environments. This application embodiment does not limit this.
[0071] Figure 2 This is a flowchart illustrating a method for creating a graphical tool according to an embodiment of this application, which is executed by a computer device. See also... Figure 2 The method includes:
[0072] 201. The computer equipment displays the graphical interface of the graphical programming tool, which includes a toolbar.
[0073] The graphical programming tool used for programming can be of various types, and this application embodiment does not limit the type of graphical programming tool. For example, the graphical programming tool is a UGC (User Generated Content) editor. A UGC editor can provide a graphical interface, graphical tools, and other easy-to-use tools and functions, enabling people without professional programming experience to use the UGC editor for graphical programming, thus enabling visual programming based on the UGC editor. Alternatively, the UGC editor can be an editor provided by a game application, allowing players to easily and conveniently edit and generate personalized game scenes based on the visual programming functions provided by the UGC editor. For example, players can use the UGC editor to create game maps and control game characters within those maps.
[0074] The graphical interface of a graphical programming tool includes a toolbar containing multiple graphical tools. These tools are the basic units for programming, each representing a programming concept or operation, such as variable assignment, loop control, function calls, and conditional judgments. This embodiment does not limit the specific graphical tools used. Users can construct applications by combining these tools, thus achieving programming. Furthermore, each graphical tool has its own graphic, including shape and color. Different tools have different graphics, allowing for a clear distinction between tools used for different functions. Compared to numerical or alphabetic programming languages, graphical tools offer better visual presentation and are more helpful for users. For example, graphical tools can be like building blocks. Different shapes or colors of blocks represent different programming concepts or operations. Blocks can be regular shapes such as circles, squares, and triangles, or they can be irregular shapes. Offering irregularly shaped blocks encourages users to build with these blocks while programming, enhancing the fun and engagement.
[0075] For example, graphical tools are like building blocks; they provide building blocks within a graphical programming tool for users to use when programming. They support converting dragged-and-drop blocks into different programming languages and are generally used to support graphical and visual programming. Building blocks are the basic units for programming in graphical programming tools. They have unique shapes and colors, allowing users to easily identify and combine them. Users can build programs and achieve various functions by combining different building blocks. The building block toolbar is a component of the graphical programming tool that contains all available building blocks, organized according to different categories. Users can drag and drop the required building blocks from the building block toolbar into the workspace for programming. The building block toolbar can be customized according to actual needs, displaying specific sets of building blocks.
[0076] Furthermore, in this embodiment of the application, the multiple graphical tools in the toolbar of the graphical programming tool are tools for editing virtual elements in the virtual scene. Thus, in the graphical programming tool, the graphical tools can be used to edit the virtual elements in the virtual scene, and the application created using the graphical tools is the application used to edit the virtual scene.
[0077] 202. In response to the target creation operation, the computer device creates an enumeration graphical tool and displays the enumeration graphical tool in the toolbar.
[0078] The target creation operation is the operation that instructs the creation of an enumeration graphical tool. The enumeration graphical tool is used to represent an enumeration. In computer programming, an enumeration is a data type that contains a finite set of enumerated values. Enumerations can be used to represent a fixed, finite set of states. For example, when creating a game map using a graphical programming tool provided by a game application, enumerations can be used to define the different states of game characters on the game map, such as standing, walking, running, jumping, etc. Alternatively, enumerations can be used to define the different colors of game items on the game map, such as red, blue, green, etc.
[0079] Enumerations have corresponding data categories, therefore, multiple enumeration values within an enumeration belong to the same data type. Data types include, but are not limited to: strings, booleans, numbers, vectors, and custom types. Optionally, custom types can be types set according to project development needs, such as player types, virtual scene types, etc. Player type enumeration values are used to represent players, such as "player11111" and "player22222". Virtual scene type enumeration values are used to represent virtual scenes, such as "desert" and "grassland".
[0080] In this embodiment, a computer device creates an enumeration graphical tool based on multiple enumeration values of the same type. The enumeration graphical tool includes multiple enumeration values of the same type. The multiple enumeration values and their data types in the enumeration graphical tool can be input by the user into the computer device. Alternatively, the multiple enumeration values in the enumeration graphical tool can be automatically generated by the computer device based on the data types input by the user; this embodiment does not impose any limitations on this. Then, the computer device displays the enumeration graphical tool in the toolbar of a graphical programming tool for the user to use for programming.
[0081] Figure 3 This is a schematic diagram of the graphical interface of a graphical programming tool provided in an embodiment of this application. See also... Figure 3 The graphical interface of the graphical programming tool includes a workspace 301 and a toolbar 302. Workspace 301 is used for programming, while toolbar 302 displays a search control, a first-level menu, second-level menus under the first-level menu, and graphical tools under the second-level menus. Both the first-level and second-level menus include multiple category labels. After the computer device creates an enumeration graphical tool, the newly created enumeration graphical tool is displayed under the enumeration category label "Enumeration". See also... Figure 3 The user drags the enumeration graphic tool "Enumeration 2" from toolbar 302 to workspace 301, thus displaying the enumeration graphic tool in workspace 301. The user can then use the enumeration graphic tool for programming in workspace 301.
[0082] In this embodiment, by supporting the creation of custom enumeration graphical tools within a graphical programming tool, a more flexible creation method is provided. Users can easily and conveniently create enumeration graphical tools according to their actual programming needs, and then directly use these tools for programming. Therefore, this solution not only meets the personalized programming needs of technical personnel but also reduces programming complexity and improves programming efficiency.
[0083] Furthermore, since enumeration graphical tools include multiple enumeration values belonging to the same data type, programming with them allows for a clear and intuitive representation of the enumeration values and their data types. Users don't need to use magic numbers or strings to represent enumeration values, thus improving the readability and maintainability of graphical programming languages. Magic numbers, on the other hand, refer to numerical constants that appear directly in programming languages without a clear meaning. They typically lack explicit explanations or comments to clarify their purpose, making it difficult for readers to intuitively understand their meaning and function, consequently leading to poor readability and maintainability of the programming language.
[0084] Based on the above embodiments, the target creation operation can be an operation of creating a graphical tool under an enumeration category label. The process of creating an enumeration graphical tool using a computer device will be described below through the following embodiments.
[0085] Figure 4 This is a flowchart illustrating another method for creating a graphical tool according to an embodiment of this application, which is executed by a computer device. See also... Figure 4 The method includes:
[0086] 401. The computer equipment displays a graphical interface for a graphical programming tool. The graphical interface includes a toolbar, which displays enumeration category labels.
[0087] In this embodiment of the application, the step of displaying a graphical interface on a computer device is the same as step 201 described above, and will not be repeated here.
[0088] Additionally, it should be noted that when a toolbar displays a top-level menu, this menu typically includes multiple category labels. An enumeration category label can be one of the category labels within the top-level menu. Similarly, if a top-level menu includes second-level menus, an enumeration category label can also be one of the category labels within those second-level menus. Different category labels contain different categories of graphical tools. For example, the graphical tools under the enumeration category label are enumeration graphical tools, meaning they represent the enumeration itself.
[0089] Optionally, when the enumeration category label is located in a secondary menu, the computer device first displays a toolbar including a primary menu. In response to a triggering operation on a primary category label to which the enumeration category label belongs in the primary menu, the computer device then displays a secondary menu, which includes at least one category label that includes the enumeration category label. For example, see the above. Figure 3 The enumeration category is labeled "Enumeration," which is located in the second-level menu. The first-level category to which the "Enumeration" label belongs is labeled "Custom," which is also located in the first-level menu.
[0090] 402. In response to a triggering operation on an enumerated category label, the computer device displays a creation control in the toolbar.
[0091] The creation control is used to create enumeration graphical tools. For example, see the above. Figure 3 The toolbar displays the "Create Control 303" option, which in turn displays the text "Create Enumeration".
[0092] In one possible implementation, in response to a triggering operation on an enumeration category label, the computer device obtains the configuration information of the currently logged-in target account. This configuration information indicates the graphical tools allowed to be displayed by the target account. If the allowed graphical tools include an already created enumeration graphical tool, the computer device displays a creation control and the created enumeration graphical tool in the toolbar. If the allowed graphical tools do not include an enumeration graphical tool, the computer device displays a creation control and a prompt text in the toolbar, indicating that no enumeration graphical tool is currently available, but it can be created using the "Create Control" function.
[0093] 403. The computer device responds to the trigger operation of creating the control and creates an enumeration graphical tool.
[0094] In this embodiment, in response to a triggering operation to create a control, the computer device creates an enumeration graphical tool based on multiple enumeration values of the same type. The steps for the computer device to create the enumeration graphical tool are the same as step 202 described above, and will not be repeated here.
[0095] 404. The computer device displays the enumeration graphic tool in the toolbar.
[0096] In this embodiment of the application, the computer device displays a newly created enumeration graphical tool in the toolbar so that the user can use the enumeration graphical tool for programming.
[0097] Optionally, this enumeration graphical tool is displayed under the Enumeration category tab in the toolbar. For example, see the above. Figure 3After creating the enumeration graphical tool by creating control 303, the computer device can display the newly created enumeration graphical tool below "Enumeration 3".
[0098] This application embodiment displays enumeration category labels in the toolbar of a graphical programming tool, and displays a creation control when the enumeration category labels are triggered. Users can quickly create enumeration graphical tools by triggering the creation control, simplifying the creation process, improving the efficiency of creating enumeration graphical tools, and thus improving programming efficiency.
[0099] In addition, by displaying enumeration category labels and creation controls, it is not only clear and intuitive to convey that the graphical programming tool supports enumeration graphical tools, thus prompting users to find enumeration graphical tools by triggering the enumeration category labels, but also makes it easy for users to quickly create enumeration graphical tools by creating controls. This provides a clear and intuitive guide for users to create enumeration graphical tools, simplifies the operation of creating enumeration graphical tools, and improves human-computer interaction efficiency.
[0100] The above embodiments mainly describe the process of creating an enumeration graphical tool by a computer device through the creation of controls. Based on the above embodiments, the following embodiments will provide a detailed description of the process of creating an enumeration graphical tool by a computer device.
[0101] Figure 5 This is a flowchart illustrating another method for creating a graphical tool according to an embodiment of this application, which is executed by a computer device. See also... Figure 5 The method includes:
[0102] 501. The computer equipment displays a graphical interface for a graphical programming tool, which includes a toolbar.
[0103] Step 501 is the same as step 401 above, and will not be repeated here.
[0104] 502. In response to the target creation operation, the computer device displays the creation interface in the display area where the toolbar is located. The creation interface displays multiple data types.
[0105] The target creation operation in this embodiment is the same as described above. Figure 4 The target creation operation in the illustrated embodiment is similar and will not be described again here. For example, the target creation operation can be a trigger operation for creating controls under enumerated category labels.
[0106] The creation interface is used to create enumeration graphical tools. Since users typically do not need to view the graphical tools in the toolbar during the creation process, the computer device can display the creation interface in the same display area as the toolbar, thus saving display space. Optionally, the computer device can display the creation interface floating above the toolbar. Alternatively, the computer device can display the creation interface in any area of the graphical interface; this embodiment does not limit this.
[0107] Because the enumeration graphics tool includes multiple enumeration values belonging to the same data type, the creation interface will display multiple data types for the user to choose from. These data types include, but are not limited to: strings, booleans, vectors, numbers, and custom types. For example, string enumeration values can represent different colors of game items, such as Red, Green, and Blue. Boolean enumeration values can represent the open / closed state of game levels, such as True indicating an open level and False indicating a closed level. Vector enumeration values can represent the movement direction of the game character, such as vector (0, 1) indicating upward movement and vector (0, -1) indicating downward movement.
[0108] 503. Computer devices determine the target data type from multiple data types.
[0109] In this embodiment of the application, in response to the selection operation of any data type, the computer device determines that the selected data type is the target data type, and then the enumerated graphics tool subsequently created includes multiple enumerated values belonging to the target data type.
[0110] Optionally, the creation interface also includes a type selection control, which displays multiple data types for the user to choose from. For example, the type selection control is a dropdown control, and the dropdown control currently displays a default data type. In response to a trigger operation on the dropdown control, the computer device displays multiple data types in the type selection control for the user to select the target data type from. By displaying a type selection control in the creation interface, multiple selectable data types can be provided, thus offering a rich variety of enumerated values, facilitating user selection, improving flexibility, and meeting the personalized programming needs of different fields as much as possible, enriching the application scenarios of the embodiments of this application. Furthermore, the type selection control also allows for simple and convenient selection of the target data type, improving human-computer interaction efficiency.
[0111] 504. The computer device determines multiple target enumeration values that belong to the target data type.
[0112] In this embodiment, after determining the target data type, the computer device obtains multiple target enumeration values belonging to the target data type based on the creation interface. In other words, after determining the target data type, the creation interface is also used to obtain target enumeration values belonging to the target data type, thereby ensuring that the enumeration values in the enumeration graphical tool are all of the target data type. This avoids programming errors caused by data type errors, helps improve programming accuracy, and reduces the time required for debugging and fixing errors.
[0113] The process of determining the target enumeration value by computer equipment is explained below.
[0114] In one possible implementation, the computer device obtains the target enumeration value through enumeration value input boxes. Accordingly, the computer device displays multiple enumeration value input boxes in the creation interface. These input boxes can be text boxes for entering enumeration values. The computer device determines the enumeration value belonging to the target data type entered in each input box as the target enumeration value, thus obtaining multiple target enumeration values. By displaying enumeration value input boxes in the creation interface, users can easily enter custom enumeration values directly, which not only standardizes the way enumeration values are entered but also simplifies the operation, improving human-computer interaction efficiency.
[0115] Optionally, each enumeration value input box displays a default enumeration value. The default enumeration value can be generated by the computer device based on the target data type. For example, if the target data type is string, the multiple enumeration value input boxes in the creation interface will sequentially display the default enumeration values String1, String2, String3, etc.
[0116] In response to an edit operation on an enumeration value displayed in any enumeration value input box, the computer device acquires the edited enumeration value and determines its data type. If the data type of the edited enumeration value is the same as the target data type, the computer device displays the edited enumeration value in the input box and designates it as the target enumeration value. If the data type of the edited enumeration value is different from the target data type, the computer device displays a prompt message. This prompt message suggests entering an enumeration value belonging to the target data type. Then, the computer device acquires the enumeration value obtained from further editing. If this enumeration value belongs to the target data type, the computer device displays it in the input box and designates it as the target enumeration value.
[0117] By displaying default enumeration values in the enumeration value input box, the format of enumeration values belonging to the target data type can be intuitively represented, guiding users and thus standardizing the format of user-inputted enumeration values to a certain extent. Furthermore, by supporting the editing of the default enumeration values displayed in the enumeration value input box, users can easily set their own enumeration values, thereby meeting their personalized programming needs.
[0118] It should be noted that the above embodiments do not limit the display method of the multiple enumeration value input boxes. In one possible implementation, in response to the selection operation of the target data type, the computer device generates a preset number of default enumeration values based on the target data type, and displays the preset number of enumeration value input boxes on the creation interface, with each enumeration value input box displaying one default enumeration value. The preset number can be a preset numerical value, such as 3, 4, or 5, and this application embodiment does not impose any limitation on this.
[0119] In one possible implementation, the creation interface also displays an add control for adding enumeration value input boxes to the creation interface. Before the target data type is determined, the computer device displays the add control in a non-triggerable state on the creation interface. After the target data type is determined, the computer device displays the add control in a triggerable state. In response to triggering the add control, the computer device displays the added enumeration value input box on the creation interface. Optionally, the added enumeration value input box displays a default enumeration value belonging to the target data type. Optionally, the creation interface also displays a delete control corresponding to each enumeration value input box. The delete control is used to delete the enumeration value input box and the enumeration value displayed in the enumeration value input box, thereby ensuring that the deleted enumeration value is not included in the subsequently created enumeration graphical tool.
[0120] Figure 6 This is a schematic diagram of the graphical interface of another graphical programming tool provided in this application embodiment. See also... Figure 6 The creation interface 601 is located in the right half of the graphical interface. The creation interface 601 displays the enumeration name "Enumeration N," which is the name of the subsequently created enumeration graphical tool. The enumeration name can be generated by the computer device. Optionally, the computer device generates the enumeration name based on the number of enumeration graphical tools already created. For example, if the computer device has created N-1 enumeration graphical tools, then in response to the target creation operation, the computer device generates the enumeration name "Enumeration N" and displays this enumeration name in the creation interface, where N is an integer greater than 1.
[0121] See also Figure 6The creation interface 601 also displays a type selection control 602, which is a drop-down control displaying the target data type "string". In response to a trigger operation on the drop-down control, the computer device displays multiple data types in the drop-down control for the user to select. The creation interface 601 also displays an add control 603. Optionally, before the target data type is determined, the creation interface does not include an enumeration value input box; after the target data type is determined, in response to a trigger operation on the add control 603, the computer device displays the first added enumeration value input box on the creation interface, which displays the default enumeration value belonging to the target data type. In response to a further trigger operation on the add control 603, the computer device displays the second added enumeration value input box on the creation interface, and so on. Figure 6 In the creation interface shown, area 604 displays three enumeration value input boxes added by the user. By editing any one of the enumeration value input boxes, the displayed enumeration value can be edited. For each enumeration value input box, the target data type is displayed on the left, and the corresponding delete control is displayed on the right, allowing users to easily delete the corresponding enumeration value input box in the creation interface according to their actual needs.
[0122] 505. Computer devices create enumeration graphical tools, which include multiple target enumeration values belonging to the target data type.
[0123] In this embodiment, the computer device determines multiple target enumeration values belonging to a target data type, and can then create an enumeration graphical tool including these multiple target enumeration values. This embodiment does not limit the timing of the computer device creating the enumeration graphical tool. Optionally, the computer device creates the enumeration graphical tool in response to a closing operation of the creation interface. See above. Figure 6 The graphical interface also displays a close control 605 for the creation interface. In response to the triggering of the close control 605, the computer device closes the creation interface and creates the enumeration graphical tool. By automatically creating the enumeration graphical tool when closing the creation interface, no additional creation operation is required from the user, shortening the interaction chain for creating the enumeration graphical tool and improving human-computer interaction efficiency.
[0124] Furthermore, in response to the closing operation of the creation interface, the computer device can also display the original toolbar in the graphical interface, thereby performing step 506 below, displaying the created enumeration graphical tool in the toolbar.
[0125] 506. The computer device displays the enumeration graphic tool in the toolbar.
[0126] In this embodiment of the application, the computer device displays a newly created enumeration graphical tool in the toolbar. For example, Figure 7This is a schematic diagram of the graphical interface of another graphical programming tool provided in this application embodiment. See also... Figure 7 The computer device can display the newly created enumeration graphic tool "Enumeration 4" below the enumeration graphic tool "Enumeration 3" in the toolbar, so that the user can drag and drop the enumeration graphic tool "Enumeration 4" into the workspace, and then use the enumeration graphic tool for programming in the workspace.
[0127] This application embodiment displays a creation interface within the graphical interface of a graphical programming tool. Through this interface, multiple target enumeration values belonging to the target data type, necessary for creating an enumeration graphical tool, are obtained. The enumeration graphical tool is then created based on these obtained values. Therefore, users can select the target data type and define custom target enumeration values within that data type in the creation interface according to their actual programming needs, and then quickly create a custom enumeration graphical tool using a computer device, thus improving the efficiency of creating enumeration graphical tools.
[0128] In addition, since other graphical tools are usually not used during the creation of the enumeration graphical tool, displaying the creation interface in the toolbar area of the graphical interface can save some display space without affecting the creation of the enumeration graphical tool.
[0129] In addition, by programming with this enumeration graphical tool, users can use custom target enumeration values in their programming. This not only meets users' personalized programming needs but also prevents them from using magic numbers or uncommented strings to replace target enumeration values, thus improving the readability and maintainability of the programming language.
[0130] Furthermore, by displaying a type selection control on the creation interface, multiple selectable data types can be provided, thus offering a rich variety of enumeration values. This facilitates user selection, enhances flexibility, and can meet the personalized programming needs of different fields as much as possible, enriching the application scenarios of the embodiments of this application. Moreover, the type selection control also allows for simple and convenient selection of the target data type, improving human-computer interaction efficiency.
[0131] Furthermore, displaying an enumeration value input box in the creation interface allows users to directly enter custom enumeration values, standardizing the input method and simplifying the process, thus improving human-computer interaction efficiency. Displaying default enumeration values in the input box visually represents the format of enumeration values belonging to the target data type, thereby standardizing the format of input enumeration values to some extent. Moreover, supporting the editing of the default enumeration values displayed in the input box allows users to easily set their own enumeration values, meeting their personalized programming needs.
[0132] In addition, when the computer device obtains the target enumeration value based on the creation interface, the enumeration graphical tool is automatically created when the creation interface is closed, eliminating the need for users to perform additional creation operations. This shortens the interaction chain for creating the enumeration graphical tool and improves human-computer interaction efficiency.
[0133] Based on the above embodiments, the process of creating an enumeration graphical tool will be described in detail below through the following embodiments.
[0134] Figure 8 This is a flowchart illustrating another method for creating a graphical tool according to an embodiment of this application, which is executed by a computer device. See also... Figure 8 The method includes:
[0135] 801. The computer equipment displays a graphical interface for a graphical programming tool, which includes a toolbar.
[0136] Step 801 is the same as step 401 above, and will not be repeated here.
[0137] 802. In response to the target creation operation, the computer device creates an enumeration object and displays the creation interface in the display area where the toolbar is located. The enumeration object includes an array of enumeration value objects.
[0138] The target creation operation in this embodiment is the same as described above. Figure 5 The target creation operation in the illustrated embodiment is similar and will not be repeated here. An enumeration object refers to an entity obtained by instantiating an enumeration structure. Here, a structure, as a data type, is typically used to define a group of related data items. The data items defined by an enumeration structure include, but are not limited to: enumeration ID (Identity Document), enumeration name, and array of enumeration value objects. Through the enumeration value structure, an enumeration object can be uniquely identified.
[0139] The array of enumeration value objects described above is used to store the enumeration value objects corresponding to multiple enumeration values in the enumeration. Similar to enumeration objects, enumeration value objects are entities obtained by instantiating an enumeration value structure. The data items defined in the enumeration value structure include, but are not limited to: enumeration value ID, enumeration value, and the data type of the enumeration value.
[0140] In this embodiment, in response to a target creation operation, the computer device generates an enumeration ID and an enumeration name. The enumeration ID is the ID of the enumeration represented by the subsequently created enumeration graphical tool, and the enumeration name is the name of that enumeration. Optionally, the computer device randomly generates a fixed-length enumeration ID, ensuring that this enumeration ID is different from all previously generated enumeration IDs, thereby ensuring that the enumeration ID can uniquely identify an enumeration. Optionally, the computer device generates an enumeration name based on the number of enumeration graphical tools already created, ensuring that this enumeration name is different from all previously generated enumeration names. For example, if the computer device has created N-1 enumeration graphical tools, in response to the target creation operation, the computer device generates an enumeration name of "Enumeration N", where N is an integer greater than 1. Generating enumeration names by incrementing numbers not only ensures that the generated enumeration names are not duplicated, but also visually reflects the number of enumeration graphical tools already created through the enumeration name, increasing the amount of information contained in the enumeration name.
[0141] Optionally, in response to the target creation operation, the computer device creates an array of enumeration value objects to store the enumeration value objects. Initially, this array of enumeration value objects is empty.
[0142] Then, the computer device instantiates the enumeration object according to the enumeration ID, enumeration name, and array of enumeration value objects, based on the enumeration structure. This enumeration object includes the enumeration ID, enumeration name, and array of enumeration value objects.
[0143] Optionally, after creating an enumeration object, the computer device stores the enumeration object in an enumeration object array. The enumeration object data is used to store multiple enumeration objects created by the computer device. By storing enumeration objects in an enumeration object array, multiple created enumeration objects can be maintained uniformly through the array, which facilitates subsequent quick searching, deletion, and modification of the enumeration values contained in an enumeration object within the array, thus improving data processing efficiency.
[0144] 803. Based on the creation interface, the computer device determines the target data type and multiple target enumeration values belonging to the target data type.
[0145] In this embodiment, the process by which the computer device determines the target data type is the same as step 503 described above, and will not be repeated here. The process by which the computer device determines multiple target enumeration values belonging to the target data type is the same as step 504 described above, and will not be repeated here.
[0146] Additionally, it should be noted that when the data items defined in the enumeration value structure include enumeration value IDs, after determining any target enumeration value, the computer device randomly generates the enumeration value ID for that target enumeration value, and ensures that the enumeration value ID is different from all the enumeration value IDs that have been generated, thereby ensuring that the enumeration value ID can uniquely identify a target enumeration value.
[0147] 804. Computer devices store enumeration value objects corresponding to multiple target enumeration values in an array of enumeration value objects. Each enumeration value object includes the corresponding target enumeration value and the data type of the target enumeration value.
[0148] In this embodiment, after determining multiple target enumeration values, the computer device creates an enumeration value object corresponding to each target enumeration value, resulting in multiple enumeration value objects. Optionally, for any target enumeration value, the computer device instantiates an enumeration value object according to an enumeration value structure based on the target enumeration value, the enumeration value ID of the target enumeration value, and the target data type. Then, the computer device stores the multiple enumeration value objects into an enumeration value object array. Optionally, the computer device queries the enumeration object array based on the enumeration ID, and then stores the multiple enumeration values into the enumeration value object array included in the enumeration object.
[0149] To more clearly illustrate the process of creating an enumeration object, the following will combine... Figure 9 The flowchart shown illustrates the process of creating an enumeration object. See also... Figure 9 In response to a target creation operation, the computer device generates unique enumeration IDs and unique enumeration names sequentially while displaying the creation interface. Then, the computer device creates enumeration objects and stores them in an enumeration object array. Each enumeration object includes an enumeration ID, an enumeration name, and an array of enumeration value objects. Next, based on the creation interface, the computer device determines the target data type selected by the user and the target enumeration value that the user inputs belonging to the target data type. If the creation interface is not closed, it indicates that the user may continue to add enumeration values; if the creation interface is closed, it indicates that the user will not continue to add enumeration values. Therefore, in response to closing the creation interface, the computer device adds the enumeration value object corresponding to the target enumeration value to the enumeration value object array, thus enabling the subsequent creation of an enumeration graphical tool based on the enumeration object containing the target enumeration value.
[0150] 805. A computer device creates an enumeration graphical tool associated with an enumeration object, the enumeration graphical tool including multiple target enumeration values belonging to the target data type.
[0151] In this embodiment of the application, the computer device creates an enumeration graphical tool associated with an enumeration object. The enumeration graphical tool is used to represent the enumeration defined by the enumeration object.
[0152] For example, an enumeration graphics tool might be an SVG (Scalable Vector Graphics) tool. SVG is a vector graphics format based on XML (Extensible Markup Language), characterized by its ability to be infinitely scaled without distortion. The computer device creates an SVG image containing the enumeration names from the enumeration objects, thus displaying the enumeration names in the image. The computer device then associates this image with the enumeration objects.
[0153] Optionally, the computer device maintains the association between enumeration graphical tools and enumeration objects through a mapping table. After creating an enumeration graphical tool, the computer device adds the association between the enumeration graphical tool and the corresponding enumeration object in the mapping table. Accordingly, during programming using an enumeration graphical tool, in response to the operation of dragging any enumeration graphical tool into the workspace, the computer device queries the mapping table for the enumeration object associated with that enumeration graphical tool, thereby facilitating subsequent programming based on that enumeration object.
[0154] 806. The computer device displays the enumeration graphic tool in the toolbar.
[0155] Step 806 is the same as step 506 above, and will not be repeated here.
[0156] This application embodiment implements the creation of an enumeration graphical tool associated with an enumeration object. Users can define multiple target enumeration values belonging to the target data type. The computer device can automatically create the enumeration object and the enumeration graphical tool associated with the enumeration object based on the user input data. Users do not need to write code to create the enumeration object or the enumeration graphical tool. Even beginners or programming novices can easily and conveniently create and use the enumeration graphical tool, simplifying the user's programming operations and improving programming efficiency.
[0157] In addition, by creating enumeration objects, not only can an enumeration be uniquely represented by an enumeration object, but the enumeration values in the enumeration can also be maintained by the array of enumeration value objects included in the enumeration object. Thus, computer devices can easily and efficiently update the enumeration values in the enumeration by updating the array of enumeration value objects, thereby improving data processing efficiency.
[0158] It should be noted that, in one possible implementation, the backend server of the graphical programming tool has configuration information that represents multiple graphical tools displayed in the tool. Upon successful creation of any graphical tool, the computer device sends the currently logged-in target account and the graphical tool to the backend server. The backend server then adds the graphical tool to the configuration information associated with the target account. This configuration information will then include the newly created graphical tool (as described above when enumerating graphical tools). Subsequently, the graphical tools included in this configuration information can be displayed in the graphical programming tool, thus enabling the display of personalized graphical tools in the toolbar for each target account, allowing users to program using these personalized tools.
[0159] The above embodiments primarily describe the process of creating an enumeration graphical tool using a computer device. In some embodiments, the created enumeration graphical tool can be used for programming within a graphical programming tool. The process of programming using an enumeration graphical tool is described below through the following embodiments.
[0160] Figure 10 This is a flowchart illustrating another method for creating a graphical tool according to an embodiment of this application, which is executed by a computer device. See also... Figure 10 The method includes:
[0161] 1001. The computer equipment displays a graphical interface for a graphical programming tool, which includes a toolbar and a workspace.
[0162] 1002. In response to the target creation operation, create an enumeration graphical tool and display it in the toolbar. The enumeration graphical tool includes multiple enumeration values belonging to the same data type.
[0163] Steps 1001-1002 are the same as steps 201-202 above, and will not be repeated here.
[0164] Additionally, it's worth noting that the graphical interface of a graphical programming tool also includes a workspace. The workspace is the area where the user programs; by placing, editing, and combining graphical tools within it, applications can be created. The workspace and toolbar are located in different areas of the graphical interface, but new graphical tools can be created in the workspace by dragging and dropping graphical tools from the toolbar to the workspace.
[0165] 1003. The computer device drags the enumeration graphics tool into the first graphics tool in the work area, and displays the first enumeration value among the multiple enumeration values in the enumeration graphics tool, so that the first enumeration value is used as the input parameter of the function represented by the first graphics tool.
[0166] One or more graphical tools can be displayed in the workspace. This embodiment of the application uses the display of a first graphical tool in the workspace as an example, where the first graphical tool is any one of the graphical tools displayed in the workspace, used to implement any function. For example, the first graphical tool may represent a function, and the function implemented by the first graphical tool is to call the function to perform that function.
[0167] When the first graphics tool is used to represent a function, if an enumeration value from the enumeration graphics tool is needed as an input parameter for that function, the enumeration graphics tool can be dragged from the toolbar to the first graphics tool in the workspace, thus grouping the graphics tools in the workspace. After the enumeration graphics tool is dragged to the first graphics tool, it displays the first enumeration value among multiple enumeration values, indicating that the current first enumeration value is the input parameter for the aforementioned function. The first enumeration value can be any of the multiple enumeration values. Optionally, the enumeration graphics tool also displays an enumeration name.
[0168] Furthermore, for any graphic tool in the toolbar, after dragging the graphic tool from the toolbar to the workspace, the graphic tool will remain displayed in the toolbar. This allows you to continue dragging the same graphic tool from the toolbar to the workspace, so that you can use the same graphic tool multiple times.
[0169] In addition to the drag-and-drop operation described above, when the first graphic tool is selected in the workspace, the computer device can also display the enumeration graphic tool within the first graphic tool in response to a trigger operation on the enumeration graphic tool in the toolbar. This application embodiment does not limit the operation of creating a new enumeration graphic tool in the workspace.
[0170] Figure 11 This is a schematic diagram of the graphical interface of another graphical programming tool provided in this application embodiment. See also... Figure 11 After dragging the enumeration graphic tool 1101 into the first graphic tool 1102 in the workspace, the enumeration graphic tool 1101 displays the enumeration name 1103 and the first enumeration value 1104. The first enumeration value is also the input parameter of the function represented by the first graphic tool 1102.
[0171] Additionally, it should be noted that when the input parameter of the function in the first graphics tool is an actual parameter, it means that the input parameter needs to be a definite value when the function is called. Therefore, after the enumeration graphics tool is dragged into the first graphics tool, it will display the first enumeration value among multiple enumeration values; this first enumeration value is the actual parameter. When the input parameter of the function in the first graphics tool is a formal parameter, it means that the input parameter does not need to be a definite value when the function is called. Therefore, after the enumeration graphics tool is dragged into the first graphics tool, it does not need to display the first enumeration value; displaying the enumeration name is sufficient.
[0172] In one possible implementation, the user can also adjust the enumeration values displayed in the enumeration graphical tool within the workspace. In response to an enumeration value toggling operation, the computer device displays multiple enumeration values in the enumeration graphical tool. The enumeration value toggling operation is used to switch the enumeration values displayed in the enumeration graphical tool. See, for example, the above. Figure 11 The first enumeration value, "String 1," is displayed with a triangular toggle control to its right. In response to triggering the toggle control, the computer device displays multiple enumeration values from the enumeration graphical tool in the toolbar. In response to selecting a second enumeration value, the computer device displays the second enumeration value in the enumeration graphical tool, making it an input parameter for the function represented by the first graphical tool. In this case, the first enumeration value is no longer used as an input parameter for the function. The second enumeration value is any one of the multiple enumeration values except the first. By supporting the switching of enumeration values displayed in the enumeration graphical tool, users can easily use any enumeration value from the tool as an input parameter for a function. This not only meets the user's programming needs but also simplifies programming operations, eliminating the need for manual code writing and improving programming efficiency.
[0173] Figure 12 This is a schematic diagram of the graphical interface of another graphical programming tool provided in this application embodiment. See also... Figure 12 In response to an enumeration value switching operation, the computer device displays multiple enumeration values from the enumeration graphical tool and a search control 1201 in the toolbar. The search control 1201 is used to search for the enumeration values displayed in the toolbar. By displaying the search control in the toolbar, when there are many enumeration values displayed, users can quickly locate the enumeration value they need using the search control, eliminating the need for users to manually search for enumeration values, reducing the time spent switching enumeration values, and improving programming efficiency.
[0174] In one possible implementation, in response to an enumeration value toggle operation, the computer device queries the enumeration object associated with the enumeration graphical tool. This enumeration object includes an array of enumeration value objects, which stores multiple enumeration value objects. Since the enumeration value objects are entities instantiated from data such as enumeration values and enumeration value IDs, they include the enumeration values in the enumeration graphical tool. The computer device then retrieves the multiple enumeration values from the array of enumeration value objects and displays them in the graphical interface for the user to select.
[0175] Optionally, in response to an enumeration value switching operation, if the first enumeration value is currently displayed in the enumeration graphical tool, the computer device queries the enumeration object array for an enumeration object that includes the enumeration value ID based on the enumeration value ID of the first enumeration value. This enumeration object is also the enumeration object associated with the enumeration graphical tool.
[0176] The following is through Figure 13 The flowchart shown illustrates the process of displaying multiple enumerated values on a computer device's toolbar. (See also...) Figure 13 In response to the enumeration value switching operation, the computer device queries the enumeration object associated with the enumeration graphical tool; then the computer device obtains multiple enumeration values included in the enumeration object and displays the obtained multiple enumeration values in the toolbar until there are no enumeration values not displayed, so as to facilitate the user to select an enumeration value.
[0177] The method provided in this application embodiment can support simple and convenient programming using enumeration graphical tools in graphical programming tools, and can set any enumeration value in the enumeration graphical tool as the input parameter of other graphical tools according to the user's actual programming needs, thereby reducing the programming difficulty while realizing efficient and convenient personalized programming.
[0178] Furthermore, since the enumeration graphical tool is associated with the enumeration object, and the enumeration object includes multiple enumeration values in the enumeration graphical tool, in response to the enumeration value switching operation, the computer device can quickly obtain multiple enumeration values in the enumeration object by searching for the enumeration object, and display multiple enumeration values to the user. This makes it easier for the user to switch enumeration values according to actual needs, improves the efficiency of switching enumeration values, and thus improves programming efficiency.
[0179] The virtual scene in this embodiment includes virtual elements, and the toolbar of the graphical programming tool can display graphical tools, which are tools for editing virtual elements.
[0180] In this application, the virtual scene involved in the embodiment can be used to simulate a three-dimensional virtual space. The three-dimensional virtual space can be an open space. The virtual scene can be used to simulate a real environment in reality. For example, the virtual scene is a virtual scene provided by a video game, and can also be called a virtual map.
[0181] Virtual elements in a virtual scene can include various types. For example, a virtual scene can include virtual elements such as sky, land, and ocean. The land can include environmental elements such as deserts and cities. Of course, the virtual scene can also include virtual characters and virtual items. Virtual characters can include virtual characters controlled by players or NPCs (NonPlayer Characters). These virtual characters can take any form, such as humans or animals.
[0182] Virtual items can include projectiles, buildings, vehicles, and virtual objects within a virtual scene used to arm oneself or engage in combat with other virtual objects. The virtual scene can also simulate realistic environments under different weather conditions, such as sunny, rainy, foggy, or dark weather.
[0183] Based on the above method embodiments, the computer device can use the graphical tools displayed in the toolbar of the graphical programming tool to edit virtual elements in the virtual scene. The editing process is detailed in the following embodiments.
[0184] Figure 14 This is a flowchart illustrating an editing method provided in an embodiment of this application. This embodiment is executed by a computer device. See also... Figure 14 The method includes:
[0185] 1401. The computer device drags the enumeration graphics tool into the first graphics tool in the workspace, and displays the first enumeration value among multiple enumeration values in the enumeration graphics tool, so that the first enumeration value is used as the input parameter of the function represented by the first graphics tool.
[0186] Step 1401 is the same as step 1003 above, and will not be repeated here.
[0187] Additionally, it should be noted that in graphical programming tools, users can create programming projects within the graphical interface and arrange the graphical tools for the project in the workspace. The application for the programming project is then created based on these arranged graphical tools. Optionally, the workspace also includes a run control. After the application is created, the computer device runs the application of the programming project in response to a trigger operation on the run control.
[0188] 1402. During the process of running a function according to the input parameters, the computer device edits the virtual elements in the virtual scene that are associated with the first graphics tool.
[0189] In this embodiment of the application, during the execution of an application program for a programming project, if the programming project includes a first graphical tool and an enumeration graphical tool, the computer device can execute the function represented by the first graphical tool according to the input parameters (i.e., enumeration values) represented by the enumeration graphical tool. During the execution of this function, the computer device edits the virtual elements associated with the first graphical tool in the virtual scene based on the enumeration values.
[0190] Optionally, during the execution of the function, the computer device can determine the virtual element in the virtual scene associated with the first graphics tool, which is the virtual element that needs to be edited. For example, if the function represented by the first graphics tool is used to control the movement direction of virtual character 1, then virtual character 1 is the virtual element that needs to be edited. Or, if the function represented by the first graphics tool is used to set the color of virtual item 1, then virtual item 1 is the virtual element that needs to be edited.
[0191] In one possible implementation, the computer device edits virtual elements in a virtual scene based on the function of a first target graphics tool and the enumeration values of the enumerated graphics tools. For example, if the first graphics tool is used to set the color of a virtual element, then after determining the target color represented by the virtual element associated with the first graphics tool and the enumeration value, the color of the virtual element in the virtual scene is changed to the target color. Alternatively, if the first graphics tool is used to change the movement direction of a virtual element, then after determining the target direction represented by the virtual element associated with the first graphics tool and the enumeration value, the virtual element is displayed in the virtual scene moving in the target direction. The target color and target direction can be selected by the user from multiple enumeration values of the enumerated graphics tools during programming.
[0192] 1403. Computer equipment displays the editing results of virtual elements.
[0193] The computer device displays a virtual scene and its various virtual elements within the virtual scene interface. After editing the virtual elements, the computer device can display the editing results, allowing users to preview the changes. These results not only demonstrate whether the graphical tools are functioning correctly but also represent the display effect of the virtual elements when the user-programmed application is applied to the virtual scene, thus helping users to promptly identify problems that arise during the programming process.
[0194] The method provided in this application embodiment can intuitively display the workspace and toolbar in a graphical programming tool, making it convenient for users to quickly edit virtual elements in a virtual scene using graphical tools. The operation is simple and convenient. Furthermore, it allows users to create enumeration graphical tools in the graphical programming tool according to actual programming needs, and edit virtual elements in the virtual scene based on custom enumeration values in the enumeration graphical tool, satisfying personalized editing needs and enabling users to build personalized game scenes in games through graphical programming tools.
[0195] Figure 15 This is a schematic diagram of the structure of a graphical tool creation device provided in an embodiment of this application. See also... Figure 15 The device includes:
[0196] The first display module 1501 is used to display the graphical interface of the graphical programming tool, which includes a toolbar;
[0197] Create module 1502 to create an enumeration graphical tool in response to a target creation operation;
[0198] The second display module 1503 is used to display the enumeration graphic tool in the toolbar. The target creation operation is an operation that indicates the creation of the enumeration graphic tool. The enumeration graphic tool includes multiple enumeration values belonging to the same data type.
[0199] The graphic tools in the toolbar are used to edit virtual elements in the virtual scene.
[0200] In one possible implementation, the toolbar displays enumerated category labels;
[0201] Create module 1502 to display a creation control in the toolbar in response to a trigger operation on the enumeration category label. The creation control is used to create an enumeration graphical tool; in response to a trigger operation on the creation control, an enumeration graphical tool is created.
[0202] In one possible implementation, Figure 16 This is a schematic diagram of the structure of another graphical tool creation device provided in an embodiment of this application. See also... Figure 16 Create module 1502, which includes:
[0203] Display unit 1601 is used to respond to the target creation operation and display the creation interface in the display area where the toolbar is located. The creation interface displays multiple data types.
[0204] The determining unit 1602 is used to determine the target data type from multiple data types and to determine multiple target enumeration values belonging to the target data type;
[0205] The first creation unit 1603 is used to create an enumeration graphic tool, which includes multiple target enumeration values belonging to the target data type.
[0206] In one possible implementation, the interface is created by including a type selection control that displays multiple data types.
[0207] In one possible implementation, the determining unit 1602 is used to display multiple enumeration value input boxes in the creation interface; and to determine the enumeration value that belongs to the target data type entered in each enumeration value input box as the target enumeration value.
[0208] In one possible implementation, each enumeration value input box displays a default enumeration value;
[0209] The determining unit 1602 is configured to respond to an editing operation on an enumeration value displayed in any enumeration value input box, obtain the edited enumeration value; if the data type of the edited enumeration value is the same as the target data type, determine the edited enumeration value as the target enumeration value; if the data type of the edited enumeration value is different from the target data type, display a prompt message, which prompts the input of an enumeration value belonging to the target data type; and determine the enumeration value belonging to the target data type obtained by further editing as the target enumeration value.
[0210] In one possible implementation, the first creation unit 1603 is used to create an enumeration graphical tool in response to a closing operation of the creation interface.
[0211] In one possible implementation, see [link to relevant documentation]. Figure 16 Module 1502, which was created, also includes:
[0212] The second creation unit 1604 is used to create an enumeration object in response to a target creation operation. The enumeration object includes an array of enumeration value objects.
[0213] The first creation unit 1603 is used to store enumeration value objects corresponding to multiple target enumeration values in an enumeration value object array. The enumeration value object includes the corresponding target enumeration value and the data type of the target enumeration value; and to create an enumeration graphical tool associated with the enumeration object.
[0214] In one possible implementation, the graphical interface also includes a workspace, see [link to relevant documentation]. Figure 16 The device also includes:
[0215] The third display module 1504 is used to drag the enumeration graphic tool into the first graphic tool in the work area, and to display the first enumeration value among multiple enumeration values in the enumeration graphic tool, so that the first enumeration value is used as the input parameter of the function represented by the first graphic tool, and the first enumeration value is any one of the multiple enumeration values.
[0216] In one possible implementation, the third display module 1504 is further configured to display multiple enumeration values in the enumeration graphical tool in response to an enumeration value switching operation; and to display the second enumeration value in the enumeration graphical tool in response to a selection operation of the second enumeration value, such that the second enumeration value serves as an input parameter of the function represented by the first graphical tool.
[0217] In one possible implementation, the third display module 1504 is used to respond to the enumeration value switching operation by querying the enumeration object associated with the enumeration graphical tool, the enumeration object including an array of enumeration value objects; obtaining multiple enumeration values from the array of enumeration value objects; and displaying the multiple enumeration values.
[0218] In one possible implementation, see [link to relevant documentation]. Figure 16 The device also includes:
[0219] The fourth display module 1505 is used to edit the virtual elements associated with the first graphics tool in the virtual scene during the process of running the function according to the input parameters; and to display the editing results of the virtual elements.
[0220] The graphical tool apparatus provided in this application supports the creation of custom enumeration graphical tools within a graphical programming tool during the programming process, thus offering a more flexible programming method. Users can easily and conveniently create enumeration graphical tools according to actual programming needs, and then directly use these tools for programming. Therefore, this solution not only meets the personalized programming needs of technical personnel but also reduces programming complexity and improves programming efficiency.
[0221] It should be noted that the graphical tool creation apparatus provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the graphical tool creation apparatus and the graphical tool creation method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0222] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed in the graphical tool creation method of the above embodiments.
[0223] Optionally, the computer device is provided as a terminal. Figure 17A schematic diagram of the structure of a terminal 1700 provided in an exemplary embodiment of this application is shown.
[0224] Terminal 1700 includes a processor 1701 and a memory 1702.
[0225] Processor 1701 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1701 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1701 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1701 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1701 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0226] Memory 1702 may include one or more computer-readable storage media, which may be non-transitory. Memory 1702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 1702 are used to store at least one computer program, which is used by processor 1701 to implement the method for creating the graphical tools provided in the method embodiments of this application.
[0227] In some embodiments, the terminal 1700 may also optionally include a peripheral device interface 1703 and at least one peripheral device. The processor 1701, memory 1702, and peripheral device interface 1703 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1703 via a bus, signal line, or circuit board. Optionally, the peripheral device includes at least one of a radio frequency circuit 1704, a display screen 1705, a camera assembly 1706, and a power supply 1707.
[0228] Peripheral interface 1703 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1701 and memory 1702. In some embodiments, processor 1701, memory 1702 and peripheral interface 1703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1701, memory 1702 and peripheral interface 1703 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0229] The radio frequency (RF) circuit 1704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1704 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1704 can communicate with other devices through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1704 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0230] Display screen 1705 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1705 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1701 for processing. In this case, display screen 1705 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1705, disposed on the front panel of terminal 1700; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1700 or in a folded design; in still other embodiments, display screen 1705 may be a flexible display screen, disposed on a curved or folded surface of terminal 1700. Furthermore, display screen 1705 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1705 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0231] The camera assembly 1706 is used to acquire images or videos. Optionally, the camera assembly 1706 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the terminal 1700, and the rear-facing camera is disposed on the back of the terminal 1700. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1706 may also include a flash. The flash may be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cool light flash, which can be used for light compensation at different color temperatures.
[0232] Power supply 1707 is used to power the various components in terminal 1700. Power supply 1707 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1707 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0233] Those skilled in the art will understand that Figure 17The structure shown does not constitute a limitation on terminal 1700 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0234] Optionally, the computer device is provided as a server. Figure 18 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1800 can vary significantly depending on its configuration or accuracy. It may include one or more Central Processing Units (CPUs) 1801 and one or more memories 1802. The memories 1802 store at least one computer program, which is loaded and executed by the processor 1801 to implement the methods provided in the various method embodiments described above. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.
[0235] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the operations performed by the graphical tool creation method of the above embodiments.
[0236] This application also provides a computer program product, including a computer program loaded and executed by a processor to perform the operations performed by the graphical tool creation method of the above embodiments.
[0237] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0238] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.
Claims
1. A method for creating a graphical tool, characterized in that, The method includes: A graphical interface for displaying graphical programming tools, the graphical interface including a toolbar; In response to a target creation operation, an enumeration graphical tool is created and displayed in the toolbar. The target creation operation is an operation that instructs the creation of the enumeration graphical tool, which includes multiple enumeration values belonging to the same data type. The graphic tools in the toolbar are tools used to edit virtual elements in the virtual scene.
2. The method according to claim 1, characterized in that, The toolbar displays enumeration category labels; The creation of the enumeration graphical tool in response to the target creation operation includes: In response to a triggering operation on the enumeration category label, a creation control is displayed in the toolbar, the creation control being used to create an enumeration graphical tool; In response to a triggering operation on the creation control, the enumeration graphical tool is created.
3. The method according to claim 1, characterized in that, The creation of the enumeration graphical tool in response to the target creation operation includes: In response to the target creation operation, a creation interface is displayed in the display area where the toolbar is located, and the creation interface displays multiple data types; From the plurality of data types, determine the target data type, and determine a plurality of target enumeration values belonging to the target data type; Create the enumeration graphical tool, which includes multiple target enumeration values belonging to the target data type.
4. The method according to claim 3, characterized in that, The creation interface includes a type selection control, which is used to display the multiple data types.
5. The method according to claim 3, characterized in that, The determination of multiple target enumeration values belonging to the target data type includes: The creation interface displays multiple enumeration value input boxes; The enumeration value that belongs to the target data type and is entered in each enumeration value input box is determined as the target enumeration value.
6. The method according to claim 5, characterized in that, Each enumeration value input box displays a default enumeration value; The step of determining the enumeration value belonging to the target data type entered in each enumeration value input box as the target enumeration value includes: In response to an edit operation on the enumeration value displayed in any enumeration value input box, retrieve the edited enumeration value; If the data type of the edited enumeration value is the same as the target data type, the edited enumeration value is determined as the target enumeration value. If the data type of the edited enumeration value is different from the target data type, a prompt message is displayed to prompt the input of an enumeration value belonging to the target data type. The enumeration value obtained after further editing that belongs to the target data type is determined as the target enumeration value.
7. The method according to claim 3, characterized in that, The tool for creating the enumeration graph includes: In response to the closing operation of the creation interface, the enumeration graphical tool is created.
8. The method according to claim 3, characterized in that, The method further includes: In response to the target creation operation, an enumeration object is created, the enumeration object including an array of enumeration value objects; The tool for creating the enumeration graph includes: The enumeration value objects corresponding to the plurality of target enumeration values are stored in the enumeration value object array, wherein the enumeration value object includes the corresponding target enumeration value and the data type of the target enumeration value; Create an enumeration graphical tool associated with the enumeration object.
9. The method according to claim 1, characterized in that, The graphical interface also includes a workspace, and the method further includes: Drag the enumeration graphic tool into the first graphic tool in the workspace, and display the first enumeration value among the plurality of enumeration values in the enumeration graphic tool, so that the first enumeration value is used as the input parameter of the function represented by the first graphic tool, and the first enumeration value is any one of the plurality of enumeration values.
10. The method according to claim 9, characterized in that, The method further includes: In response to an enumeration value switching operation, multiple enumeration values in the enumeration graphical tool are displayed; In response to a selection operation on a second enumeration value, the second enumeration value is displayed in the enumeration graphics tool, such that the second enumeration value serves as an input parameter for the function represented by the first graphics tool.
11. The method according to claim 10, characterized in that, The response to the enumeration value switching operation, displaying multiple enumeration values in the enumeration graphical tool, includes: In response to an enumeration value switching operation, the enumeration object associated with the enumeration graphical tool is queried, and the enumeration object includes an array of enumeration value objects; Retrieve multiple enumeration values from the array of enumeration value objects; Display the multiple enumerated values.
12. The method according to claim 9 or 10, characterized in that, The method further includes: During the execution of the function according to the input parameters, the virtual elements in the virtual scene associated with the first graphics tool are edited; The editing results of the virtual element are displayed.
13. A device for creating graphic tools, characterized in that, The device includes: The first display module is used to display the graphical interface of the graphical programming tool, and the graphical interface includes a toolbar; Create a module to create an enumeration of graphical tools in response to a target creation operation; The second display module is used to display the enumeration graphic tool in the toolbar. The target creation operation is an operation that indicates the creation of the enumeration graphic tool. The enumeration graphic tool includes multiple enumeration values belonging to the same data type. The graphic tools in the toolbar are tools used to edit virtual elements in the virtual scene.
14. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to perform the operations performed by the method for creating a graphics tool as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the method for creating a graphics tool as described in any one of claims 1 to 12.
16. A computer program product, comprising a computer program, characterized in that, The computer program is loaded and executed by a processor to perform the operations performed by the method for creating a graphics tool as described in any one of claims 1 to 12.