Underlying control processing method and device and computing equipment

By adjusting the limitation conditions of the underlying controls and building slot classes, the multi-sub-control rendering of the underlying controls in the game engine is realized, solving the problem of only rendering a single sub-control in the existing technology, and improving the flexibility of UI design and User experience.

CN119280803APending Publication Date: 2025-01-10CHONGQING PERFECT WORLD INTERACTIVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311775148.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the existing game engine, the underlying controls can only render a single subcontrol, and cannot meet the needs of displaying multiple subcontrols and new message notification functions in the underlying controls at the same time, resulting in insufficient UI design flexibility and user experience.

Method used

By adjusting the limitations of the underlying controls, building slot classes and control rendering functions, supporting the rendering of multiple subcontrols, and judging the number of rendered subcontrols through flag bits, dynamically rendering subcontrols to meet the needs of complex UI design.

Benefits of technology

It realizes displaying multiple different types of subcontrols at the same time in one underlying control, improving the flexibility and diversity of UI design, precise control of subcontrol positions, dynamic rendering of subcontrols, and improving rendering efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119280803A_ABST
    Figure CN119280803A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an underlying control processing method and device and computing equipment. The method comprises the following steps: adjusting at least one limiting condition of a bottom control; a slot class and a first flag bit are constructed in a Slate control class corresponding to the bottom layer control, the slot class is provided with a plurality of member variables and member functions, and the member functions are used for setting position information of the sub-controls; a control rendering function is constructed in a Slate control class corresponding to the bottom layer control, the number of rendering sub-controls of the control rendering function is judged through the first flag bit, and the control rendering function is used for rendering the sub-controls; and if the number of rendering sub-controls of the control rendering function is greater than a preset number, traversing the sub-controls contained in the bottom-layer control according to the position information of the sub-controls through member variables in the slot class, and sequentially rendering the sub-controls contained in the bottom-layer control. According to the technical scheme, the purpose of setting a plurality of sub-controls in the bottom-layer control can be effectively achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of underlying control processing, and in particular, to a method, apparatus and computing device for processing underlying controls. Background Art

[0002] In the game UI interface, it is usually necessary to implement multi-sub-control functions of text and patterns on the underlying control (such as a button, also called a button), and at the same time, it is necessary to support the notification function of new messages to meet user needs, that is, while displaying a small red dot in the upper right corner of the underlying control, a prompt pattern can also be displayed on the underlying control.

[0003] However, the underlying controls in existing game engines (such as Unreal Engine (UE)) (such as the underlying controls in the User Interface Manager (UMG) in the Unreal Engine, referred to as UMGButton) can only contain one child control and cannot directly meet this demand.

[0004] Therefore, a new underlying control processing method is needed to meet the requirement of setting multiple sub-controls in the underlying control. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus and computing device for processing an underlying control, so as to solve the problem in the prior art that only a single sub-control can be rendered.

[0006] In a first aspect, an embodiment of the present application provides a method for processing an underlying control, which is applied to a UE engine, including:

[0007] Adjust at least one restriction of an underlying control, wherein the restriction is used to restrict the underlying control to support rendering of a single child control;

[0008] Constructing a slot class and a first flag in the Slate control class corresponding to the underlying control, wherein the slot class has a plurality of member variables and member functions, wherein the member function is used to set the position information of the child control;

[0009] Constructing a control rendering function in the Slate control class corresponding to the underlying control, and determining the number of sub-controls to be rendered by the control rendering function through the first flag, wherein the control rendering function is used to render sub-controls;

[0010] If the number of rendered sub-controls of the control rendering function is greater than a preset number, the sub-controls contained in the underlying control are traversed according to the position information of the sub-controls through the member variables in the slot class, and the sub-controls contained in the underlying control are rendered in sequence.

[0011] In a second aspect, an embodiment of the present application provides a processing device for an underlying control, which is applied to a UE engine, including:

[0012] An adjustment module, used for adjusting at least one restriction condition of an underlying control, wherein the restriction condition is used for limiting the underlying control to support rendering of a single sub-control;

[0013] A construction module, used to construct a slot class and a first flag in the Slate control class corresponding to the underlying control, wherein the slot class has a plurality of member variables and member functions, wherein the member function is used to set the position information of the child control; and to construct a control rendering function in the Slate control class corresponding to the underlying control;

[0014] A judging module, used for judging the number of sub-controls rendered by the control rendering function through the first flag bit, wherein the control rendering function is used for rendering sub-controls;

[0015] A rendering module is used to traverse the sub-controls contained in the underlying control according to the position information of the sub-controls through the member variables in the slot class if the number of sub-controls rendered by the control rendering function is greater than a preset number, and render the sub-controls contained in the underlying control in sequence.

[0016] In a third aspect, an embodiment of the present application provides a computing device, comprising a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the processing method of the underlying control as described in the first aspect above.

[0017] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program, which, when executed by a computer, implements the processing method of the underlying control as described in the first aspect above.

[0018] In an embodiment of the present application, at least one restriction condition of the underlying control is adjusted, and the restriction condition is used to limit the underlying control to support rendering of a single sub-control; a slot class and a first flag are constructed in the Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions, wherein the member function is used to set the location information of the sub-control; a control rendering function is constructed in the Slate control class corresponding to the underlying control, and the number of sub-controls rendered by the control rendering function is determined by the first flag, and the control rendering function is used to render sub-controls; if the number of sub-controls rendered by the control rendering function is greater than a preset number, the sub-controls contained in the underlying control are traversed according to the location information of the sub-controls through the member variables in the slot class, and the sub-controls contained in the underlying control are rendered in sequence.

[0019] The underlying control processing method provided by this application has the following beneficial effects:

[0020] Support for rendering of multiple sub-controls: By adjusting the restrictions of the underlying control, it can support the rendering of multiple sub-controls. In this way, multiple sub-controls of different types can be displayed simultaneously in one underlying control, improving the flexibility and diversity of UI design.

[0021] Precisely control the position of sub-controls: By building slot classes and member functions, you can easily set the position information of sub-controls. This allows developers to precisely control the layout of sub-controls in the underlying controls, and achieve more free and sophisticated UI design.

[0022] Dynamically render sub-controls: By constructing a control rendering function and judging the number of rendered sub-controls through the first flag, the function of dynamically rendering sub-controls can be realized. When the number of sub-controls is greater than the preset number, the member variables in the slot class can be used to render the sub-controls contained in the underlying control in sequence according to the position information of the sub-controls. This can meet the needs of complex UI design and provide a better user experience.

[0023] Improve rendering efficiency: By limiting the number of sub-controls to be rendered by the underlying control, unnecessary rendering overhead can be avoided and rendering efficiency can be improved. Traversal and rendering operations are performed only when the number of sub-controls to be rendered exceeds the preset number, reducing unnecessary resource consumption.

[0024] To sum up, the underlying control processing method provided in this application has beneficial effects such as supporting rendering of multiple sub-controls, accurately controlling the position of sub-controls, dynamically rendering sub-controls and improving rendering efficiency. It can enhance the functions and performance of underlying controls and provide a more flexible, diverse and efficient UI design and interactive experience.

[0025] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 A flowchart of a method for processing a bottom-level control provided in an embodiment of the present application;

[0028] Figure 2A flowchart of a method for adjusting at least one restriction condition of an underlying control provided in an embodiment of the present application;

[0029] Figure 3 A schematic diagram of the structure of a processing device for a bottom-level control provided in an embodiment of the present application;

[0030] Figure 4 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0032] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0033] The technical solution of the embodiment of the present application can be applied to the following scenarios:

[0034] Game UI interface: In the UI interface of the game, it is often necessary to display text and patterns on the underlying controls, while supporting the notification function of new messages. The underlying control processing method provided in this application can meet this demand, so that the underlying control can support multiple sub-controls, such as text controls and red dot pattern controls, and realize the function of displaying text and red dot patterns on the underlying control at the same time.

[0035] Social application interface: In social applications, such as chat interfaces or notification lists, text and message prompts need to be displayed on each underlying control so that users can quickly obtain the latest information. The underlying control processing method provided in this application can be applied to such scenarios, so that the underlying control can display text information and prompt the arrival of new messages through a red dot pattern.

[0036] List interface: In a list interface, such as a product list or a task list, each list item usually contains an underlying control that needs to display text and message prompts at the same time. The underlying control processing method of this application can be applied to the underlying control in the list interface to realize the multi-child control function of text and graphics, and support notification of new messages.

[0037] In short, the underlying control processing method provided by this application can be applied to various application scenarios that require displaying text and images on the underlying control at the same time and supporting the notification function of new messages. Whether it is a game interface, a social application interface or a list interface, this method can achieve a more flexible and rich underlying control design and interactive experience.

[0038] The inventor has found that in the current game UI interface, it is usually necessary to implement multiple sub-control functions of text and patterns on the bottom-level control (button), and at the same time, it is necessary to support the notification function of new messages to meet user needs. That is, while displaying a small red dot in the upper right corner of the bottom-level control, a prompt pattern can also be displayed on the bottom-level control.

[0039] However, the underlying control (UMGButton) in existing game engines (such as UE) can only contain one sub-control, which cannot directly meet this requirement. In addition, since the UE engine button can only have one sub-control, the button itself does not support multiple sub-controls. If the button wants to implement multiple sub-controls, it is necessary to first mount the overlaypanel under the button, and then mount multiple sub-controls under the overlay. The additional overlay step significantly reduces the production efficiency of planners or UI production personnel, which is not convenient enough.

[0040] Therefore, a new underlying control processing method is needed to meet the requirement of setting multiple sub-controls in the underlying control.

[0041] In view of this, an embodiment of the present application provides a method for processing an underlying control, which is applied to a UE engine, and the method includes: adjusting at least one restriction condition of the underlying control, wherein the restriction condition is used to limit the underlying control to support rendering of a single sub-control; constructing a slot class and a first flag bit in a Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions, wherein the member function is used to set the location information of the sub-control; constructing a control rendering function in the Slate control class corresponding to the underlying control, and judging the number of sub-controls rendered by the control rendering function through the first flag bit, the control rendering function is used to render sub-controls; if the number of sub-controls rendered by the control rendering function is greater than a preset number, traversing the sub-controls contained in the underlying control according to the location information of the sub-controls through the member variables in the slot class, and rendering the sub-controls contained in the underlying control in sequence.

[0042] The technical solution of the embodiment of the present application adjusts the restriction conditions of the underlying control so that it can support rendering multiple sub-controls. In this way, multiple sub-controls of different types can be displayed simultaneously in one underlying control, which improves the flexibility and diversity of UI design. By constructing a slot class and a member function, the position information of the sub-control can be conveniently set. In this way, developers can accurately control the layout of the sub-controls in the underlying control and realize a more free and sophisticated UI design. By constructing a control rendering function and judging the number of rendered sub-controls by the first flag bit, the function of dynamically rendering sub-controls can be realized. When the number of sub-controls is greater than the preset number, the sub-controls contained in the underlying control can be rendered in sequence according to the position information of the sub-controls through the member variables in the slot class. This can meet the needs of complex UI design and provide a better user experience. By limiting the number of rendered sub-controls of the underlying control, unnecessary rendering overhead can be avoided and rendering efficiency can be improved. Only when the number of sub-controls to be rendered exceeds the preset number, traversal and rendering operations will be performed, reducing unnecessary resource consumption.

[0043] To sum up, the underlying control processing method provided in this application has beneficial effects such as supporting rendering of multiple sub-controls, accurately controlling the position of sub-controls, dynamically rendering sub-controls and improving rendering efficiency. It can enhance the functions and performance of underlying controls and provide a more flexible, diverse and efficient UI design and interactive experience.

[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0045] Figure 1 A flowchart of a method for processing a bottom-level control provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method is applied to the UE engine;

[0046] The method includes:

[0047] 102. Adjust at least one restriction condition of an underlying control, where the restriction condition is used to restrict the underlying control to support rendering of a single child control;

[0048] In this step, the underlying control is enabled to render multiple sub-controls by removing the restriction condition. The restriction condition may be a specific code or logic added in the definition or implementation of the underlying control to ensure that the underlying control can only render one sub-control at a time.

[0049] For example, in the processing method of the underlying control, you can adjust the restriction to remove the restriction on rendering a single sub-control of the underlying control. The specific implementation method is as follows: in the Slate control class in the UE engine, find the rendering function corresponding to the underlying control; modify the logic of the rendering function so that it can support rendering multiple sub-controls; remove the restriction code so that the rendering function no longer limits the number of sub-controls; in the rendering function, traverse all sub-controls contained in the underlying control and render them one by one.

[0050] Through the above steps, the restriction that the underlying control only supports rendering a single child control can be removed, and the function of rendering multiple child controls can be realized.

[0051] It should be noted that after removing the restriction, you need to ensure that the rendering function of the underlying control can correctly handle the rendering order and layout of multiple sub-controls. You can manage the position information of the sub-controls through the slot class of the underlying control to ensure that they are rendered according to the expected layout. Figure 2 As shown, the "adjusting at least one restriction condition of the underlying control" in step 102 may include:

[0052] 1021. Set the construction function of the underlying control to support the assembly of at least two child controls;

[0053] In this step, the constructor of the underlying control needs to be set to support the assembly of at least two child controls. The specific implementation is to set the multi-child control flag bCanHaveMultipleChildren of UButton of the umgUI system in the UE engine to true in the constructor.

[0054] In the embodiment of the present application, in the UE engine, UButton is a commonly used UI control, which can usually only assemble one child control. However, by modifying the constructor of UButton, the bCanHaveMultipleChildren flag can be set to true, thereby allowing UButton to support the assembly of at least two child controls.

[0055] Here is an example showing how to modify the UButton constructor:

[0056] cpp

[0057] UButton::UButton(constFObjectInitializer&ObjectInitializer)

[0058] :Super(ObjectInitializer)

[0059] {

[0060] / / Allow the button control to assemble multiple sub-controls

[0061] bCanHaveMultipleChildren=true;

[0062] }

[0063] By setting bCanHaveMultipleChildren to true, you can assemble the underlying control by adding multiple child controls when using the UButton control.

[0064] In this way, it is possible to support the assembly of at least two sub-controls in the constructor of the underlying control, thereby realizing the function that the underlying control can render multiple sub-controls.

[0065] 1022. Delete the constraint condition that the parent class function of the underlying control only renders one child node.

[0066] In this step, the parent class function of the underlying control refers to the OnPaint function of the parent class CompoundWidget of sButton. That is to say, the embodiment of the present application needs to delete the constraint condition of rendering only one child node in the parent class function of the underlying control. The specific implementation is to remove the restriction condition in the OnPaint function of the parent class CompoundWidget of the Slate control class (sButton) in the UE engine.

[0067] Suppose you want to remove the restriction that only one child node is rendered in the parent class of the SButton control, CompoundWidget.

[0068] In the Slate framework of the UE engine, CompoundWidget is the base class of a composite control, which is responsible for managing and rendering child controls.

[0069] In the OnPaint function of CompoundWidget, there is usually a constraint to ensure that only one child widget is rendered, for example:

[0070]

[0071] To remove this restriction, you need to modify the code of SCompoundWidget and comment out or delete the line of code check(ArrangedChildren.Num() == 1).

[0072] Example of the modified OnPaint function:

[0073]

[0074]

[0075] By commenting or removing the restriction, the underlying control is no longer constrained by the condition of rendering only one child node, and can render multiple child controls.

[0076] 104. Constructing a slot class and a first flag in the Slate control class corresponding to the underlying control, wherein the slot class has a plurality of member variables and member functions, wherein the member function is used to set the position information of the child control;

[0077] In this step, in order to realize that the underlying control supports the rendering of multiple sub-controls, it is necessary to build a slot class in the Slate control class corresponding to the underlying control. The slot class is an auxiliary class for managing sub-controls. It has multiple member variables and member functions, among which the member functions are used to set the position information of the sub-controls.

[0078] That is, design and construct the FSlot class in the SButton class. The FSlot class inherits from TSlotBase. The members and member functions of the FSlot class are used to set the position information of the child controls (such as position, center point, etc.). The FSlot instance corresponds to the child control one by one. Add "TPanelChildren" in the SButton class. <fslot>Children.", used to store buttons that support multiple child controls.

[0079] The first flag is constructed in the Slate control class corresponding to the underlying control, that is, the bIsMulti Boolean variable is added to the SButton class to indicate whether the generated button instance supports more than two sub-controls. True means support, and false means that the UE itself only supports one sub-control button.

[0080] In the embodiment of the present application, step 104 may include the following process: add the declaration of the FSlot class in the header file of the SButton class; implement the member variables and member functions of the FSlot class and the use of the Children member variable in the source file of the SButton class; by defining the internal class FSlot and inheriting from the TSlotBase class, member variables and member functions can be added to FSlot to set the position, center point and other properties of the child control; add a TPanelChildren <fslot>The member variable Children of type is used to store buttons that support multiple child controls; use the related functions of Children to set the properties of child controls, and add child controls to Children through instances of FSlot.

[0081] The core code is as follows:

[0082]

[0083]

[0084] 106. Construct a control rendering function in the Slate control class corresponding to the underlying control, and determine the number of sub-controls to be rendered by the control rendering function through the first flag bit, wherein the control rendering function is used to render sub-controls;

[0085] In this step, the OnPaint control rendering function (i.e., control rendering function) of SButton is modified to render multiple sub-controls. The bIsMulti flag (i.e., the first flag) is used to determine whether to render a single sub-control or multiple sub-controls. If it is a button with multiple sub-controls, the process of rendering multiple sub-controls is used. If it is a single sub-control, the UE default rendering process is used.

[0086] The core code is as follows:

[0087]

[0088]

[0089]

[0090] In the above code, the control rendering function (OnPaint function) of SButton is modified to support rendering of multiple sub-controls. If bIsMulti is true, the multi-sub-control rendering process is entered, and the sub-controls are traversed and rendered. If bIsMulti is false, the UE default rendering process is used, that is, a single sub-control is rendered.

[0091] In the process of rendering multiple sub-controls, firstly, the sub-controls of Button are obtained through the ArrangeLayeredChildren function and stored in the ArrangedChildren array, then the ArrangedChildren array is traversed and the outer frame of the sub-controls is drawn using the FSlateDrawElement::MakeBox function. Next, the ArrangedChildren array is traversed and the OnPaint function of the sub-controls is called in turn for rendering.

[0092] In the single-subcontrol rendering process, directly use the FSlateDrawElement::MakeBox function to draw the button frame, and call the OnPaint function of SCompoundWidget for rendering.

[0093] Please note that the above code is only an example and the specific implementation may need to be adjusted and modified according to actual needs.

[0094] 108. If the number of sub-controls rendered by the control rendering function is greater than a preset number, the sub-controls included in the underlying control are traversed according to the position information of the sub-controls through the member variables in the slot class, and the sub-controls included in the underlying control are rendered in sequence.

[0095] In this step, if the number of sub-controls that the control rendering function needs to render exceeds the preset number, it is necessary to traverse the sub-controls contained in the underlying control according to the position information of the sub-controls through the member variables in the slot class, and render them one by one.

[0096] In the control rendering function, you can determine whether the operation needs to be performed by judging whether the number of rendered sub-controls is greater than the preset number. If the number of rendered sub-controls is greater than the preset number, you can use the member variables in the slot class, such as position information, to traverse the sub-controls contained in the underlying control and render them in sequence.

[0097] For example, in an underlying control class named "Button", if the number of sub-controls that the control rendering function needs to render is greater than the preset number, the member variables in the slot class, such as position information, can be used to traverse the sub-controls contained in the underlying control and perform rendering operations in sequence.

[0098] This operation ensures that all child controls contained in the underlying control are rendered and laid out according to the specified position information. This ensures that the rendering effect of the underlying control meets expectations and improves the flexibility and scalability of the underlying control.

[0099] Optionally, if the number of sub-controls rendered by the control rendering function is less than a preset number, the sub-controls included in the underlying control are rendered using a UE default rendering process.

[0100] In this step, if the number of sub-controls that the control rendering function needs to render is less than the preset number, the default rendering process of the UE engine can be selected to render the sub-controls contained in the underlying control. In this way, the default rendering function provided by the UE engine can be used to simplify the rendering operation of the underlying control.

[0101] In the control rendering function, it can be determined whether the UE default rendering process needs to be adopted by judging whether the number of rendered sub-controls is less than the preset number. If the number of rendered sub-controls is less than the preset number, the default rendering function provided by the UE engine can be directly called to render the sub-controls contained in the underlying control.

[0102] For example, in an underlying control class named "Button", if the number of sub-controls that the control rendering function needs to render is less than the preset number, you can choose to call the default rendering function provided by the UE engine to render the sub-controls contained in the underlying control.

[0103] By adopting the default rendering process of UE, the rendering operation of the underlying controls can be simplified, and the rendering effect of the underlying controls can be guaranteed to be consistent with other controls using the UE engine. This can improve the maintainability and compatibility of the underlying controls.

[0104] For the core code of this step, please refer to the core code in step 106 of the above embodiment, which will not be repeated in this embodiment of the present application.

[0105] Optionally, before constructing a slot class and a first flag bit in the Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions, it also includes: adding a second flag bit in the UE control class corresponding to the underlying control, and the second flag bit is used to indicate whether the underlying control contains multiple sub-controls; if the second flag bit indicates that the underlying control contains multiple sub-controls, continue to execute the step of constructing a slot class and a first flag bit in the Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions.

[0106] In this step, in order to better handle the situation of whether the underlying control contains multiple child controls, it is necessary to add a second flag (MultiChild, indicating whether it is a multi-child control) in the UE control class (UButton class) corresponding to the underlying control to indicate whether the underlying control contains multiple child controls.

[0107] Specifically, a bool variable is added to the UButton class, which is the flag of whether it is a multi-child control, MultiChild, to mark whether the button is a multi-child control or a single-child control. This flag can be configured in the editor panel, that is, the user can check whether it is a multi-child control button. This flag is used to distinguish the construction of multi-child controls or single-child controls when constructing child controls.

[0108] In the embodiment of the present application, the steps of adding a second flag bit in the UE control class to mark whether the underlying control contains multiple sub-controls are as follows:

[0109] Open the header file (.h file) of the UE control class (such as UButton class) corresponding to the underlying control.

[0110] Add a member variable of type bool and name it MultiChild to indicate whether the underlying control contains multiple child controls. For example:

[0111] cpp

[0112] UPROPERTY(EditAnywhere,Category="Button")

[0113] bool MultiChild;

[0114] Initialize MultiChild in the constructor, for example:

[0115] cpp

[0116] UButton::UButton()

[0117] {

[0118] / / Other initialization code

[0119] MultiChild = false;

[0120] }

[0121] MultiChild can be configured in the editor panel, allowing users to check whether it is a Button with multiple child controls.

[0122] After completing the above steps, you can use the MultiChild flag to determine whether the underlying control contains multiple child controls when constructing the Slate control class corresponding to the underlying control, and make corresponding processing.

[0123] Optionally, a slot class is constructed in the Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions, including:

[0124] Create a first underlying control panel slot class, and use the UE control class and the slot class as member variables of the first underlying control panel slot class. The member function corresponding to the member variable sets the position information of the sub-control through the member variable, and each slot corresponding to the first underlying control panel slot class stores a sub-control.

[0125] In this step, in order to support the rendering of multiple sub-controls of the underlying control, it is necessary to construct a first underlying control panel slot class, which has multiple member variables and member functions for storing and setting the position information of the sub-controls.

[0126] Specifically, in the SButton class, construct the UButtonPanelSlot class, which inherits from UPanelSlot, and uses SButton::FSlot*Slot as a member variable of the UButtonPanelSlot class. The member function can set the position information of the sub-control (such as position, center point, etc.) through the Slot member. When constructing a multi-sub-control button, the UButtonPanelSlot instance is used to store sub-controls one-to-one, and one sub-control corresponds to one UButtonPanelSlot.

[0127] The core code is as follows:

[0128]

[0129] The above code is part of the implementation code of the UButtonPanelSlot class in UE. The following is an explanation of the code:

[0130] The UButtonPanelSlot class inherits from the UPanelSlot class and is used to manage the position and size of child controls in SButton.

[0131] The UButtonPanelSlot class has several member functions for setting and getting the position, size, and offset of child controls. The SetPosition function is used to set the position of a child control, and the parameter InPosition is the coordinate position of the child control; the GetPosition function is used to get the position of a child control; the SetSize function is used to set the size of a child control, and the parameter InSize is the size of the child control; the GetSize function is used to get the size of a child control; the SetOffsets function is used to set the offset of a child control, and the parameter InOffset is the offset of the child control.

[0132] The UButtonPanelSlot class has a member variable Slot, which is a pointer of type SButton::FSlot and is used to store references to child controls.

[0133] The UButtonPanelSlot class has a BuildSlot function that is used to build a slot in an SButton. This function accepts a TSharedRef <sbutton>The parameter of type Canvas represents the SButton object to build the slot. In the BuildSlot function, add a slot by calling the AddSlot function of Canvas, bind the Slot member variable using the Expose function, and save the newly added slot to the Slot. In the slot, use the ternary operator to determine whether Content is empty. If it is empty, use SNullWidget::NullWidget to represent an empty SWidget. Otherwise, use Content->TakeWidget() to get the SWidget of the child control and place it in the slot.

[0134] The SynchronizeProperties function is used to synchronize the properties of the UButtonPanelSlot object to the SButton::FSlot object.

[0135] In general, the UButtonPanelSlot class is a slot class for managing sub-controls in SButton. It provides some functions to set and get the position, size, and offset of sub-controls, and adds sub-controls to SButton through the BuildSlot function.

[0136] Optionally, judging whether multiple sub-controls are included through the second flag bit includes: adjusting the get-slot-control function in the UE control class corresponding to the underlying control, and determining whether the underlying control contains multiple sub-controls through the second flag bit; if so, obtaining the sub-control from the slot corresponding to the first underlying control panel slot class through the get-slot-control function in the first underlying control panel slot class.

[0137] In this step, in order to adapt to the situation that the underlying control contains multiple sub-controls, it is necessary to adjust the sub-control construction function in the UE control class corresponding to the underlying control, and determine whether it contains multiple sub-controls through the second flag bit.

[0138] Specifically, in the RebuildWidget() construction child control function of the UBtto class, the flag MultiChild (the second flag bit) is used to determine if it is a multi-child control button and to call the BuildSlot method of the UButtonPanelSlot class to build it. The BuildSlot function (the control function in the slot) stores the child control slot into the Children child control container of SButton by calling AddSlot; if it is a single-child control button, the BuildSlot function of UButtonSlot is called.

[0139] The core code is as follows:

[0140]

[0141]

[0142] The above code is part of the implementation code of the UButton class in UE. The following is an explanation of the code:

[0143] The UButton class inherits from the UContentWidget class and is used to represent a button control.

[0144] The UButton class has a member variable MultiChild of type bool, which is used to indicate whether multiple child controls are supported.

[0145] The UButton class overrides the RebuildWidget function, which is used to rebuild the SWidget object of the button control. In the function, each slot is processed by traversing the Slots array.

[0146] If MultiChild is false, it means that the button only supports a single child control. In this case, if the slot is of type UButtonSlot, it is converted to a UButtonSlot object and the BuildSlot function is called to build the slot.

[0147] If MultiChild is true, it means that the button supports multiple child controls. In this case, if the slot is of type UButtonPanelSlot, it is converted to a UButtonPanelSlot object and the BuildSlot function is called to build the slot.

[0148] In the BuildSlot function, pass a reference to the button to the slot's Parent member variable, and then call the slot's BuildSlot function to build the slot.

[0149] In general, the UButton class is a class used to represent a button control. It implements the reconstruction of the button control by overriding the RebuildWidget function, and handles different types of slots according to the MultiChild property. If MultiChild is false, it means that the button only supports a single child control, and if MultiChild is true, it means that the button supports multiple child controls.

[0150] Optionally, it also includes: adjusting the sub-control construction function in the UE control class corresponding to the underlying control, and determining whether it contains multiple sub-controls through the second flag; if so, calling the create slot function in the first underlying control panel slot class to create a slot corresponding to the sub-control, and calling the sub-control add function to store the sub-control into the slot corresponding to the first underlying control panel slot class.

[0151] In this step, the GetSlotClass function of the UButton class determines whether it contains multiple sub-controls through the multi-sub-control flag (the second flag bit). If it is a button with multiple sub-controls, it returns the StaticClass function of UButtonPanelSlot. If it is a button with a single sub-control, it returns the StaticClass function of UButtonSlot. GetSlotClass can correctly return the corresponding slot when constructing a sub-control through the MultiChild flag bit.

[0152] The following is an example showing the implementation of the GetSlotClass function in the UButton class:

[0153]

[0154]

[0155] In the above implementation, the GetSlotClass function determines whether it contains multiple child controls by judging the MultiChild flag. If MultiChild is true, it means that the button supports multiple child controls, and the class object of UButtonPanelSlot is returned; if MultiChild is false, it means that the button only supports a single child control, and the class object of UButtonSlot is returned.

[0156] Through this implementation, when constructing the child controls of a button, you can decide which slot class to use based on the MultiChild property of the button. In this way, even when constructing child controls, you can correctly select the slot class based on the MultiChild property.

[0157] Figure 3 A schematic diagram of the structure of a processing device for a bottom-level control provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the device is applied to a UE engine;

[0158] The device includes:

[0159] An adjustment module 31, used for adjusting at least one restriction condition of an underlying control, wherein the restriction condition is used for limiting the underlying control to support rendering of a single sub-control;

[0160] A construction module 32 is used to construct a slot class and a first flag in the Slate control class corresponding to the underlying control, wherein the slot class has a plurality of member variables and member functions, wherein the member function is used to set the position information of the child control; and to construct a control rendering function in the Slate control class corresponding to the underlying control;

[0161] A judging module 33, used to judge the number of sub-controls rendered by the control rendering function through the first flag bit, where the control rendering function is used to render sub-controls;

[0162] The rendering module 34 is used to traverse the sub-controls contained in the underlying control according to the position information of the sub-controls through the member variables in the slot class if the number of sub-controls rendered by the control rendering function is greater than a preset number, and render the sub-controls contained in the underlying control in sequence.

[0163] Optionally, in an embodiment of the present application, the rendering module 34 is also used to render the sub-controls included in the underlying control using the UE default rendering process if the judgment module 33 determines that the number of rendered sub-controls of the control rendering function is less than a preset number.

[0164] Optionally, in an embodiment of the present application, the construction module 32 is also used to add a second flag bit in the UE control class corresponding to the underlying control, and the second flag bit is used to indicate whether the underlying control contains multiple sub-controls; if the second flag bit indicates that the underlying control contains multiple sub-controls, continue to execute the steps of constructing a slot class and the first flag bit in the Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions.

[0165] Optionally, in an embodiment of the present application, the construction module 32 is specifically used to create a first underlying control panel slot class, and use the UE control class and the slot class as member variables of the first underlying control panel slot class, the member function corresponding to the member variable sets the position information of the sub-control through the member variable, and each slot corresponding to the first underlying control panel slot class stores a sub-control.

[0166] Optionally, in the embodiment of the present application, the adjustment module 31 is further used to adjust the sub-control construction function in the UE control class corresponding to the underlying control, and determine whether multiple sub-controls are included through the second flag bit;

[0167] The construction module 32 is also used to call the create slot function in the first underlying control panel slot class to create a slot corresponding to the sub-control, and call the sub-control add function to store the sub-control into the slot corresponding to the first underlying control panel slot class.

[0168] Optionally, in an embodiment of the present application, the judgment module 33 is specifically used to adjust the function of obtaining the control in the slot in the UE control class corresponding to the underlying control, and determine whether the underlying control contains multiple sub-controls through the second flag bit; if so, obtain the sub-control from the slot corresponding to the first underlying control panel slot class through the function of obtaining the control in the slot in the first underlying control panel slot class.

[0169] Optionally, in an embodiment of the present application, the adjustment module 31 is specifically used to set the construction function of the underlying control to support the assembly of at least two child controls; and delete the constraint that the parent class function of the underlying control only renders one child node.

[0170] Figure 3 The processing device of the bottom layer control can execute Figure 1 The implementation principle and technical effect of the processing method of the underlying control described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the processing device of the underlying control in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0171] In one possible design, Figure 3 The processing device of the underlying control of the illustrated embodiment may be implemented as a computing device, such as Figure 4 As shown, the computing device may include a storage component 401 and a processing component 402;

[0172] The storage component 401 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 402 .

[0173] The processing component 402 is used to: adjust at least one restriction condition of the underlying control, the restriction condition is used to limit the underlying control to support rendering of a single sub-control; construct a slot class and a first flag bit in the Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions, wherein the member function is used to set the location information of the sub-control; construct a control rendering function in the Slate control class corresponding to the underlying control; determine the number of sub-controls rendered by the control rendering function through the first flag bit, and the control rendering function is used to render sub-controls; if the number of sub-controls rendered by the control rendering function is greater than a preset number, traverse the sub-controls contained in the underlying control according to the location information of the sub-controls through the member variables in the slot class, and render the sub-controls contained in the underlying control in sequence.

[0174] The processing component 402 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0175] The storage component 401 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0176] The display component 403 may be an electroluminescent (EL) element, a liquid crystal display or a micro display having a similar structure, or a retinal direct display or a similar laser scanning display.

[0177] Of course, a computing device may also include other components, such as input / output interfaces, communication components, etc.

[0178] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.

[0179] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.

[0180] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0181] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The processing method of the underlying control of the illustrated embodiment.

[0182] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0183] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0184] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0185] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.< / sbutton> < / fslot> < / fslot>

Claims

1. A method for processing an underlying control, characterized in that: Applied to UE engine, including: Adjust at least one restriction of an underlying control, wherein the restriction is used to restrict the underlying control to support rendering of a single child control; Constructing a slot class and a first flag in the Slate control class corresponding to the underlying control, wherein the slot class has a plurality of member variables and member functions, wherein the member function is used to set the position information of the child control; Constructing a control rendering function in the Slate control class corresponding to the underlying control, and determining the number of sub-controls to be rendered by the control rendering function through the first flag, wherein the control rendering function is used to render sub-controls; If the number of rendered sub-controls of the control rendering function is greater than a preset number, the sub-controls contained in the underlying control are traversed according to the position information of the sub-controls through the member variables in the slot class, and the sub-controls contained in the underlying control are rendered in sequence.

2. The method according to claim 1, characterized in that Also includes: If the number of sub-controls rendered by the control rendering function is less than a preset number, the sub-controls included in the underlying control are rendered using the UE default rendering process.

3. The method according to claim 1, characterized in that Before constructing a slot class and a first flag in the Slate control class corresponding to the underlying control, and the slot class has a plurality of member variables and member functions, it also includes: Add a second flag bit in the UE control class corresponding to the underlying control, where the second flag bit is used to mark whether the underlying control contains multiple sub-controls; If the second flag bit indicates that the underlying control includes multiple child controls, continue to execute the step of constructing a slot class and the first flag bit in the Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions.

4. The method according to claim 1, characterized in that A slot class is constructed in the Slate control class corresponding to the underlying control, and the slot class has multiple member variables and member functions, including: Create a first underlying control panel slot class, and use the UE control class and the slot class as member variables of the first underlying control panel slot class. The member function corresponding to the member variable sets the position information of the sub-control through the member variable, and each slot corresponding to the first underlying control panel slot class stores a sub-control.

5. The method according to claim 3, characterized in that: Also includes: Adjust the sub-control construction function in the UE control class corresponding to the underlying control, and determine whether multiple sub-controls are included through the second flag bit; If so, call the create slot function in the first underlying control panel slot class to create a slot corresponding to the sub-control, and call the sub-control add function to store the sub-control into the slot corresponding to the first underlying control panel slot class.

6. The method according to claim 5, characterized in that The determining whether a plurality of sub-controls are included by the second flag bit includes: Adjust the function of obtaining the control in the slot in the UE control class corresponding to the underlying control, and determine whether the underlying control contains multiple sub-controls through the second flag bit; If so, the sub-control is obtained from the slot corresponding to the first bottom-level control panel slot class through the function of obtaining the control in the slot in the first bottom-level control panel slot class.

7. The method according to claim 1, characterized in that The at least one restriction condition of adjusting the underlying control includes: Set the construction function of the underlying control to support the assembly of at least two child controls; Delete the constraint that the parent class function of the underlying control only renders one child node.

8. A processing device for a bottom-level control, characterized in that: Applied to UE engine, including: An adjustment module, used for adjusting at least one restriction condition of an underlying control, wherein the restriction condition is used for limiting the underlying control to support rendering of a single sub-control; A construction module, used to construct a slot class and a first flag in the Slate control class corresponding to the underlying control, wherein the slot class has a plurality of member variables and member functions, wherein the member function is used to set the position information of the child control; and to construct a control rendering function in the Slate control class corresponding to the underlying control; A judging module, used for judging the number of sub-controls rendered by the control rendering function through the first flag bit, wherein the control rendering function is used for rendering sub-controls; A rendering module is used to traverse the sub-controls contained in the underlying control according to the position information of the sub-controls through the member variables in the slot class if the number of sub-controls rendered by the control rendering function is greater than a preset number, and render the sub-controls contained in the underlying control in sequence.

9. A computing device, characterized in that It comprises a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the processing method of the underlying control as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that: A computer program is stored, and when the computer executes the computer program, the processing method of the bottom-level control according to any one of claims 1 to 7 is implemented.