Interface layout generation method and device, storage medium and electronic equipment

By performing structured analysis of design data and dynamic classification of containers, high-precision interface layouts are automatically generated, solving the problems of control misalignment and size mismatch in interface layouts, and achieving efficient cross-platform adaptation and visual consistency.

CN123157202APending Publication Date: 2026-11-24SHENZHEN TENCENT COMP SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510683768.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies struggle to identify container hierarchy during interface layout generation, leading to control misalignment and size mismatch. This is especially problematic during cross-platform engine conversions, which require repeated manual corrections, making it time-consuming and error-prone.

Method used

By performing structured analysis of design data and dynamic classification of containers, multi-level parameter conversion rules are constructed. By integrating layer relationships and control attributes, high-precision interface layouts are automatically generated, supporting dynamic offset calculation and slot parameter adaptation for single-container and multi-container controls.

Benefits of technology

It improves cross-engine adaptation efficiency and visual fidelity, significantly reduces control misalignment and size adaptation anomalies, reduces the number of manual adjustments and adaptation costs, and supports accurate reproduction of controls such as buttons and scroll boxes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123157202A_ABST
    Figure CN123157202A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, storage medium, and electronic device for generating an interface layout. The method includes: displaying design data for generating the interface layout; determining the container category of controls based on layer relationships, wherein the container category includes single-container controls and multi-container controls, a single-container control allowing the inclusion of one child control with a control slot, and a multi-container control allowing the inclusion of at least two child controls with control slots; determining the slot parameters corresponding to the control slots based on the container category and shape parameters; and displaying the target interface layout in a target engine based on the slot parameters. This application solves the technical problem of frequent control misalignment and size mismatch in the interface layout when converting design data into engine parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for generating an interface layout, a storage medium, and an electronic device. Background Technology

[0002] In the current UI layout generation process, there is a significant bottleneck in the conversion of design data into engine-recognizable parameters. Traditional methods typically rely on manual adjustments or static rule matching. However, UI layouts often contain multiple nested container structures, and different container types impose different constraints on the positional relationships of child controls. For example, a single-layer container may require child controls to be strictly centered, while multi-layer containers require dynamic calculation of the relative offsets of child controls. When handling such scenarios, related technologies struggle to identify container hierarchy relationships and cannot dynamically adapt parameter conversion rules based on container characteristics. This results in frequent issues such as control misalignment and size mismatch in the generated UI layout, especially during cross-platform engine conversions, which require repeated manual corrections, are time-consuming and error-prone.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides a method and apparatus for generating interface layouts, a storage medium, and an electronic device to at least solve the technical problem that interface layouts frequently exhibit control misalignment and size mismatch when design data is converted into engine parameters.

[0005] According to one aspect of the embodiments of this application, a method for generating an interface layout is provided, comprising: displaying design data for generating the interface layout, wherein the design data includes shape parameters and layer relationships of controls in the interface layout; determining the container category of the controls based on the layer relationships, wherein the container category includes single-container controls and multi-container controls, wherein the single-container control allows accommodating one child control with a control slot, and the multi-container control allows accommodating at least two child controls with the control slots; determining the slot parameters corresponding to the control slots based on the container category and the shape parameters, wherein the slot parameters are used to indicate the display position of the corresponding control in a target engine; and displaying a target interface layout in the target engine based on the slot parameters.

[0006] According to another aspect of the embodiments of this application, an interface layout generation apparatus is also provided, comprising: a first display module for displaying design data for generating the interface layout, wherein the design data includes shape parameters and layer relationships of controls in the interface layout; a first determining module for determining the container category of the controls based on the layer relationships, wherein the container category includes single-container controls and multi-container controls, wherein the single-container control allows accommodating one child control with a control slot, and the multi-container control allows accommodating at least two child controls with the control slots; a second determining module for determining slot parameters corresponding to the control slots based on the container category and the shape parameters, wherein the slot parameters indicate the display position of the corresponding control in a target engine; and a second display module for displaying a target interface layout in the target engine based on the slot parameters.

[0007] In an exemplary embodiment, the device is configured to determine the slot parameters corresponding to the control slot based on the container category and the shape parameters in the following manner: when the container category is the single container control, calculating the horizontal offset parameter in the horizontal direction and the vertical offset parameter in the vertical direction of the sub-control based on the shape parameters of the sub-control corresponding to the single container control and the shape parameters of the single container control, wherein the shape parameters include a horizontal offset value, a vertical offset value, a width, and a height; setting a fill offset based on the horizontal offset parameter and the vertical offset parameter, and setting an alignment mode corresponding to the sub-control, thereby determining the slot parameters, wherein the slot parameters include the fill offset and the alignment mode, and the alignment mode includes horizontal alignment and vertical alignment.

[0008] In an exemplary embodiment, the device is configured to determine the slot parameters corresponding to the control slot based on the container category and the shape parameters in the following manner: when the single container control includes at least one of a button control, a safe area control, a size box control, and a bounding box control, a left offset parameter is determined based on the horizontal offset value of the child control corresponding to the single container control and the horizontal offset value of the single container control, and a right offset parameter is determined based on the horizontal offset value and width of the child control and the horizontal offset value and width of the single container control, wherein the horizontal offset parameter includes the left offset parameter and the right offset parameter; a top offset parameter is determined based on the vertical offset value of the child control and the vertical offset value of the single container control, and a bottom offset parameter is determined based on the vertical offset value and height of the child control and the vertical offset value and height of the single container control, wherein the vertical offset parameter includes the top offset parameter and the bottom offset parameter; a fill offset is set based on the left offset parameter, the right offset parameter, the top offset parameter, and the bottom offset parameter, and the alignment mode of the child control is set to horizontal fill and vertical fill, thereby determining the slot parameters.

[0009] In an exemplary embodiment, the device is configured to determine the slot parameters corresponding to the control slot based on the container category and the shape parameters in the following manner: when the single container control includes a checkbox control, a left offset parameter is determined based on the horizontal offset value of the child control of the checkbox control, the horizontal offset value of the checkbox pattern, and the width; a top offset parameter is determined based on the vertical offset value and height of the child control and the vertical offset value and height of the checkbox control, wherein the vertical offset parameter includes the top offset parameter; a fill offset is set based on the left offset parameter and the top offset parameter, and the alignment mode of the child control is set to vertical center alignment and horizontal left alignment to determine the slot parameters.

[0010] In an exemplary embodiment, the device is configured to determine the slot parameters corresponding to the control slot based on the container category and the shape parameters in the following manner: when the single container control includes a scaling box control, determining horizontal left offset parameters, horizontal center offset parameters, and horizontal right offset parameters based on the horizontal offset value and width of the child control of the scaling box control; determining vertical upward offset parameters, vertical center offset parameters, and vertical downward offset parameters based on the vertical offset value and height of the child control and the vertical offset value and height of the scaling box control; determining the horizontal alignment mode corresponding to the child control in the horizontal direction based on the horizontal left offset parameters, the horizontal center offset parameters, and the horizontal right offset parameters, and determining the vertical alignment mode corresponding to the child control in the vertical direction based on the vertical upward offset parameters, the vertical center offset parameters, and the vertical downward offset parameters, thereby determining the slot parameters.

[0011] In an exemplary embodiment, the device is configured to determine the alignment mode of the scaling box control in the horizontal direction based on the horizontal left offset parameter, the horizontal center offset parameter, and the horizontal right offset parameter, and to determine the alignment mode of the scaling box control in the vertical direction based on the vertical upward offset parameter, the vertical center offset parameter, and the vertical downward offset parameter, thereby determining the slot parameter: setting the alignment mode of the sub-control with the smallest absolute value among the horizontal left offset parameter, the horizontal center offset parameter, and the horizontal right offset parameter to the horizontal direction; setting the alignment mode of the sub-control with the smallest absolute value among the vertical upward offset parameter, the vertical center offset parameter, and the vertical downward offset parameter to the vertical direction; and determining the slot parameter.

[0012] In an exemplary embodiment, the device is configured to determine the slot parameter corresponding to the control slot based on the container category and the shape parameter in the following manner: when the container category is the multi-container control, the slot parameter is determined based on the slot type of the control slot, the shape parameter of each sub-control, and the shape parameter of the container control.

[0013] In an exemplary embodiment, the device is configured to determine the slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control in the following manner: when the slot type of the control slot is a canvas slot, the device determines the horizontal dimension offset of each sub-control based on the width of each sub-control corresponding to the multi-container control, and determines the vertical dimension offset of each sub-control based on the height of each sub-control; the device determines the horizontal position offset of each sub-control based on the horizontal offset value of each sub-control and the horizontal offset value of the multi-container control, and determines the vertical position offset of each sub-control based on the vertical offset value of each sub-control and the vertical offset value of the multi-container control; and the device determines the slot parameters based on the horizontal dimension offset, the vertical dimension offset, the vertical position offset, and the horizontal position offset.

[0014] In an exemplary embodiment, the device is configured to determine the slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control in the following manner: when the slot type of the control slot is a horizontal frame slot, and the multi-container control includes a horizontal frame control and at least one of a stack frame control and a scroll frame control set in a horizontal direction, the device sequentially traverses each sub-control of the multi-container control, divides each sub-control into corresponding regions based on the width corresponding to the multi-container control, the width corresponding to each sub-control, and size information, and determines a first region offset parameter of each sub-control in the corresponding region based on the horizontal offset value, vertical offset value, width, and height of each sub-control; and determines the slot parameters for each sub-control based on the first region offset parameter and a first fill factor, wherein the first fill factor is determined by the width of each sub-control and the first historical fill space corresponding to each sub-control, the first historical fill space is determined by the width corresponding to the previously traversed sub-control and the first historical fill space, and the initial value of the first historical fill space is 0.

[0015] In an exemplary embodiment, the device is configured to, when the slot type of the control slot is a horizontal frame slot and the multi-container control includes a horizontal frame control and at least one of a stacked frame control and a scrolled frame control set in a horizontal direction, sequentially traverse each sub-control of the multi-container control, divide each sub-control into corresponding regions based on the width corresponding to the multi-container control, the width corresponding to each sub-control, and size information, and determine a first region offset parameter of each sub-control in the corresponding region based on the horizontal offset value, vertical offset value, width, and height of each sub-control: when the slot type of the control slot is a horizontal frame slot and the multi-container control includes a horizontal frame control and at least one of a stacked frame control and a scrolled frame control set in a horizontal direction, sequentially traverse each sub-control of the multi-container control and perform the following operations, wherein each control that divides the region is regarded as the first current control, the size information of the first current control is the fill mode, and the alignment mode of the first current control is horizontal fill and vertical fill: determine the region vertical offset parameter based on the vertical offset value and height of the multi-container control. Offset value and region height; the horizontal offset value and region width of the region are determined based on the first starting point position corresponding to the first current control, the horizontal offset value and width of the first current control, wherein the first starting point position is determined by the horizontal offset value and width of the previously traversed child control and the right offset parameter. When the first current control is the first traversed child control, the first starting point position is the horizontal offset value of the multi-container control. When the first current control is the last traversed child control, and the sum of the region horizontal offset value and the region width is less than the sum of the horizontal offset value and width of the multi-container control, the region width is determined by the horizontal offset value, width and the region horizontal offset value of the multi-container control; the left offset parameter, right offset parameter, top offset parameter and bottom offset parameter of the first current control are determined based on the region vertical offset value, the region height, the region horizontal offset value, the region width and the horizontal offset value, vertical offset value, width and height of the first current control, wherein the first region offset parameter includes the left offset parameter, the right offset parameter, the top offset parameter and the bottom offset parameter.

[0016] In an exemplary embodiment, the device is configured to determine the slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control in the following manner: when the slot type of the control slot is a vertical box slot, and the multi-container control includes a vertical box control and at least one of a stack box control and a scroll box control set in a vertical direction, the device sequentially traverses each sub-control of the multi-container control, divides each sub-control into corresponding regions based on the height corresponding to the multi-container control, the height corresponding to each sub-control, and size information, and determines a second region offset parameter of each sub-control in the corresponding region based on the horizontal offset value, vertical offset value, width, and height of each sub-control; and determines the slot parameters of each sub-control based on the second region offset parameter and a second fill factor, wherein the second fill factor is determined by the height of each sub-control and the second historical fill space corresponding to each sub-control, the second historical fill space is determined by the height corresponding to the previously traversed sub-control and the second historical fill space, and the initial value of the second historical fill space is 0.

[0017] In an exemplary embodiment, the device is configured to, when the slot type of the control slot is a vertical box slot and the multi-container control includes a vertical box control and at least one of a stack box control and a scroll box control set in a vertical direction, sequentially traverse each sub-control of the multi-container control, divide each sub-control into corresponding regions based on the height corresponding to the multi-container control, the height corresponding to each sub-control, and the size information, and determine a second region offset parameter of each sub-control in the corresponding region based on the horizontal offset value, vertical offset value, width, and height of each sub-control: sequentially traversing each sub-control of the multi-container control, the following operations are performed, wherein each control that divides the region is regarded as the second current control, the size information of the second current control is the fill mode, and the alignment mode of the second current control is horizontal fill and vertical fill: determining the region horizontal offset value and region width based on the horizontal offset value and width of the multi-container control; based on the second starting point position corresponding to the second current control, the second current control... The vertical offset and height of the component determine the vertical offset and height of the region. The second starting point position is determined by the vertical offset and height of the child controls previously traversed by the second current control, as well as the downward offset parameter. When the second current control is the first traversed child control, the second starting point position is the vertical offset of the multi-container control. When the second current control is the last traversed child control, and the sum of the region's vertical offset and height is less than the sum of the multi-container control's vertical offset and height, the region's height is determined by the multi-container control's vertical offset, height, and the region's vertical offset. Based on the region's vertical offset, height, horizontal offset, width, and the second current control's horizontal offset, vertical offset, width, and height, the left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter of the second current control are determined. The second region's offset parameters include the left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter.

[0018] In an exemplary embodiment, the device is configured to determine the slot parameter based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control in the following manner: When the sub-controls of the multi-container control do not affect each other, and the multi-container control includes at least one of an overlay control and a control reflector control, the device sequentially traverses each sub-control of the multi-container control, determines the left offset parameter of each sub-control based on the horizontal offset value of each sub-control and the horizontal offset value of the multi-container control, and determines the left offset parameter of each sub-control based on the horizontal offset value and width of each sub-control and the horizontal offset of the multi-container control. The right offset parameter of each sub-control is determined by the offset value and width; the top offset parameter of each sub-control is determined based on the vertical offset value of each sub-control and the vertical offset value of the multi-container control; the bottom offset parameter of each sub-control is determined based on the vertical offset value and height of each sub-control and the vertical offset value and height of the multi-container control; the fill offset is set based on the left offset parameter, the right offset parameter, the top offset parameter and the bottom offset parameter, and the alignment mode of each sub-control is set to horizontal fill and vertical fill, and the slot parameter is determined, wherein the slot parameter includes the fill offset and the alignment mode.

[0019] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described interface layout generation method at runtime.

[0020] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the interface layout generation method as described above.

[0021] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described interface layout generation method through the computer program.

[0022] This application's embodiments employ a structured analysis of design data and a dynamic container classification mechanism. By integrating layer relationships and control attributes to construct multi-level parameter conversion rules, it achieves the goal of automatically generating high-precision interface layouts, thereby realizing a dual improvement in cross-engine adaptation efficiency and visual fidelity. Specifically, in the data analysis stage, by extracting control shape parameters (such as coordinates and dimensions) and layer hierarchy information output by the design tool, and combining them with a container category recognition model, controls are divided into single-container and multi-container structures, ensuring that the slot logic of sub-controls corresponding to different container types is processed independently. In the parameter conversion stage, a dynamic calculation mechanism for the offset of single-container controls is used. For multi-container controls, a dynamic derivation mechanism for slot type adaptation solves the problem of dynamic arrangement of sub-controls in complex nested containers. In the layout generation stage, the automatic matching of slot parameters with the target engine's layout logic ensures efficient conversion from design drafts to multi-platform interface layouts. This method significantly reduces the parameter conversion error of single-container controls and significantly improves the layout generation efficiency of multi-container controls. It also supports accurate cross-engine restoration of common controls such as buttons and scroll boxes, significantly reducing the number of manual adjustments and adaptation costs. This solves the technical problem of frequent control misalignment and size mismatch when converting design data into engine parameters. Attached Figure Description

[0023] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0024] Figure 1 This is a schematic diagram of an application environment for an optional interface layout generation method according to an embodiment of this application;

[0025] Figure 2 This is a flowchart illustrating an optional method for generating an interface layout according to an embodiment of this application.

[0026] Figure 3 This is a schematic diagram of an optional interface layout generation method according to an embodiment of this application;

[0027] Figure 4 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0028] Figure 5 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0029] Figure 6 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0030] Figure 7 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0031] Figure 8 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0032] Figure 9 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0033] Figure 10 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0034] Figure 11 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0035] Figure 12 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0036] Figure 13 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0037] Figure 14 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0038] Figure 15 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0039] Figure 16 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0040] Figure 17 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0041] Figure 18 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0042] Figure 19 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0043] Figure 20 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0044] Figure 21This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0045] Figure 22 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0046] Figure 23 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0047] Figure 24 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0048] Figure 25 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0049] Figure 26 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0050] Figure 27 This is a schematic diagram of another optional interface layout generation method according to an embodiment of this application;

[0051] Figure 28 This is a schematic diagram of an optional interface layout generation device according to an embodiment of this application;

[0052] Figure 29 This is a schematic diagram of the structure of a generated product based on an optional interface layout according to an embodiment of this application;

[0053] Figure 30 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0054] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0055] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0056] To better understand the technical solutions provided in the embodiments of this application, the key terms involved in the embodiments of this application will be introduced first:

[0057] UI (User Interface): The interface through which users interact with virtual devices. In this context, it mainly refers to the interface in games, through which players can control game characters, open their inventory, and perform other game functions.

[0058] UI controls: The smallest elements in a UI interface, such as buttons, text boxes, scroll boxes, etc.

[0059] The present application will be described below with reference to embodiments:

[0060] According to one aspect of the embodiments of this application, a method for generating an interface layout is provided. Optionally, in this embodiment, the above-described interface layout generation method can be applied to, for example, Figure 1 The hardware environment shown consists of server 101 and terminal device 103. For example... Figure 1As shown, server 101 is connected to terminal device 103 via a network and can be used to provide services to terminal device or application 107 installed on terminal device. The application can be video application, instant messaging application, browser application, educational application, game application, etc. Database 105 can be set up on the server or independently of the server to provide data storage services for server 101, such as a game data storage server. The network mentioned above can include, but is not limited to, wired networks and wireless networks. The wired network includes local area networks, metropolitan area networks, and wide area networks. The wireless network includes Bluetooth, WIFI, and other networks that enable wireless communication. Terminal device 103 can be a terminal configured with an application, and can include, but is not limited to, at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), laptops, tablets, handheld computers, MID (Mobile Internet Devices), PADs, desktop computers, smart TVs, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, virtual reality (VR) terminals, augmented reality (AR) terminals, mixed reality (MR) terminals, and other computer devices. The server mentioned above can be a single server, a server cluster composed of multiple servers, or a cloud server.

[0061] Combination Figure 1 As shown, the above-mentioned interface layout generation method can be executed by an electronic device, which can be a terminal device or a server. The above-mentioned interface layout generation method can be implemented by the terminal device or the server respectively, or by the terminal device and the server together.

[0062] The above is merely an example, and this embodiment does not impose any specific limitations.

[0063] In one exemplary embodiment, the application framework of this application is as follows: Figure 1 As shown, the automated generation of the interface layout is achieved through four core steps, S1 to S4. The following section, in conjunction with the appendix... Figure 1 The technical steps will be explained in detail:

[0064] S1: Design Data Acquisition: The terminal device extracts structured data from the design tools, including the absolute position, relative size, and layer nesting relationships of controls. For example, the shape parameters of a button control include its top-left corner coordinates, width, and height values; the layer relationships describe the layers it belongs to. The terminal device encapsulates the data in JSON or XML format and transmits it to the server over the network.

[0065] S2: Container category determination. The server analyzes the topology of the layer relationships to identify the container type to which the control belongs.

[0066] S2-1, Single Container Control: Contains only a single child control slot. For example, a checkbox control can only hold one text label child control, and its layer relationship presents a one-to-one mapping between parent and child nodes.

[0067] S2-2, Multi-container controls: Supports dynamic arrangement of multiple child controls. For example, the layer relationship of a horizontal box control is represented by multiple parallel child nodes attached to a parent node. The server completes the classification by traversing the layer tree hierarchy and combining it with a preset control type feature library (such as the check mark icon for a checkbox).

[0068] S3: Slot parameter conversion; the server invokes a differentiated conversion strategy based on the container type.

[0069] S3-1. For a single-container control (such as a zoom box control), extract the relative position difference between the child control and the container, and calculate the alignment mode (such as horizontal left / center / right offset parameters and vertical up / center / down offset parameters) to determine the alignment mode (such as horizontal left alignment and vertical top alignment).

[0070] S3-1, for multi-container controls (such as canvas controls), perform dynamic region division based on slot type (such as horizontal frame slot, vertical frame slot). For example, when a horizontal frame control traverses its child controls, it generates an independent horizontal offset parameter and width percentage for each child control based on the total width of the container, the width of the child control, and the fill factor.

[0071] S4: Interface Layout Generation: The terminal device receives the slot parameter set returned by the server and converts it into layout code supported by the target engine. The final generated target interface layout is rendered and previewed in real time in the terminal device's application, and supports secondary verification and manual fine-tuning.

[0072] Through the aforementioned architecture and process, this application reduces the need for manual intervention in design draft parsing and layout adaptation by implementing rule-based processing of container classification and parameter conversion on the server side. Based on a pre-built multi-engine rule library in the database, it ensures that the generated slot parameters are compatible with different platform layout engines such as Android, iOS, and Web. Precise calculation of offsets for single-container controls and dynamic area division for multi-container controls effectively prevent control misalignment and size adaptation anomalies. The terminal device is responsible for data acquisition and interface rendering, while the server centrally handles computationally intensive tasks, improving overall operational efficiency through load balancing.

[0073] This application utilizes the collaborative operation of terminal devices, servers, and databases to transform design data into layout parameters recognizable by the engine, achieving end-to-end automated generation from design drafts to multi-platform interface layouts. This solution is particularly suitable for cross-platform application development scenarios requiring frequent iterations, significantly reducing interface development costs and improving visual consistency.

[0074] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the method for generating the above interface layout includes:

[0075] S202, Displays the design data used to generate the interface layout, wherein the design data includes the shape parameters of the controls in the interface layout and the layer relationships;

[0076] Optionally, in this embodiment, the design data may include, but is not limited to, the original dataset used to describe the attributes and hierarchical relationships of interactive interface elements, including but not limited to structured files output by design tools. The design data fully records the visual characteristics and logical structure of the interface elements. For example, in a PSD file, each layer contains the coordinates (X / Y), size (W / H), transparency, and parent-child nesting relationships of controls. This data includes both static visual information (such as the rectangular area definition of a button) and implicit layout logic (such as the layer stacking order determining display priority). Taking a game settings interface as an example, the design data may include the coordinates (200, 150), size (100×40), and hierarchical relationship of the sound effect switch control as a sub-layer of the background panel.

[0077] For example, the design data mentioned above may include, but is not limited to, PSD files, which are resource files saved by Photoshop that can store all the operations a UI designer has performed on an image. A PSD file contains multiple layer files, and these layers can be nested; for example, layer A can contain layer B, and layer B can contain layer C.

[0078] Optionally, in this embodiment, the shape parameters may include, but are not limited to, quantitative indicators describing the geometric features of the interface control, including but not limited to coordinates (X / Y), dimensions (W / H), rotation angle, and corner radius. Shape parameters define the spatial occupancy and shape characteristics of the control in a two-dimensional plane. For example, the rectangular area of ​​the login button is determined by the coordinates of its upper left corner (120, 240), a width of 160 pixels, and a height of 40 pixels. During the conversion from PSD to UMG, the shape parameters need to be dynamically converted according to the container type. For example, for a Canvas control, the coordinates of the child control are directly mapped to absolute positions; for a ScrollBox control, the coordinates need to be converted to the relative offset of the scrolling container. In the technical implementation, the processing of shape parameters needs to be combined with the layout rules of the parent container for coordinate system transformation.

[0079] Optionally, in the embodiments of this application, the aforementioned layer relationships may include, but are not limited to, topological data describing the hierarchical structure of interface elements, including but not limited to parent-child nesting, sibling parallel arrangement, and occlusion order. Layer relationships determine the layout dependency and display priority of controls. For example, in the backpack interface, the item icon is a sub-layer of the background panel, and its coordinates need to be calculated relative to the upper left corner of the panel; while the highlighted border, as a sibling node of the layer, needs to be displayed superimposed on top of the icon.

[0080] For example, step 202 completes the data input from the design tool to the layout generation system. Shape parameter extraction involves parsing layer attributes of files such as PSDs, for example, reading the X=120, Y=240 coordinates and W=160, H=40 dimensions of the button layer through the Photoshop script interface. Layer relationship parsing requires constructing a tree structure model and identifying the parent-child nesting relationship of controls: for example, the background panel of the login interface is the root node, and its child nodes include the account input box, password input box, and login button. Technically, a recursive traversal algorithm can be used to extract the list of child nodes of each layer layer by layer and record their occlusion order. Figure 3 As shown, a typical application case is as follows: In the game lobby interface, the system parses 50 nested layers of the PSD file and generates JSON structured data containing position, size and hierarchical relationship. This structured data includes at least layer 1, layer 2 and layer 3, where layer 2 is a sublayer of layer 1 and layer 3 is a sublayer of layer 2. This part is only an example.

[0081] It should be noted that there are various ways to obtain design data. In addition to PSD files, it can support JSON design specifications exported from Figma and cloud collaboration file synchronization of Adobe XD. It can also extrude and parse vector path data (such as Bézier curve controls) or dynamic effect parameters (such as gradient animation keyframes). It can support the addition of new design tool formats in the future through a plugin architecture. This application does not make specific limitations on this.

[0082] S204. Determine the container category of the control based on the layer relationship in the design data. The container category includes single-container controls and multi-container controls. A single-container control is allowed to contain one child control with a control slot, and a multi-container control is allowed to contain at least two child controls with control slots.

[0083] Optionally, in this embodiment, the container category may include, but is not limited to, a classification system for the layout capabilities of interface controls, including, but not limited to, the rules for dividing single-container controls and multi-container controls. A single-container control refers to a container type that only allows one child control (such as Button, CheckBox), and its layout rules define the padding and alignment of the child control through slots. Multi-container controls support the collaborative layout of multiple child controls (such as HorizontalBox, ScrollBox), and their layout rules need to handle the space allocation relationship between child controls. For example, in the character attribute interface, the equipment bar, as a single-container control, only accommodates one equipment icon, while the skill bar, as a multi-container control, needs to manage the horizontal arrangement of multiple skill icons. The determination of the container category directly affects the subsequent slot parameter conversion strategy.

[0084] Optionally, in the embodiments of this application, the aforementioned single-container control may include, but is not limited to, container types with the capacity to hold a single sub-control, including but not limited to controls such as Button, Border, and SafeZone. Figure 4 As shown, this type of control defines the layout rules of its child controls through specific slot types (such as ButtonSlot). A typical feature is that it forces child controls to maintain a dynamic fit with the container boundaries. For example, in a game, the confirmation button (Button) is a single-container control, and the size of its child controls (such as text labels) automatically adjusts according to the size of the container: when the button size expands, the text label stretches through a fill mode to fill the container space. In the technical implementation, the slot parameter conversion of a single-container control requires careful calculation of the margin offset between the child controls and the container to ensure that the absolute coordinates in the PSD can be mapped to the relative layout parameters in the engine.

[0085] Optionally, in this embodiment, the aforementioned multi-container control may include, but is not limited to, container types that support the collaborative layout of multiple child controls, including but not limited to controls such as HorizontalBox, VerticalBox, and Overlay. Figure 5 As shown, the layout rules for this type of control need to comprehensively consider the space competition relationship between child controls. The horizontal box allocates the remaining space according to the fill weight of the child controls, including child control 1 and child control 2. The two child controls are arranged in a corresponding manner. For example, in an online store interface, the product list, as a multi-container control, needs to dynamically arrange the size and spacing of multiple product cards: if a card is set to fill weight 2, its width will be twice that of a card with fill weight 1. In terms of technical implementation, the slot parameter conversion of multi-container controls requires establishing a mapping model between the position of child controls and the remaining space of the container. By calculating the weight ratio and margin compensation value, it is ensured that the visual presentation is consistent with the design draft.

[0086] For example, step S204 automates the determination of container types. By analyzing the number of child nodes and control type characteristics of layer relationships, the system categorizes nodes. For instance, if a layer contains only one sublayer and its corresponding engine control is a Button, it is determined to be a single-container control; if it contains multiple parallel sublayers and their corresponding HorizontalBox controls, it is determined to be a multi-container control. Another example is in a task tracking interface where the task list, as a multi-container control, contains three parallel sublayers of task items, while the expand button for each task item, as a single-container control, only holds one arrow icon. In the technical implementation, a container type mapping table needs to be established to associate the PSD layer name suffix with the engine control type (HorizontalBox) to improve the accuracy of the determination.

[0087] S206, convert the shape parameters in the design data into slot parameters corresponding to the control slots according to the container category. The slot parameters are used to indicate the position of the corresponding control in the target engine.

[0088] Optionally, in this embodiment, the aforementioned control slots may include, but are not limited to, a set of parameters in the container control used to define the layout rules of child controls, including but not limited to attributes such as padding, alignment, and size mode (Auto / Fill). Slot parameters determine the space allocation strategy of child controls within the container. For example, the child control slots of a horizontal box include a fill factor used to calculate the width ratio of multiple child controls. In a skill bar layout scenario, the fill factor of the skill icon slot is set to 1, ensuring that it occupies the remaining space proportionally when the container expands. The automatic generation of slot parameters requires combining the shape parameters and container type in the design data, and using a specific algorithm to map coordinates to layout rules.

[0089] For example, in a UMG interface, the relative position information of a child control within its parent control is displayed. It has various settings such as offset and alignment, which determine an anchor point and size to calculate the child control's position and size relative to its parent control. Only single-container and multi-container controls can have child controls, and each of their child controls has a corresponding type slot to record its position and size.

[0090] Optionally, in this embodiment, the slot parameters may include, but are not limited to, a set of specific values ​​describing the layout rules of child controls within the container, including but not limited to horizontal margins, vertical margins, and fill weights. Slot parameters are the core bridge connecting design data and engine layout. For example, the coordinate difference (30, 15) of the button layer in the PSD can be converted into a left margin of 30 and a top margin of 15 for the Button control. In multi-container scenarios, slot parameters also need to include space allocation weights. For example, in the character attribute panel, the fill weights for the health bar and mana bar are 0.6 and 0.4 respectively, ensuring that their widths are adjusted proportionally when the container expands.

[0091] For example, taking Unreal Engine as an example, the following operation parameters may be included but are not limited to:

[0092] Auto: Automatic, a value for the Size property in the slot. Size describes the size of a child control relative to its parent control. Auto means that regardless of the size of the parent control, the child control will maintain the exact size of its own content. For example, if the child control is a 30x30 pixel image, it will remain 30x30 pixels even if placed inside a 100x100 parent control. When set to Auto, the size of UI elements will automatically adjust according to their content. That is, the element's size will be just enough to contain its content, with no extra space. For example, if a button set to Auto contains text, the button's size will be just enough to contain the text.

[0093] Fill: A value for the Size property in a slot. Corresponds to Auto. When set to Fill, child controls will fill the remaining space of the parent control as much as possible. When set to Fill, UI elements will fill the remaining space of their parent elements as much as possible. The specific filling method depends on the element's Fill Weight property. Fill Weight determines the proportion of the remaining space occupied by the element. For example, if a Stack Panel contains two buttons set to Fill, and both have a Fill Weight of 1, then the two buttons will evenly distribute the remaining space of the Stack Panel. If one button has a Fill Weight of 2 and the other has a Fill Weight of 1, then the first button will occupy 2 / 3 of the remaining space, and the second button will occupy 1 / 3 of the remaining space.

[0094] Optionally, in this embodiment, the target engine may include, but is not limited to, a graphics engine system used for rendering interactive interfaces, including, but not limited to, game development platforms such as Unreal Engine, Unity, and Cocos. The target engine achieves interface visualization through specific control systems and layout rules. For example, Unreal's UMG system uses control types such as CanvasPanel and VerticalBox, while Unity's UGUI system uses RectTransform and LayoutGroup components. The technical solution needs to adapt to the API interfaces of different engines, such as converting slot parameters into Unreal's properties or Unity's configurations, to ensure that the generated interface layout meets the rendering requirements of the engine.

[0095] For example, step S206 executes a layout parameter conversion algorithm. For single-container controls (such as Button), the slot parameter conversion requires calculating the perimeter margins of the child controls. For multi-container controls (such as HorizontalBox), the fill factor of the child controls needs to be calculated. Taking an online store product list as an example, if the parent container width is 600 pixels and the widths of the three child controls are 150, 150, and 200 pixels respectively, then the fill factors are 0.3, 0.3, and 0.4 respectively. In the technical implementation, boundary conditions (such as negative margins) and dynamic adaptation (such as maintaining the proportion when the size of the parent container changes) need to be handled.

[0096] S208 generates the target interface layout in the target engine based on slot parameters.

[0097] Optionally, in this embodiment, the target interface layout may include, but is not limited to, the final visual interface generated in the graphics engine, including but not limited to a complete instance of control hierarchy, position, size, and interaction logic. The target interface layout must strictly reproduce the visual effects and operational logic of the design draft. For example, the mall promotion module in the PSD can be converted into a HorizontalBox control in UMG (Unreal Motion Graphics), where product cards are automatically arranged according to the spacing parameters in the design data. In the technical verification stage, pixel-level comparison is required to ensure that the deviation between the engine rendering result and the control position in the design draft is less than a preset threshold (such as 2 pixels) to meet the visual consistency requirements. The aforementioned UMG represents the stored resources of the UI interface in the Unreal Engine, which may include special UI control elements such as buttons and scroll boxes, which can be adjusted and used by UI designers in the Unreal Engine to ultimately output a complete game UI interface.

[0098] It's important to note that the process of converting a PSD file to a UMG file is called forward conversion. Forward conversion ensures that changes made by UI designers in the PSD are synchronized in the UMG file. The tool used for this synchronization process can be PSD2UI, a custom tool that, as an engine plugin, can be embedded in the Unreal Engine to handle both forward and reverse conversion processes. Reverse conversion, on the other hand, is the opposite of forward conversion; it involves converting the UMG file to a PSD file.

[0099] For example, step S208 completes the interface visualization output. By calling the target engine's API interface, the slot parameters are instantiated into specific control properties. For instance, in the skill cooldown interface of an ARPG game, the system automatically generates a horizontally arranged box containing 5 skill icons, with the spacing and size of each icon strictly matching the design parameters, and outputs it as an interactive UMG interface through the engine rendering pipeline.

[0100] In one exemplary embodiment, such as Figure 6 As shown, taking the automatic generation of the character customization interface as an example, the process includes, but is not limited to, the following:

[0101] S602 extracts structured design data from the design tools. This data includes the geometric attributes and hierarchical relationships of interface controls. In the character customization interface scenario, the design data covers the shape parameters (coordinates, dimensions) and layer nesting relationships of controls such as the facial feature selection panel, clothing matching area, and confirmation button. The system identifies the layer tree structure through a parsing tool, for example, using the background panel as the root node, whose child nodes include horizontally arranged clothing icon groups, vertically arranged accessory option lists, and floating confirmation buttons. For complex controls (such as a scrollable and zoomable clothing preview window), the design data further includes dynamic interaction parameters (such as scaling limits) to ensure that the complete interaction logic is preserved during subsequent conversion processes.

[0102] S604, based on layer hierarchy, the system categorizes each control node by container type:

[0103] Single-container control determination: If a layer contains only one sublayer and the corresponding engine control type is Button, CheckBox, etc., it is marked as a single container. For example, if a confirmation button layer contains a single text label sublayer, the system maps it to a Button control in the Unreal Engine.

[0104] Multi-container control determination: If a layer contains multiple parallel sublayers and corresponds to types such as HorizontalBox or ScrollBox, it is marked as a multi-container. For example, a clothing icon group containing five parallel clothing thumbnails is mapped to a HorizontalBox control; an accessory option list containing scrollable content is mapped to a ScrollBox control. For nested containers (such as horizontally arranged boxes embedded within a canvas panel), the system recursively traverses child nodes, completing the container type labeling layer by layer.

[0105] S606, Execute a differentiated parameter conversion strategy based on container category:

[0106] Single-container control handling: Calculate the margin offset between child controls and the container. Taking the confirmation button as an example, the system generates left, top, right, and bottom margin parameters based on the coordinate difference between the text label layer and the button container, and sets the horizontal and vertical fill modes to ensure that the text label dynamically stretches with the button size.

[0107] Multi-container control handling: A weighted allocation and space compensation algorithm is employed. For the HorizontalBox control in the clothing icon group, the system calculates the fill factor for each clothing icon, distributing the remaining width proportionally when the parent container expands. For the ScrollBox control in the accessories list, the absolute coordinates of the child controls are converted to offsets relative to the scroll area, and vertical alignment is set to maintain spacing between list items. If a child control's size exceeds the container's visible area (e.g., a long text label), clipping or scrolling properties are automatically enabled.

[0108] S608 imports the converted slot parameters into the target engine to drive interface rendering. It creates engine control instances (such as HorizontalBox and Button) based on the container type and attaches them to the preset interface root node. Slot parameters are set for each control; for example, padding coefficients and margins are configured for the HorizontalBox child items of the clothing icon group, and margins and alignment modes are injected for the confirmation button. Interface rendering at different resolutions is simulated to verify layout stability. For example, when the screen width decreases, the clothing icon group automatically adjusts the icon spacing instead of compressing the size; when the confirmation button position is offset, anomaly detection is triggered and the system rolls back to the most recent valid parameter set. Control events are associated (such as clicking a clothing icon triggering a preview) to ensure the generated interface has complete functionality.

[0109] This embodiment achieves high-fidelity conversion of game interfaces from design drafts to the engine by automatically parsing design data, intelligently determining container types, and dynamically generating slot parameters. Structured parsing of design data ensures the complete transmission of the original visual intent, the container classification mechanism provides the execution basis for differentiated layout rules, and the parameter conversion algorithm solves the adaptation problem between absolute coordinates and relative layouts. The generated interface layout strictly reproduces the design effect, supports dynamic adaptation to multiple resolutions, and has native interactive functions. This solution significantly reduces the time spent on manual adjustments, eliminates version iteration problems caused by human error, and provides standardized support for the rapid development and cross-platform porting of complex game interfaces.

[0110] This application's embodiments employ a structured analysis of design data and a dynamic container classification mechanism. By integrating layer relationships and control attributes to construct multi-level parameter conversion rules, it achieves the goal of automatically generating high-precision interface layouts, thereby realizing a dual improvement in cross-engine adaptation efficiency and visual fidelity. Specifically, in the data analysis stage, by extracting control shape parameters (such as coordinates and dimensions) and layer hierarchy information output by the design tool, and combining them with a container category recognition model, controls are divided into single-container and multi-container structures, ensuring that the slot logic of sub-controls corresponding to different container types is processed independently. In the parameter conversion stage, a dynamic calculation mechanism for the offset of single-container controls is used. For multi-container controls, a dynamic derivation mechanism for slot type adaptation solves the problem of dynamic arrangement of sub-controls in complex nested containers. In the layout generation stage, the automatic matching of slot parameters with the target engine's layout logic ensures efficient conversion from design drafts to multi-platform interface layouts. This method significantly reduces the parameter conversion error of single-container controls and significantly improves the layout generation efficiency of multi-container controls. It also supports accurate cross-engine restoration of common controls such as buttons and scroll boxes, significantly reducing the number of manual adjustments and adaptation costs. This solves the technical problem of frequent control misalignment and size mismatch when converting design data into engine parameters.

[0111] As an alternative solution, such as Figure 7 As shown, the shape parameters in the design data are converted into the corresponding slot parameters for the control slots according to the container category, including:

[0112] S702-1, When the container category is a single container control, calculate the horizontal offset parameter of the child control in the horizontal direction and the vertical offset parameter in the vertical direction based on the shape parameters of the child control corresponding to the single container control and the shape parameters of the single container control. The shape parameters include horizontal offset value, vertical offset value, width and height.

[0113] S702-2, set the fill offset based on the horizontal offset parameter and the vertical offset parameter, set the alignment mode corresponding to the child control, and determine the slot parameters. The slot parameters include the fill offset and the alignment mode, and the alignment mode includes horizontal alignment and vertical alignment.

[0114] Optionally, in this embodiment, the aforementioned horizontal offset parameter may include, but is not limited to, the quantified value of the positional difference between the child control and the container control in the horizontal direction, including but not limited to the left boundary offset, right boundary offset, and center alignment deviation value. The horizontal offset parameter is used to determine the horizontal positioning of the child control within the container. For example, the product price tag in the e-commerce interface is offset by 30 pixels from the left boundary and -20 pixels from the right boundary relative to the parent container (background panel) (meaning it exceeds the right boundary of the container by 20 pixels). The calculation of this parameter needs to be combined with the coordinate system of the design draft and the layout rules of the target engine, such as converting the absolute coordinate difference in the PSD into the padding margin of the Unreal Engine.

[0115] Optionally, in this embodiment, the vertical offset parameter may include, but is not limited to, the quantified value of the positional difference between the child control and the container control in the vertical direction, including but not limited to the top offset, bottom offset, and vertical center alignment deviation. The vertical offset parameter determines the vertical positioning of the child control within the container. For example, the progress bar of the task tracking interface is offset by 50 pixels from the top and 10 pixels from the bottom relative to the parent container (task panel). In the technical implementation, the vertical offset parameter needs to consider the influence of the container type. For example, the child elements of a checkbox need to be vertically centered, while the child elements of a scrollbox need to calculate the dynamic offset relative to the scrolling area.

[0116] Optionally, in this embodiment, the aforementioned fill offset may include, but is not limited to, a set of spacing parameters between the boundaries of the child control and the container control, including but not limited to margin values ​​in the left, right, top, and bottom directions. The fill offset is used to achieve precise positioning of the child control in the engine. For example, the skill icon in the character's skill bar needs to be 20 pixels from the left side and 10 pixels from the top of the parent container, with no gaps on the right side and bottom. The calculation of the fill offset needs to comprehensively consider the coordinate difference of the design draft and the layout mode of the target engine (such as fill mode or fixed size mode) to ensure visual presentation and design intent. Figure 1 To.

[0117] Optionally, in this embodiment, the alignment mode may include, but is not limited to, a set of rules defining the positioning direction of the sub-control within the container, including but not limited to horizontal left alignment, center alignment, and right alignment, and vertical top alignment, center alignment, and bottom alignment. The alignment mode determines the reference positioning point of the sub-control. For example, the title text of the game's main menu needs to be horizontally centered and vertically top aligned to adapt to different resolutions. In technical implementation, the alignment mode needs to work in conjunction with the fill offset. For example, horizontal left alignment combined with a left fill offset of 30 pixels can achieve precise horizontal positioning of the sub-control.

[0118] For example, step S702-1 acquires the geometric data of a single container control and its child controls. The system extracts the coordinates, dimensions, and relative position data of the container control and its child controls by parsing the layer attributes of the design file (such as PSD). For example, in a game's task reward pop-up window, the container control (confirm button) has coordinates (500, 800) and dimensions (200×60), while its child control (“Claim” text label) has coordinates (520, 810) and dimensions (160×40). The system calculates the coordinate difference (520-500=20, 810-800=10) to obtain the relative position of the child control, providing basic data for subsequent offset parameter calculations. This process must ensure the correct parsing of layer nesting relationships to avoid data extraction deviations due to layer errors. The horizontal offset parameter is calculated using the coordinate difference between the left boundary of the child control and the left boundary of the container, and the vertical offset parameter is calculated using the coordinate difference between the top of the child control and the top of the container. For example, if the container control has coordinates (100, 200) and a size of 300×400, and the child control has coordinates (150, 250) and a size of 100×50, then the horizontal offset parameter is 150 - 100 = 50 pixels, and the vertical offset parameter is 250 - 200 = 50 pixels. For special scenarios (such as when the child control extends beyond the container boundary), a negative offset needs to be calculated. For example, if the right boundary of the child control extends 20 pixels beyond the right boundary of the container, the horizontal offset parameter is (child control X + child control W) - (container X + container W) = negative offset.

[0119] Step S702-2 converts the geometric parameters into layout rules recognizable by the engine. The fill offset is a combination of horizontal (left, right) and vertical (top, bottom) offsets, for example, a horizontal left offset of 50 pixels, a right offset of -20 pixels, a vertical top offset of 50 pixels, and a bottom offset of 0 pixels. The alignment mode is selected based on the design intent, such as horizontal left alignment and vertical top alignment. In the game store's purchase button scenario, the system generates a left fill offset of 30 pixels and a top fill offset of 10 pixels for the price tag, and sets horizontal left alignment and vertical center alignment to ensure the tag is left-aligned and vertically centered within the button container.

[0120] It should be noted that the combination strategy of fill offset and alignment mode can be configured in various ways. In terms of offset calculation, it supports the mixed use of percentage offset (such as filling the left side with 10% of the container width) and absolute offset; in terms of alignment mode, it can be extended to diagonal alignment (such as top left alignment, bottom right alignment) and dynamic alignment (automatically switching the alignment method according to the content length); in terms of exception handling, it is possible to set the child controls of the overflow container to automatically enable cropping or scrolling display, but this application does not make specific limitations on this.

[0121] This application's embodiments utilize precise extraction of shape parameters from a single container control and its child controls, combined with dynamic calculation of fill offsets and alignment modes based on container categories, to achieve high-fidelity layout conversion from design drafts to the engine interface. Automated extraction of shape parameters ensures the complete transmission of design intent; the calculation of offset parameters and generation of fill rules solve the adaptation problem between absolute coordinates and relative layouts; and intelligent configuration of alignment modes guarantees visual consistency of child controls within the container. This solution significantly improves interface development efficiency, reduces the risk of errors caused by manual intervention, and supports flexible adaptation across design tools and multi-engine platforms, providing a reliable technical foundation for rapid iteration and standardized production of game interfaces.

[0122] As an optional approach, the slot parameters corresponding to the control slots are determined based on the container category and shape parameters, including:

[0123] When a single container control includes at least one of a button control, a safe area control, a size box control, and a bounding box control, a left offset parameter is determined based on the horizontal offset value of the child control corresponding to the single container control and the horizontal offset value of the single container control, and a right offset parameter is determined based on the horizontal offset value and width of the child control and the horizontal offset value and width of the single container control, wherein the horizontal offset parameter includes a left offset parameter and a right offset parameter.

[0124] The top offset parameter is determined based on the vertical offset value of the child control and the vertical offset value of the single container control, and the bottom offset parameter is determined based on the vertical offset value and height of the child control and the vertical offset value and height of the single container control. The vertical offset parameter includes the top offset parameter and the bottom offset parameter.

[0125] Set the fill offset based on the left offset, right offset, top offset, and bottom offset parameters, and set the alignment mode of the child controls to horizontal and vertical fill to determine the slot parameters.

[0126] Optionally, in this embodiment, the aforementioned single-container control may include, but is not limited to, container types that have the capacity to hold a single child control and support specific layout rules, including but not limited to button controls, safezone controls, sizebox controls, and border controls. The common feature of these controls is that they force child controls to dynamically adapt to the container boundary through slots. For example, in a game settings interface, a button control is used to hold a volume adjustment text label, a safezone control is used to adapt to the display safety range of different device screens, a sizebox control is used to limit the display area of ​​skill icons, and a border control is used to add decorative borders to the character attribute panel.

[0127] Optionally, in this embodiment, the horizontal offset value may include, but is not limited to, the position coordinates of the control in the horizontal direction (X-axis) in the design data, including but not limited to the horizontal distance of the upper left corner of the control relative to the origin of the design draft. The horizontal offset value is used to calculate the horizontal relative position relationship between the child control and the container. For example, in an online store interface, the horizontal offset value of the product price tag is 200 pixels, indicating that its upper left corner is 200 pixels away from the left edge of the design draft. For container controls, the horizontal offset value defines its positioning reference point in the parent container. For example, the horizontal offset value of the safe zone control is 50 pixels, indicating that its left side is 50 pixels away from the left edge of the screen.

[0128] Optionally, in this embodiment, the aforementioned left offset parameter may include, but is not limited to, the quantized value of the horizontal distance between the left edge of the child control and the left edge of the container control in the target engine, calculated by subtracting the horizontal offset value of the container from the horizontal offset value of the child control. For example, if the horizontal offset value of the container control is 100 pixels and the horizontal offset value of the child control is 130 pixels, then the left offset parameter is 30 pixels, indicating that the left side of the child control is 30 pixels away from the left edge of the container. In the character creation interface, the left offset parameter of the hairstyle selection button is 20 pixels to ensure that it maintains a fixed distance from the left side of the parent container (panel background). The aforementioned right offset parameter may include, but is not limited to, the quantized value of the horizontal distance between the right edge of the child control and the right edge of the container control, calculated by the formula (horizontal offset value of the child control + width of the child control)(horizontal offset value of the container + width of the container). For example, if the container width is 300 pixels and the horizontal offset value is 100 pixels, and the child control width is 80 pixels and the horizontal offset value is 250 pixels, then the right offset parameter is (250+80)-(100+300)=70 pixels, indicating that the right side of the child control exceeds the right edge of the container by 70 pixels. In the backpack interface, the item quantity label is offset to the right by 10 pixels to achieve the visual effect of partially hovering outside the container.

[0129] Optionally, in this embodiment, the aforementioned vertical offset value may include, but is not limited to, the position coordinates of the control in the vertical direction (Y-axis) in the design data, including but not limited to the vertical distance of the upper left corner of the control relative to the origin of the design draft. The vertical offset value is used to calculate the vertical relative position relationship between the sub-control and the container. For example, the vertical offset value of the progress bar in the task tracking interface is 400 pixels, indicating that its top is 400 pixels away from the top boundary of the design draft. For container controls, the vertical offset value defines its vertical positioning reference. For example, the vertical offset value of the size box control is 150 pixels, indicating the distance between its top and the top of the screen.

[0130] Optionally, in this embodiment, the aforementioned top offset parameter may include, but is not limited to, the quantized vertical distance between the top boundary of the child control and the top boundary of the container control in the target engine, calculated by subtracting the vertical offset value of the container from the vertical offset value of the child control. For example, if the vertical offset value of the container is 200 pixels and the vertical offset value of the child control is 220 pixels, then the top offset parameter is 20 pixels, indicating that the top of the child control is 20 pixels away from the top boundary of the container. In the game's main menu, the top offset parameter of the start button is 50 pixels to ensure that it has breathing space with the top of the background panel. The aforementioned bottom offset parameter may include, but is not limited to, the quantized vertical distance between the bottom boundary of the child control and the bottom boundary of the container control, calculated by the formula (vertical offset value of the child control + height of the child control)(vertical offset value of the container + height of the container). For example, if the container height is 500 pixels and the vertical offset value is 100 pixels, and the child control height is 60 pixels and the vertical offset value is 520 pixels, then the bottom offset parameter is (520+60)-(100+500)=20 pixels, indicating that the bottom of the child control exceeds the bottom boundary of the container by 20 pixels. In the skill cooldown interface, the bottom offset parameter of the timer label is set to 15 pixels to achieve a bottom hovering tooltip effect.

[0131] Optionally, in this embodiment, the horizontal fill can include, but is not limited to, a layout mode in the target engine where child controls are stretched horizontally to fill the remaining space of the container, including, but not limited to, forcing the width of the child control to match the available width of the container. In the horizontal fill mode, the actual width of the child control is determined by the container width minus the sum of the left and right offset parameters. For example, in a game dialog interface, the text content area is set to horizontal fill, with left and right offset parameters of 20 pixels and 10 pixels respectively, and the actual width is the container width (20 + 10) = the container width 10 pixels, ensuring that the text area adapts to changes in container size. The vertical fill can include, but is not limited to, a layout mode where child controls are stretched vertically to fill the remaining space of the container, including, but not limited to, forcing the height of the child control to match the available height of the container. In the vertical fill mode, the actual height of the child control is determined by the container height minus the sum of the top and bottom offset parameters. For example, in a character status interface, the health bar control is set to vertical fill, with a top offset parameter of 10 pixels and a bottom offset parameter of 5 pixels, and the actual height is the container height (10 + 5) = the container height 15 pixels, ensuring that the health bar dynamically adjusts with the container height.

[0132] For example, taking a button control as an example, such as Figure 8As shown, the layer properties of the container and its child controls in the design draft are analyzed to extract core parameters such as coordinates (X / Y) and dimensions (W / H). For example, in the game achievement interface, the coordinates of the bounding box control are (150, 200) and its size is 400×300, while the coordinates of its child control (achievement icon) are (170, 220) and its size is 60×60. The system determines the initial relative position of the child control by comparing the coordinate differences (170-150=20, 220-200=20). The left offset parameter reflects the distance between the left side of the child control and the left side of the container. For example, if the horizontal offset value of the child control is 250 pixels and the horizontal offset value of the container is 200 pixels, then the left offset parameter is 50 pixels. The right offset parameter is calculated by the difference between the right boundary of the container (container horizontal offset + container width) and the right boundary of the child control (child control horizontal offset + child control width). If the container width is 300 pixels and the child control width is 100 pixels, then the right offset parameter is (250 + 100) - (200 + 300) = 150 pixels, indicating that the child control extends 150 pixels beyond the container on the right. In the layout of promotional labels in an online store, this calculation ensures that dynamic price labels always fit the right boundary of the container. The top offset parameter is obtained by subtracting the container's vertical offset value from the child control's vertical offset value. For example, if the child control's vertical offset value is 350 pixels and the container's vertical offset value is 300 pixels, then the top offset parameter is 50 pixels. The bottom offset parameter is calculated using the difference between the bottom boundary of the container (container vertical offset + container height) and the bottom boundary of the child control (child control vertical offset + child control height). If the container height is 250 pixels and the child control height is 80 pixels, then the bottom offset parameter is (350 + 80) - (300 + 250) = 120 pixels, indicating that the bottom of the child control extends 120 pixels beyond the container. In the game tutorial prompt box, this parameter can be used to control the spacing between the text content and the bottom of the container. The fill offset consists of the left, right, top, and bottom offset values, for example, a left offset of 30 pixels, a right offset of 20 pixels, a top offset of 10 pixels, and a bottom offset of 5 pixels. The alignment mode is set to horizontal and vertical fill, forcing the child control to stretch to fit the container space. In the game task reward pop-up, the slot parameters for the confirmation button are set to a left offset of 20 pixels, a right offset of 0 pixels, a top offset of 15 pixels, and a bottom offset of 0 pixels. The horizontal and vertical fill modes ensure that the button text is always centered and fills the container area at different resolutions, while the size frame plugin is basically the same as the button control.

[0133] In addition, if it is a safe zone control, such as Figure 9 As shown, H alignment is the aforementioned horizontal alignment mode, and V alignment is the aforementioned vertical alignment mode. The fill offset value and the alignment mode related to V alignment and H alignment are set by calculating the corresponding parameters.

[0134] It should be noted that the calculation strategy for offset parameters can be adjusted according to layout requirements. In terms of calculation, percentage offsets can be introduced (e.g., a left offset of 5% of the container width); in terms of dynamic scenes, horizontal and vertical offset parameters can be automatically converted in conjunction with screen rotation; in terms of exception handling, automatic scaling or line wrapping can be enabled for child controls that exceed the container's width, though this application does not impose specific limitations on this. The combination of fill and alignment modes is extensible. In terms of modes, horizontal fill overlay with vertical center alignment can be supported; in terms of hybrid layouts, fixed edge offsets (e.g., a fixed 20 pixels on the left) and right fill can coexist; in terms of cross-engine adaptation, it can be mapped to layout properties of different engines (e.g., Unity's AnchorPreset), though this application does not impose specific limitations on this.

[0135] This application's embodiments extract the shape parameters of the container control and its child controls, and combine them with a horizontal and vertical offset calculation model and fill layout rules to achieve high-precision conversion from design drafts to the engine interface. Dynamic calculation of left / right and top / bottom offset parameters ensures the accurate positioning of child controls within the container; forced adaptation of horizontal and vertical fill modes eliminates layout misalignment issues caused by changes in container size. This solution significantly improves the development efficiency of complex game interfaces, reduces manual calibration costs, and supports flexible access to multiple design tool data sources and consistent output across engine rendering, providing reliable technical support for standardized production and rapid iteration of interactive interfaces.

[0136] As an optional approach, the slot parameters corresponding to the control slots are determined based on the container category and shape parameters, including:

[0137] When a single container control includes a checkbox control, the left offset parameter is determined based on the horizontal offset value of the child controls of the checkbox control, the horizontal offset value of the checkbox icon, and its width.

[0138] The top offset parameter is determined based on the vertical offset and height of the child control and the vertical offset and height of the check box control, wherein the vertical offset parameter includes the top offset parameter;

[0139] Set the fill offset based on the left offset and top offset parameters, and set the alignment mode of the child control to vertical center alignment and horizontal left alignment, and determine the slot parameters.

[0140] Optionally, in the embodiments of this application, the checkbox control may include, but is not limited to, a single-container control that supports binary selection (such as selected / unselected) by the user, including but not limited to interactive elements such as task completion status markers and setting toggles. Such controls typically include a default checkbox icon and user-defined sub-controls (such as text labels). For example, in a game task interface, a checkbox used to indicate whether a task is completed has a checkbox icon on the left and a task description text on the right.

[0141] Optionally, in this embodiment, the sub-controls may include, but are not limited to, user-added elements within the checkbox container other than the default checkmark, including but not limited to text labels, icons, or images. For example, in a game achievement system, the sub-controls of the checkbox may be the achievement name text and the reward icon, both of which need to be dynamically adjusted in layout according to the position of the checkmark.

[0142] Optionally, in this embodiment, the checkmark pattern may include, but is not limited to, the default graphic element representing the selected state in the checkmark control, including but not limited to a checkmark icon, a square, or a circular selector. For example, in the sound effect switch control of the game settings interface, the checkmark pattern may be a graphic element that is an empty square when not selected and a solid square when selected.

[0143] Optionally, in this embodiment, the horizontal offset value may include, but is not limited to, the absolute position value of the upper left corner of the control in the horizontal direction (X-axis). For example, the horizontal offset value of the checkmark pattern is 105 pixels, indicating that its left side is 105 pixels away from the origin of the design draft; the horizontal offset value of the sub-control text label is 130 pixels, indicating that its left side is 130 pixels away from the origin.

[0144] Optionally, in this embodiment, the left offset parameter may include, but is not limited to, the horizontal spacing value between the left side of the sub-control and the right side of the check mark. For example, if the right boundary of the check mark is 125 pixels (105+20) and the horizontal offset value of the left side of the sub-control is 130 pixels, then the left offset parameter is 5 pixels (130-125), indicating that the text label is 5 pixels apart from the check mark.

[0145] Optionally, in this embodiment, the vertical offset value may include, but is not limited to, the absolute position value of the top-left corner of the control in the vertical direction (Y-axis). For example, the vertical offset value of the checkbox control is 200 pixels, and the vertical offset value of the child control text label is 205 pixels. The difference between the two is used to calculate the vertical alignment parameter.

[0146] Optionally, in this embodiment, the top offset parameter may include, but is not limited to, the compensation value of the top of the child control relative to the vertical center line of the checkbox container. For example, if the vertical center line of the checkbox container is located at 220 pixels (200+40 / 2), the vertical offset value of the top of the child control is 205 pixels and the height is 20 pixels, then the top offset parameter is -5 pixels (205+10-220), indicating that it needs to be offset upwards by 5 pixels to achieve vertical centering.

[0147] For example, such as Figure 10As shown, the coordinates and dimensions of the checkbox container, checkmark icon, and child controls are parsed from the design file. For example, in the game's mission tracking interface, the checkbox container has coordinates (100, 200) and a size of 300×40 pixels; the checkmark icon has coordinates (105, 205) and a size of 20×20 pixels; and the mission description text has coordinates (130, 205) and a size of 250×20 pixels. By separating and extracting these three types of data, the system constructs a complete layout relationship model. The spacing between the left side of the child control and the right side of the checkmark icon is calculated. For example, if the checkmark icon has a horizontal offset of 105 pixels and a width of 20 pixels, its right boundary is 125 pixels; if the child control has a horizontal offset of 130 pixels, then the left offset parameter is 130-125=5 pixels. In the game store's filter control, this parameter ensures that the price range label and the checkmark icon are spaced 5 pixels apart to avoid visual overlap. The compensation value required for vertical centering of the child control is calculated. For example, if the checkbox container is 40 pixels high and has a vertical offset of 200 pixels, its vertical center line is 220 pixels; and the child control is 20 pixels high and has a vertical offset of 205 pixels, its vertical center point is 215 pixels (205+10), then the top offset parameter is 215-220=-5 pixels, meaning the child control needs to be moved up 5 pixels to achieve centering. The left offset of 5 pixels and the top offset of -5 pixels are converted into padding margins, and the child control is forced to be left-aligned to the right side of the checkbox and vertically centered within the container. For example, in a game's character skill interface, the slot parameters for the skill description text are set to left padding of 5 pixels and top padding of -5 pixels. Horizontal left alignment ensures the text is flush with the checkbox, and vertical center alignment eliminates visual distortion.

[0148] It should be noted that the design and layout of the checkbox control are highly versatile. In terms of the checkbox icon, animated icons (such as rotating loading icons) or custom graphics can be supported; in terms of sub-controls, multi-line text, composite icon groups, or progress bars can be included; in terms of layout, it can adapt to right-to-left arrangement (such as Arabic interfaces) or top-to-bottom arrangement, and this application does not impose any specific limitations on this.

[0149] This application's embodiments utilize the extracted composite structure parameters of checkbox controls and dynamically generate slot parameters based on the relative positions of the checkbox icon and its child controls, achieving automated generation of complex checkbox layouts. The calculation of the left offset parameter ensures consistent horizontal spacing between child controls and checkbox icons, the compensation value of the top offset parameter eliminates vertical centering deviation, and the forced setting of the alignment mode guarantees layout stability across multiple resolutions. This solution significantly improves the development efficiency of checkbox controls, solves problems such as text misalignment and uneven spacing caused by traditional manual adjustments, and supports flexible adaptation to cross-language interfaces and dynamic content, providing a reliable technical foundation for the standardized production of game interactive components.

[0150] As an optional approach, the slot parameters corresponding to the control slots are determined based on the container category and shape parameters, including:

[0151] When a single container control includes a scaling box control, the horizontal left offset parameter, horizontal center offset parameter, and horizontal right offset parameter are determined based on the horizontal offset value and width of the child controls of the scaling box control and the horizontal offset value and width of the scaling box control.

[0152] The vertical upward offset parameter, vertical center offset parameter, and vertical downward offset parameter are determined based on the vertical offset value and height of the child control and the vertical offset value and height of the zoom box control.

[0153] The horizontal alignment mode of the sub-control is determined based on the horizontal left offset parameter, the horizontal center offset parameter, and the horizontal right offset parameter. The vertical alignment mode of the sub-control is determined based on the vertical upward offset parameter, the vertical center offset parameter, and the vertical downward offset parameter. The slot parameters are then determined.

[0154] Optionally, in this embodiment, the scaling box control may include, but is not limited to, a single container control used to scale and adapt child controls, including, but not limited to, a container in the game interface that dynamically adjusts the size of skill icons. For example, the skill icon container in the character's skill bar can automatically scale the icon size according to the screen resolution while maintaining the aspect ratio.

[0155] Optionally, in this embodiment, the horizontal offset value may include, but is not limited to, the absolute position value of the top-left corner of the control in the horizontal direction (X-axis). For example, the horizontal offset value of the scaling box control is 200 pixels, and the horizontal offset value of its child control is 210 pixels; the difference between the two is used to calculate the horizontal relative position. The horizontal left offset parameter may include, but is not limited to, the horizontal spacing between the left side of the child control and the left side of the scaling box control. For example, subtracting the horizontal offset value of the scaling box from the horizontal offset value of 200 pixels (210 pixels for the child control) yields a horizontal left offset parameter of 10 pixels, indicating that the left side of the child control is 10 pixels away from the left side of the container. The horizontal centering offset parameter may include, but is not limited to, the deviation between the horizontal center point of the child control and the horizontal center point of the scaling box control. For example, if the X-coordinate of the scaling box center point is 200 + 150 / 2 = 275 pixels, and the X-coordinate of the child control center point is 210 + 130 / 2 = 275 pixels, then the horizontal centering offset parameter is 0 pixels, indicating perfect centering. The horizontal right offset parameter may include, but is not limited to, the horizontal spacing between the right side of the child control and the right side of the scaling box control. For example, the right X coordinate of the scaling box is 200+150=350 pixels, the right X coordinate of the child control is 210+130=340 pixels, and the horizontal right offset parameter is 340350=10 pixels, which means that the right side of the child control extends 10 pixels beyond the right side of the container.

[0156] Optionally, in this embodiment, the vertical upward offset parameter may include, but is not limited to, the vertical distance between the top of the child control and the top of the scaling box control. For example, subtracting the scaling box's vertical offset of 300 pixels from the child control's vertical offset of 310 pixels yields a vertical upward offset parameter of 10 pixels, indicating that the top of the child control is 10 pixels away from the top of the container. The aforementioned vertical centering offset parameter may include, but is not limited to, the deviation between the vertical center point of the child control and the vertical center point of the scaling box control. For example, if the Y-coordinate of the scaling box center point is 300 + 150 / 2 = 375 pixels, and the Y-coordinate of the child control center point is 310 + 130 / 2 = 375 pixels, the vertical centering offset parameter is 0 pixels, indicating perfect vertical centering. The aforementioned vertical downward offset parameter may include, but is not limited to, the vertical distance between the bottom of the child control and the bottom of the scaling box control. For example, if the Y-coordinate of the scaling box bottom is 300 + 150 = 450 pixels, and the Y-coordinate of the child control bottom is 310 + 130 = 440 pixels, the vertical downward offset parameter is 440 + 450 = 10 pixels, indicating that the bottom of the child control extends 10 pixels beyond the bottom of the container.

[0157] For example, such as Figure 11 As shown, the geometric properties of the scaling box and its child controls are parsed from the design file. For example, in the game's task tracking interface, the scaling box control has shape parameters of coordinates (50, 400) and size (200×200), while its child control (task progress icon) has coordinates of (60, 410) and size (180×180). By extracting these parameters, the system establishes a spatial relationship model between the container and its child controls. Three horizontal positioning deviations of the child controls relative to the scaling box are calculated. For example, the scaling box has a horizontal offset of 50 pixels and a width of 200 pixels, while the child control has a horizontal offset of 60 pixels and a width of 180 pixels.

[0158] Horizontal offset to the left: 6050 = 10 pixels (left side spacing);

[0159] Horizontal center offset parameters: (60+180 / 2)(50+200 / 2)=150150=0 pixels (perfect centering);

[0160] Horizontal offset to the right: (60+180)(50+200)=240250=10 pixels (10 pixels beyond the right side);

[0161] Then, calculate the three vertical positioning offsets of the child control relative to the scaling box. For example, the scaling box has a vertical offset of 400 pixels and a height of 200 pixels, while the child control has a vertical offset of 410 pixels and a height of 180 pixels.

[0162] Vertical upward offset parameter: 410400 = 10 pixels (top spacing);

[0163] Vertical center offset parameters: (410+180 / 2)(400+200 / 2)=500500=0 pixels (perfect centering);

[0164] Vertical downward offset parameters: (410+180)(400+200)=590600=10 pixels (bottom exceeds 10 pixels);

[0165] Finally, the offset parameter with the smallest absolute value is selected to determine the optimal alignment mode. For example:

[0166] When the absolute value of the horizontal center offset parameter is the smallest (0), set the horizontal center alignment.

[0167] Set the vertical center offset parameter to its minimum absolute value (0) to enable vertical center alignment.

[0168] The generated slot parameters include alignment mode and compensation value to ensure that the child controls are centered within the scaling box.

[0169] It should be noted that the types and application scenarios of the scaling box control are diverse. In terms of control type, it can support proportional scaling boxes (maintaining the aspect ratio of child controls), free scaling boxes (allowing stretching and deformation), or dynamic scaling boxes (adapting to content); in terms of parameter calculation, weight allocation strategies can be introduced, such as collaborative layout of multiple child controls; in terms of application scenario, it can be adapted to mobile gesture scaling interfaces, PC configuration panels, or large-screen TV modes of console games. This application does not make specific limitations in this regard.

[0170] This application's embodiments utilize the extracted geometric parameters of the scaling box control and its child controls, and dynamically select the optimal alignment mode based on a multi-dimensional offset calculation model, achieving precise layout transformation in complex scaling scenarios. Parallel calculation of offset parameters in the horizontal and vertical directions ensures minimal positioning deviation of child controls within the container; intelligent selection of alignment modes and automatic generation of slot parameters guarantee visual consistency across different resolutions and scaling ratios. This solution significantly improves the development efficiency of scaling controls, solves problems such as misalignment and deformation caused by traditional manual adjustments, and supports dynamic adaptation requirements across device interaction scenarios, providing a standardized generation process for frequently used scaling interaction components in game interfaces.

[0171] As an optional approach, the horizontal alignment mode of the scaling box control is determined based on horizontal left offset parameters, horizontal center offset parameters, and horizontal right offset parameters. Similarly, the vertical alignment mode of the scaling box control is determined based on vertical upward offset parameters, vertical center offset parameters, and vertical downward offset parameters. The slot parameters are then determined, including:

[0172] Set the parameter with the smallest absolute value among the horizontal left offset parameter, horizontal center offset parameter, and horizontal right offset parameter to the corresponding alignment mode of the child control in the horizontal direction;

[0173] Set the vertical upward offset parameter, vertical center offset parameter, and vertical downward offset parameter with the smallest absolute value as the alignment mode of the child control in the vertical direction.

[0174] Determine the slot parameters.

[0175] For example, such as Figure 11 As shown, the alignment mode with the smallest deviation is selected by comparing the absolute values ​​of three horizontal offset parameters. For example, in the product card control of the game store, the horizontal left offset parameter is 10 pixels, the horizontal center offset parameter is 2 pixels, and the horizontal right offset parameter is 15 pixels. Since the absolute value of the horizontal center offset parameter is the smallest (2 pixels), the system sets the horizontal alignment mode to center alignment (HAlign_Center) to ensure that the product name is displayed in the center within the container. Similarly, the alignment mode with the smallest deviation is selected by comparing the absolute values ​​of three vertical offset parameters. For example, in the skill icon control of the character skill interface, the vertical upward offset parameter is 8 pixels, the vertical center offset parameter is 3 pixels, and the vertical downward offset parameter is 12 pixels. Since the absolute value of the vertical center offset parameter is the smallest (3 pixels), the system sets the vertical alignment mode to center alignment (VAlign_Center) to ensure that the skill icon is vertically centered within the container. The determined alignment mode and compensation offset values ​​are encapsulated into layout parameters that the engine can recognize. For example, in the progress bar control of the task tracking interface, the combination of horizontal center alignment (HAlign_Center) and vertical center alignment (VAlign_Center) generates slot parameters, which drives the engine to render a centered progress bar, while retaining a horizontal compensation value of 2 pixels and a vertical compensation value of 3 pixels to eliminate minor deviations.

[0176] It should be noted that there are various possibilities for the calculation of offset parameters and the selection of alignment modes. In terms of calculation, a weighted average algorithm can be introduced to collaboratively optimize the offset parameters of multiple sub-controls; in terms of dynamic scenes, the alignment strategy can be dynamically switched according to screen resolution or device orientation (landscape / portrait); in terms of interaction, user-defined alignment priorities can be supported (such as forcing left alignment to be superior to center alignment), and this application does not impose specific limitations on this.

[0177] This application's embodiments achieve high-precision positioning of child controls within a container by selecting the alignment mode with the smallest deviation. The horizontal and vertical offset parameter comparison mechanism ensures optimal alignment mode selection; the dynamic generation of slot parameters is compatible with the layout rules of different engines. This solution significantly improves the visual consistency of interface elements, eliminates positioning deviations caused by manual adjustments, and supports adaptive layout in complex dynamic scenes, providing reliable technical support for the automated generation of game interfaces.

[0178] As an alternative solution, such as Figure 7 As shown, the slot parameters corresponding to the control slots are determined based on the container category and shape parameters, including:

[0179] S704, when the container category is a multi-container control, the slot parameters are determined based on the slot type of the control slot, the shape parameters of each child control, and the shape parameters of the container control.

[0180] Optionally, in this embodiment, the slot type may include, but is not limited to, parameter types that define the layout rules of child controls in a multi-container control, including but not limited to fill mode (Fill), auto size (Auto), and alignment weight (Weight). For example, if the slot type of the child control in a horizontally arranged box is fill mode, a fill coefficient needs to be set to allocate the remaining space.

[0181] For example, the geometric attribute data of a multi-container control and its various child controls are parsed. For instance, in the skill shortcut bar interface of a game, the horizontal box (HorizontalBox) is a multi-container control with shape parameters of coordinates (200, 500) and size (800×100); the shape parameters of the three skill icon child controls are coordinates (210, 510) and size (80×80), (300, 510) and size (80×80), respectively. By extracting these parameters, the system constructs a complete spatial relationship model between the container and its child controls. Based on the layout rules corresponding to the container type, the design parameters are converted into slot parameters that the engine can recognize. For example, the slot type of the horizontal box is fill mode, and the fill coefficient of each child control needs to be calculated:

[0182] The container has a total width of 800 pixels, the child controls have a total width of 240 pixels (80×3), and the remaining width is 560 pixels;

[0183] Each child control is spaced 20 pixels apart, with a total spacing of 40 pixels, resulting in an actual remaining width of 520 pixels.

[0184] The fill factor for each child control is 80 / 520≈0.1538, and the spacing factor is 20 / 520≈0.0385.

[0185] The final generated slot parameters include a fill factor and a spacing factor, and the drive engine allocates space proportionally.

[0186] It should be noted that the types and layout rules of multi-container controls can vary. In terms of container type, it can support flow layout for automatic line wrapping, grid layout for row and column splitting, and stacked layout for layering effects. In terms of parameter source, it can be compatible with gaps or alignment guidelines from design tools such as Sketch and Figma. In terms of slot type, it can be extended with dynamic weight allocation (automatically adjusting the proportion based on content importance) or fixed spacing mode (such as equal division). This application does not make specific limitations in this regard.

[0187] This application's embodiments utilize the extraction of geometric parameters from multiple container controls and their child controls, combined with dynamically generated slot parameters based on container types, to achieve precise conversion of complex layouts. The shape parameter parsing of multiple container controls ensures the integrity of the spatial relationship between parent and child controls, while the slot type-driven parameter generation mechanism overcomes the efficiency bottleneck of manually calculating fill ratios and spacing allocation in traditional methods. This solution significantly improves the development efficiency of frequently used components such as lists and grids in game interfaces, ensures layout stability when dynamic content is added or deleted, or when resolution changes, and supports parameter compatibility across design tools and multi-engine platforms, providing a standardized technical path for large-scale interactive interface production.

[0188] As an optional approach, slot parameters are determined based on the slot type of the control slot, the shape parameters of each child control, and the shape parameters of the container control, including:

[0189] When the slot type of the control slot is a canvas slot, the horizontal size offset of each sub-control is determined based on the width of each sub-control corresponding to the multi-container control, and the vertical size offset of each sub-control is determined based on the height of each sub-control.

[0190] The horizontal offset of each child control is determined based on the horizontal offset value of each child control and the horizontal offset value of the multi-container control, and the vertical offset of each child control is determined based on the vertical offset value of each child control and the vertical offset value of the multi-container control.

[0191] The slot parameters are determined based on the horizontal dimension offset, vertical dimension offset, vertical position offset, and horizontal position offset.

[0192] Optionally, in this embodiment, the aforementioned canvas slot may include, but is not limited to, a parameter type used to describe the absolute positioning rules of child controls within the canvas control, including but not limited to defining positions using coordinate offsets (X / Y) and dimensions (W / H). For example, in a game character creation interface, the canvas control serves as a background container, and the positions of its child controls (such as hairstyle selection icons and skin tone adjustment sliders) are precisely controlled by coordinate offsets. The aforementioned multi-container controls may include, but are not limited to, canvas controls that specifically support free layout, including but not limited to dynamic map containers in the game's main interface and background image containers in the character attribute panel. Such controls allow child controls to be positioned using absolute coordinates, independent of automatic arrangement rules.

[0193] Optionally, in this embodiment, the aforementioned horizontal dimension offset may include, but is not limited to, the ratio or absolute value of the child control's width relative to the canvas container. For example, in a resolution-adaptive task tracking interface, the task list width is set to 70% of the canvas width (horizontal dimension offset 0.7) to ensure consistent proportions across different screen ratios. The aforementioned vertical dimension offset may include, but is not limited to, the ratio or absolute value of the child control's height relative to the canvas container. For example, the height of the game dialog window is set to 30% of the canvas height (vertical dimension offset 0.3) to ensure the text display area adapts to different devices.

[0194] Optionally, in this embodiment, the aforementioned horizontal position offset may include, but is not limited to, the horizontal distance between the top left corner of the sub-control and the top left corner of the canvas control. For example, the horizontal position offset of the pause button is 1800 pixels (canvas width 1920 pixels), indicating that its left side is 1800 pixels from the left side of the canvas. The aforementioned vertical position offset may include, but is not limited to, the vertical distance between the top left corner of the sub-control and the top left corner of the canvas control. For example, the vertical position offset of the health bar control is 50 pixels, indicating that its top is 50 pixels from the top of the canvas.

[0195] For example, such as Figure 12As shown, the geometric properties of the canvas control and its child controls are analyzed. For example, in the game's main interface, the canvas control's shape parameters are coordinates (0,0) and size (1920×1080); its child controls include the character avatar (coordinates 50,50, size 100×100), the minimap (coordinates 1700,50, size 200×200), and the skill bar (coordinates 800,900, size 320×80). By extracting these parameters, the system constructs a complete absolute positioning layout model. The ratio or absolute value of the child control size to the canvas size is calculated. For example, if the character avatar's width is 100 pixels and the canvas width is 1920 pixels, the horizontal offset can be set to an absolute value of 100 pixels or a ratio of 0.052 (100 / 1920). In the settings interface, the vertical offset of the volume control slider might be a ratio of 0.1 (height 108 pixels) to ensure adaptation to different resolutions. The absolute coordinates of the child controls relative to the canvas are calculated. For example, the minimap has a horizontal offset of 1700 pixels (canvas horizontal offset of 0 pixels), and a horizontal position offset of 1700 pixels; the health bar control has a vertical offset of 50 pixels (canvas vertical offset of 0 pixels), and a vertical position offset of 50 pixels. In the battle interface, the skill cooldown indicator icon might have a horizontal offset of 800 pixels and a vertical offset of 900 pixels, ensuring it is fixed at the bottom center of the screen. Size and position parameters are combined into layout rules that the engine can recognize. For example, the slot parameters for the quest prompt box include a horizontal offset of 200 pixels, a vertical offset of 300 pixels, a horizontal size offset of 500 pixels, and a vertical size offset of 200 pixels, driving the engine to render a 500×200 pixel control at coordinates (200, 300) on the canvas.

[0196] It should be noted that there are various possibilities for generating the parameters of the canvas slots. In terms of control type, fixed positioning (such as health bars) and proportional positioning (such as resolution-adaptive buttons) can be supported; in terms of parameter type, absolute values ​​and proportional values ​​can be used in combination (such as absolute values ​​for horizontal position and proportional values ​​for vertical position); in terms of dynamic scene, the horizontal and vertical offset parameters can be automatically switched according to the device rotation (such as using preset A when the phone is in portrait mode and switching to preset B when it is in landscape mode). This application does not impose specific limitations on this.

[0197] This application's embodiments utilize the extraction of absolute positioning parameters from canvas controls and child controls to automate the generation of complex free layouts. Flexible definition of horizontal and vertical size offsets supports control scaling and absolute size control; dynamic calculation of position offsets ensures precise positioning of child controls within the canvas. This solution significantly improves development efficiency for scenarios requiring absolute positioning, such as game main interfaces and pop-up prompts, eliminates misalignment issues caused by manual coordinate calculations, and is compatible with the dynamic adaptation requirements of multi-resolution devices, providing a standardized technical path for the rapid construction of high-precision interactive interfaces.

[0198] As an optional approach, slot parameters are determined based on the slot type of the control slot, the shape parameters of each child control, and the shape parameters of the container control, including:

[0199] When the slot type of the control slot is a horizontal box slot, and the multi-container control includes at least one of the horizontal box control and the stack box control and scroll box control set to the horizontal direction, the controls of the multi-container control are traversed in turn. Based on the width of the multi-container control, the width of each child control, and the size information, the corresponding area is divided for each child control. Based on the horizontal offset value, vertical offset value, width, and height of each child control, the first area offset parameter of each child control in the corresponding area is determined.

[0200] Based on the first region offset parameter and the first fill coefficient of each sub-control, the slot parameters of each sub-control are determined respectively. The first fill coefficient is determined by the width of each sub-control and the first historical fill space corresponding to each sub-control. The first historical fill space is determined by the width of the previously traversed sub-control and the first historical fill space. The initial value of the first historical fill space is 0.

[0201] Optionally, in this embodiment, the aforementioned horizontal frame slot may include, but is not limited to, a layout parameter type for horizontally arranging child controls, including but not limited to defining the fill ratio, alignment, and margins of the child controls within the horizontal box. For example, in a game's skill shortcut bar, the horizontal frame slot parameter determines the spacing and size ratio of each skill icon. The aforementioned multi-container controls may include, but are not limited to, container types that support horizontal layout, including but not limited to horizontal box controls (HorizontalBox), horizontal stack boxes (StackBox), and horizontal scroll boxes (ScrollBox). For example, a game store's product list uses a horizontal scroll box control, supporting horizontal scrolling to browse multiple product cards.

[0202] Optionally, in this embodiment, the aforementioned size information may include, but is not limited to, the size rules used by the child controls in layout calculations, such as Auto or Fill. For example, setting the size information of the child controls in the horizontal frame to a Fill ratio of 0.2 indicates that they occupy 20% of the remaining width of the container.

[0203] Optionally, in this embodiment, the first region offset parameter may include, but is not limited to, the position compensation value of the sub-control within its allocated area, including horizontal offset (such as left padding) and vertical offset (such as top margin). For example, the left padding parameter of the product card is 10 pixels to ensure a 10-pixel gap with adjacent cards. The first padding coefficient may include, but is not limited to, the proportion of the sub-control's occupancy in the remaining space of the horizontal frame, dynamically calculated from the historical padding space and the current width of the sub-control. For example, the widths of the three sub-controls are 200, 300, and 500 pixels, respectively, with a total remaining space of 1000 pixels, and the padding coefficients are 0.2, 0.3, and 0.5, respectively. The first historical padding space may include, but is not limited to, the accumulated allocated width space during the traversal of sub-controls, used to iteratively calculate the padding coefficient of subsequent sub-controls. For example, after the first sub-control is allocated 200 pixels, the historical padding space is updated to 200 pixels, and the second sub-control calculates its padding coefficient based on the remaining 800 pixels.

[0204] For example, such as Figure 13As shown, the geometric properties of the horizontal layout container and its child controls are analyzed. For example, in the game's inventory interface, the shape parameters of the horizontal scrollbar control are coordinates (50, 400) and size (900×150). The coordinates of its child controls (such as armor and potion icons) are (60, 410) and size (120×120), (190, 410) and size (120×120), respectively, and (320, 410) and size (120×120). The layout area of ​​each child control is dynamically calculated. For example, if the total width of the horizontal frame is 900 pixels, and the width of each of the three child controls is 120 pixels, the remaining space is 900 × 360 = 540 pixels. If the child control size information is set to fill mode, then each child control is allocated 1 / 3 of the remaining space (180 pixels), and the width of the divided area is 120 + 180 = 300 pixels. The position compensation value of the child control within the allocated area is calculated. For example, the first child control has a horizontal offset of 60 pixels, an allocation area starting point of 60 pixels, a width of 300 pixels, an actual child control width of 120 pixels, a left padding parameter of 0 pixels (on the left side of the snap-in area), and a right padding parameter of 180 pixels (300120). The padding coefficient and layout parameters are generated iteratively. For example, the initial historical padding space is 0, the first child control is 120 pixels wide, the remaining space is 780 pixels (900120), and the padding coefficient is 120 / (9000) = 0.133; the historical padding space is updated to 120 pixels. The second child control has a padding coefficient of 120 / (900120) = 0.154, and the final slot parameters include the padding coefficient and left and right margins.

[0205] It should be noted that there are various possibilities for the generation of parameters for the horizontal frame slots. In terms of container type, it can support equal-division layout (child controls with equal width), weighted layout (distributing proportions according to importance), or a hybrid mode (combining fixed size with padding); in terms of parameter source, it can be compatible with spacing annotations from design tools (such as Figma's Auto Layout) or manually entered margin values; in terms of dynamic scenarios, it can adapt to layout reconstruction or dynamic content loading when switching between landscape and portrait orientations (such as automatically adjusting the padding coefficient when adding new product cards), and this application does not make specific limitations in this regard.

[0206] This application's embodiments utilize dynamic traversal and iterative calculation to achieve precise parameter generation for child controls within a horizontal layout container. A coefficient allocation mechanism based on historical fill space ensures the rational utilization of remaining space; the calculation of region offset parameters takes into account both design coordinates and engine layout rules, guaranteeing visual fidelity. This solution significantly improves development efficiency for horizontally arranged scenarios such as game stores and inventory systems, eliminates the complexity of manually calculating fill ratios and margins, and supports dynamic content addition and removal as well as multi-device adaptation, providing automated generation capabilities for frequently used horizontal layout components.

[0207] As an optional approach, when the slot type of the control slot is a horizontal box slot, and the multi-container control includes at least one of a horizontal box control and a horizontally oriented stack box control and a scroll box control, the process involves sequentially traversing each child control of the multi-container control. Based on the width of the multi-container control, the width of each child control, and its size information, a corresponding area is divided for each child control. The first area offset parameter of each child control within its corresponding area is determined based on its horizontal offset value, vertical offset value, width, and height, including:

[0208] When the slot type of the control slot is a horizontal box slot, and the multi-container control includes at least one of the horizontal box control and the stack box control and scroll box control set to the horizontal direction, the following operations are performed sequentially through each child control of the multi-container control, wherein the control that divides the area each time is regarded as the first current control, the size information of the first current control is the fill mode, and the alignment mode of the first current control is horizontal fill and vertical fill:

[0209] The vertical offset and height of the region are determined based on the vertical offset and height of the multi-container control.

[0210] The horizontal offset value and width of the region are determined based on the first starting point position corresponding to the first current control, the horizontal offset value and the width of the first current control. The first starting point position is determined by the horizontal offset value and width of the previously traversed child control and the right offset parameter. When the first current control is the first traversed child control, the first starting point position is the horizontal offset value of the multi-container control. When the first current control is the last traversed child control, and the sum of the horizontal offset value and the width of the region is less than the sum of the horizontal offset value and the width of the multi-container control, the width of the region is determined by the horizontal offset value, the width of the multi-container control and the horizontal offset value of the region.

[0211] The left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter of the first current control are determined based on the region's vertical offset value, region's height, region's horizontal offset value, region's width, and the first current control's horizontal offset value, vertical offset value, width, and height. The first region's offset parameters include the left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter.

[0212] Optionally, in this embodiment, the multi-container control may include, but is not limited to, container types that support horizontal layout, including but not limited to horizontal box controls (HorizontalBox), horizontal stack boxes (StackBox), and horizontal scroll boxes (ScrollBox). For example, the horizontal product list in a game store uses a horizontal scroll box control, supporting swiping to browse multiple product cards.

[0213] Optionally, in this embodiment, the filling mode may include, but is not limited to, layout rules where the size of the sub-controls is dynamically adjusted according to the remaining space of the container. For example, the fill factor indicates that the sub-control occupies the remaining space proportionally. For instance, in a game skill bar, the fill factor of the skill icon is set to 0.3, indicating that it occupies 30% of the remaining width of the horizontal frame. The first starting point position may include, but is not limited to, the starting horizontal coordinates of the current sub-control area division, determined by the ending position of the previous sub-control. For instance, the starting point position of the first skill icon is on the left side of the container (X = 100), and the starting point position of the second skill icon is on the right side of the first icon (X = 100 + 120 = 220).

[0214] Optionally, in this embodiment, the aforementioned vertical offset value may include, but is not limited to, the starting coordinates of the area allocated to the child control in the vertical direction, typically consistent with the vertical offset value of the container. For example, if the container's vertical offset value is 200 pixels, the area's vertical offset value is also 200 pixels, and the child control is vertically positioned within this area. The aforementioned area width may include, but is not limited to, the area size allocated to the child control in the horizontal direction, dynamically calculated based on the remaining space of the container and the fill rules. For example, if the container's total width is 800 pixels, the first two child controls occupy 400 pixels, and the area width of the last child control is 400 pixels. The aforementioned left offset parameter may include, but is not limited to, the horizontal distance between the left side of the child control and the left side of its allocated area. For example, if the child control's horizontal offset value is 210 pixels and the starting point of the allocated area is 200 pixels, then the left offset parameter is 10 pixels.

[0215] For example, such as Figure 14As shown, this includes child control 1 and child control 2. Child control 1 corresponds to slot 1, and child control 2 corresponds to slot 2. Each child control in the horizontal container is processed sequentially. For example, in the horizontal item bar of the game backpack, the armor and potion icons are processed in sequence. Each icon is set to fill mode, and the fill area is stretched in both the horizontal and vertical directions to ensure adaptive to the container size. The vertical layout range of the child controls is calculated. For example, if the container's vertical offset is 200 pixels and its height is 100 pixels, then the area's vertical offset is 200 pixels and its height is 100 pixels. All child controls are arranged vertically within this range. The horizontal area is dynamically divided. For example, the starting point of the first child control is on the left side of the container (X=100), its horizontal offset is 100 pixels, its width is 120 pixels, its area's horizontal offset is 100 pixels, and its area width is 120 pixels. The starting point of the second child control is 220 pixels (100+120), and its area width is calculated to be 180 pixels according to the fill rules. The starting position of the first child control is initialized. For example, if the container's horizontal offset is 100 pixels, the starting point of the first child control will also be 100 pixels, and its area will be horizontally offset by 100 pixels to align with the container. Force the last child control to fill the remaining space. For example, if the container's total width is 800 pixels, the first two child controls occupy 600 pixels, and the last child control's area has a horizontal offset of 700 pixels, its area width is adjusted to 100 pixels (800700) to avoid white space. Calculate the margins of the child controls within the allocated area. For example, if the child control's horizontal offset is 210 pixels and its width is 100 pixels, and the allocated area has a horizontal offset of 200 pixels and a width of 120 pixels, then the left offset parameter is 10 pixels (210200), the right offset parameter is 10 pixels (200+120210100); the vertical offset is 215 pixels, the area's vertical offset is 200 pixels, its height is 100 pixels, the top offset parameter is 15 pixels (215200), and the bottom offset parameter is 15 pixels (215+50200100).

[0216] It should be noted that the layout of horizontal container controls can be diverse. In terms of container type, it supports equal-division filling (e.g., three columns equally divided), weighted filling (e.g., the main content area occupies 70%), and mixed filling (a combination of fixed size and proportional filling). In terms of dynamic content, it can adapt to changes in the number of child controls (e.g., automatically adjusting the area width when adding or removing products in an online store) or changes in container size (e.g., layout restructuring triggered by window scaling). In terms of interaction, it can extend the real-time calculation of parameters after dragging and adjusting the order of child controls; this application does not specifically limit this aspect.

[0217] This application's embodiments utilize dynamic horizontal region division and precise offset parameter calculation to achieve automated adaptation of complex horizontal layouts. The region division mechanism ensures that child controls are dynamically allocated space according to the design draft proportions, and the margin parameter calculation takes into account both absolute coordinates and relative layout rules. This solution significantly improves the development efficiency of horizontally arranged scenarios such as game stores and inventory systems, solves the complexity of manually calculating fill ratios and margins, and supports dynamic content addition and removal, multi-resolution device adaptation, and real-time layout updates after interactive operations, providing reliable automated generation capabilities for high-frequency iterative interactive interfaces.

[0218] As an optional approach, slot parameters are determined based on the slot type of the control slot, the shape parameters of each child control, and the shape parameters of the container control, including:

[0219] When the slot type of the control slot is a vertical box slot, and the multi-container control includes at least one of the vertical box control and the stack box control and scroll box control set to the vertical direction, the child controls of the multi-container control are traversed in turn. Based on the height of the multi-container control, the height of each child control, and the size information, the corresponding area is divided for each child control. Based on the horizontal offset value, vertical offset value, width, and height of each child control, the second area offset parameter of each child control in the corresponding area is determined.

[0220] Based on the second region offset parameter and the second fill coefficient of each sub-control, the slot parameters of each sub-control are determined. The second fill coefficient is determined by the height of each sub-control and the second historical fill space corresponding to each sub-control. The second historical fill space is determined by the height of the previously traversed sub-control and the second historical fill space. The initial value of the second historical fill space is 0.

[0221] Optionally, in this embodiment, the aforementioned vertical box slot may include, but is not limited to, a layout parameter type for vertically arranging child controls, including but not limited to defining the fill ratio, alignment, and margins of the child controls within the vertical box. For example, in a game's task list interface, the vertical box slot parameter determines the line spacing and height ratio of each task item. The aforementioned multi-container controls may include, but are not limited to, container types that support vertical layout, including but not limited to vertical box controls, vertical stack boxes, and vertical scroll boxes. For example, the option list in a game settings menu uses a vertical scroll box control, supporting vertical scrolling to browse multiple settings items.

[0222] Optionally, in this embodiment, the second region offset parameter may include, but is not limited to, the position compensation value of the sub-control within its allocated area, including the top margin and bottom margin. For example, the top margin of a task item is 10 pixels to ensure a 10-pixel interval with the previous item. The second fill factor may include, but is not limited to, the proportion of the sub-control's occupancy in the remaining space of the vertical box, dynamically calculated from the historical fill space and the current sub-control height. For example, the heights of three task items are 80, 100, and 120 pixels, respectively, with a total remaining space of 600 pixels, and the fill factors are 0.133, 0.167, and 0.2, respectively. The second historical fill space may include, but is not limited to, the accumulated allocated height space during the traversal of sub-controls, used to iteratively calculate the fill factor of subsequent sub-controls. For example, after the first task item is allocated 80 pixels, the historical fill space is updated to 80 pixels, and the fill factor of the second item is calculated based on the remaining 520 pixels.

[0223] For example, the geometric properties of the vertical layout container and its child controls are parsed. For instance, in a game's task tracking interface, the shape parameters of the vertical scrollbar control (multi-container control) are coordinates (100, 200) and size (500 × 800). Its child controls (such as task entries) have coordinates (110, 210) and sizes (480 × 90), (110, 310) and (480 × 110), and (110, 430) and sizes (480 × 130), respectively. The layout area for each child control is dynamically calculated. For example, if the total height of the vertical frame is 800 pixels, and the heights of the three child controls are 90, 110, and 130 pixels, the remaining space is 800 × 330 = 470 pixels. If the child control size information is set to fill mode, each child control is allocated 1 / 3 of the remaining space (approximately 157 pixels), and the divided area height is 90 + 157 ≈ 247 pixels. The position compensation value of the child control within the allocated area is calculated. For example, the first task entry has a vertical offset of 210 pixels, an allocation area starting point of 210 pixels, a height of 247 pixels, an actual child control height of 90 pixels, a top offset parameter of 0 pixels (fitting the top of the area), and a bottom offset parameter of 157 pixels (24790). The fill factor and layout parameters are generated iteratively. For example, the initial historical fill space is 0, the first child control has a height of 90 pixels, and the remaining space is 710 pixels (80090), with a fill factor of 90 / (8000) = 0.1125; the historical fill space is updated to 90 pixels. The second child control has a fill factor of 110 / (80090) = 0.155, and the final slot parameters include the fill factor and top and bottom margins.

[0224] It should be noted that there are various possibilities for the generation of parameters for vertical frame slots. In terms of container type, it can support grouped layouts (such as grouping task items by category and adding separators), collapsed layouts (such as expandable / collapseable option panels), or hybrid layouts (combining a fixed title bar with a scrollable content area). In terms of parameter source, it can be compatible with spacing annotations in design tools (such as the vertical grid in Adobe XD) or manually defined minimum / maximum height limits. In terms of dynamic scenes, it can adapt to dynamic content loading (such as real-time updates to the task list) or layout restructuring when the device rotates (such as switching to a two-column layout in landscape mode). This application does not impose specific limitations on these aspects.

[0225] This application's embodiments utilize dynamic traversal and iterative calculation to achieve precise parameter generation for child controls within a vertical layout container. A coefficient allocation mechanism based on historical fill space ensures the rational utilization of remaining space; the calculation of region offset parameters takes into account both design coordinates and engine layout rules, guaranteeing visual fidelity. This solution significantly improves the development efficiency of vertically arranged scenarios such as game task systems and settings menus, resolving the complexity of manually calculating fill ratios and margins. It also supports dynamic content addition and removal, multi-device adaptation, and provides automated generation capabilities for frequently used vertical layout components, reducing the risk of layout misalignment caused by manual operation.

[0226] As an optional approach, when the slot type of the control slot is a vertical box slot, and the multi-container control includes at least one of a vertical box control and a stack box control and a scroll box control set to a vertical direction, the various child controls of the multi-container control are traversed sequentially. Based on the height of the multi-container control, the height of each child control, and its size information, a corresponding area is divided for each child control. A second area offset parameter for each child control within its corresponding area is determined based on its horizontal offset, vertical offset, width, and height, including:

[0227] The following operations are performed sequentially on each child control of the multi-container control, where each control that divides the area is considered the second current control. The size information of the second current control is its fill mode, and the alignment mode of the second current control is either horizontal or vertical fill:

[0228] The horizontal offset and width of the region are determined based on the horizontal offset and width of the multi-container control.

[0229] The vertical offset value and height of the region are determined based on the second starting point position corresponding to the second current control, the vertical offset value and the height of the second current control. The second starting point position is determined by the vertical offset value and height of the child controls previously traversed by the second current control, as well as the downward offset parameter. When the second current control is the first child control traversed, the second starting point position is the vertical offset value of the multi-container control. When the second current control is the last child control traversed, and the sum of the region vertical offset value and the region height is less than the sum of the vertical offset value and the height of the multi-container control, the region height is determined by the vertical offset value, the height and the region vertical offset value of the multi-container control.

[0230] The left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter of the second current control are determined based on the region's vertical offset value, region's height, region's horizontal offset value, region's width, and the second current control's horizontal offset value, vertical offset value, width, and height. The second region's offset parameters include the left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter.

[0231] Optionally, in this embodiment, the aforementioned vertical box slot may include, but is not limited to, a layout parameter type for vertically arranging child controls, including but not limited to defining the fill ratio, alignment, and margins of the child controls within the vertical box. For example, in a game's mail system interface, the vertical box slot parameter determines the line height and vertical spacing of each email. The aforementioned multi-container controls may include, but are not limited to, container types that support vertical layout, including but not limited to vertical box controls, vertical stack boxes, and vertical scroll boxes. For example, a game's character attribute interface uses a vertical scroll box control, supporting vertical scrolling to browse attribute entries such as health and mana.

[0232] Optionally, in this embodiment, the filling mode may include, but is not limited to, layout rules where the size of the sub-controls is dynamically adjusted according to the remaining space in the container. For example, the fill factor indicates that the sub-control occupies the remaining height proportionally. For instance, the fill factor of the skill description panel is set to 0.25, indicating that it occupies 25% of the remaining height of the vertical frame. The second starting point position may include, but is not limited to, the starting vertical coordinates of the current sub-control area division, determined by the ending position of the previous sub-control. For instance, the starting point position of the first task item is the top of the container (Y = 200), and the starting point position of the second task item is the bottom of the first item (Y = 200 + 80 = 280).

[0233] Optionally, in this embodiment, the aforementioned horizontal offset value may include, but is not limited to, the starting coordinates of the area allocated to the child control in the horizontal direction, which is usually consistent with the horizontal offset value of the container. For example, if the horizontal offset value of the container is 100 pixels, the horizontal offset value of the area is also 100 pixels, and the child control is laid out horizontally within this area. The aforementioned area height may include, but is not limited to, the area size allocated to the child control in the vertical direction, which is dynamically calculated based on the remaining height of the container and the fill rules. For example, if the total height of the container is 600 pixels, the first two child controls have occupied 200 pixels, and the area height of the last child control is 400 pixels.

[0234] For example, process each child control in the vertical container sequentially. For instance, in a game's achievement system interface, process the three achievement entries sequentially: first kill level achievement and completion of the mission. Each entry is set to fill mode, stretching the fill allocation area both horizontally and vertically to ensure it adapts to the container size. Calculate the horizontal layoutable range of the child controls. For example, if the container's horizontal offset is 150 pixels and its width is 500 pixels, then the area's horizontal offset is 150 pixels, and the area's width is 500 pixels; all child controls are arranged horizontally within this range. Dynamically divide the vertical area. For example, the first child control starts at the top of the container (Y=150), with a vertical offset of 150 pixels and a height of 80 pixels; the area's vertical offset is 150 pixels, and the area's height is 80 pixels. The second child control starts at 230 pixels (150+80), and its area height is calculated to be 120 pixels according to the fill rules. Initialize the starting position of the first child control. For example, if the container's vertical offset is 150 pixels, the starting point of the first child control will also be 150 pixels, and its area will be vertically offset by 150 pixels to align with the container. Force the last child control to fill the remaining space. For example, if the container's total height is 600 pixels, the first two child controls occupy 400 pixels, the last child control's area vertical offset is 550 pixels, and its area height is adjusted to 50 pixels (600550) to avoid white space. Calculate the margins of the child controls within the allocated area. For example, if the child control's horizontal offset is 160 pixels and its width is 480 pixels, and the allocated area's horizontal offset is 150 pixels and its width is 500 pixels, then the left offset parameter is 10 pixels (160150), the right offset parameter is 10 pixels (150+500160480); the vertical offset is 155 pixels, the area's vertical offset is 150 pixels, its height is 80 pixels, the top offset parameter is 5 pixels (155150), and the bottom offset parameter is 5 pixels (155+7515080).

[0235] It should be noted that the layout of vertical container controls can be diverse. In terms of container type, it can support grouped layouts (such as grouping task items by priority and adding separators), collapsible layouts (such as expandable detail panels), or hybrid layouts (combining fixed titles with scrolling content). In terms of parameter source, it can be compatible with dynamic constraints in design tools (such as Sketch's responsive layout) or manually defined minimum height thresholds. In terms of dynamic scenarios, it can adapt to dynamic content loading (such as automatically expanding the area height after a new email is received) or layout restructuring when switching between portrait and landscape modes; this application does not impose specific limitations on these aspects.

[0236] This application's embodiments utilize dynamic vertical region division and precise offset parameter calculation to achieve automated adaptation of complex vertical layouts. The region division mechanism ensures that child controls are dynamically allocated space according to the design draft proportions, and the margin parameter calculation takes into account both absolute coordinates and relative layout rules. This solution significantly improves the development efficiency of vertically arranged scenarios such as game task systems and settings menus, solves the complexity of manually calculating fill ratios and margins, and supports dynamic content addition and removal, multi-resolution device adaptation, and real-time layout updates after interactive operations, providing reliable automated generation capabilities for high-frequency iterative interactive interfaces.

[0237] As an optional approach, slot parameters are determined based on the slot type of the control slot, the shape parameters of each child control, and the shape parameters of the container control, including:

[0238] In the case where the child controls of a multi-container control do not affect each other, and the multi-container control includes at least one of an overlay control and a control reflector control, the child controls of the multi-container control are traversed sequentially. The left offset parameter of each child control is determined based on the horizontal offset value of each child control and the horizontal offset value of the multi-container control. The right offset parameter of each child control is determined based on the horizontal offset value and width of each child control and the horizontal offset value and width of the multi-container control.

[0239] The top offset parameter of each child control is determined based on the vertical offset value of each child control and the vertical offset value of the multi-container control, and the bottom offset parameter of each child control is determined based on the vertical offset value and height of each child control and the vertical offset value and height of the multi-container control.

[0240] The fill offset is set based on the left offset parameter, right offset parameter, top offset parameter and bottom offset parameter, and the alignment mode of each sub-control is set to horizontal fill and vertical fill. The slot parameters are determined, including the fill offset and alignment mode.

[0241] Optionally, in the embodiments of this application, the aforementioned overlay control may include, but is not limited to, a container type that allows multiple sub-controls to be displayed on top of each other and laid out independently, including, but not limited to, dynamic pop-up layers and floating tooltips in games. For example, the skill cooldown prompt in the battle interface floats above the character model, independently of other UI elements. The aforementioned control reflector control may include, but is not limited to, a container type that dynamically switches the display of sub-controls, such as a tab container in the game settings interface, which switches the display of different sub-panels (such as graphics settings and sound effects settings) according to the user's selection.

[0242] Optionally, in this embodiment, the left offset parameter may include, but is not limited to, the horizontal spacing between the left side of the child control and the left side of the container. For example, the horizontal offset value of the child control is 120 pixels, the horizontal offset value of the container is 100 pixels, and the left offset parameter is 20 pixels. The right offset parameter may include, but is not limited to, the horizontal spacing between the right side of the child control and the right side of the container. For example, the horizontal offset value of the child control is 120 pixels, the width is 80 pixels, the horizontal offset value of the container is 100 pixels, the width is 300 pixels, and the right offset parameter is 100 pixels (100+30012080). The top offset parameter may include, but is not limited to, the vertical spacing between the top of the child control and the top of the container. For example, the vertical offset value of the child control is 200 pixels, the vertical offset value of the container is 150 pixels, and the top offset parameter is 50 pixels. The bottom offset parameter may include, but is not limited to, the vertical spacing between the bottom of the child control and the bottom of the container. For example, the vertical offset value of the child control is 200 pixels, the height is 50 pixels, the vertical offset value of the container is 150 pixels, the height is 400 pixels, and the bottom offset parameter is 100 pixels (150+40020050).

[0243] For example, the geometric properties of an independent layout container (such as an overlay control) and its child controls are parsed. For instance, the overlay control (a multi-container control) for the game pause menu has shape parameters of coordinates (0,0) and size (1920×1080). Its child controls include a "Continue Game" button (coordinates 800, 500, size 320×80) and a "Settings" button (coordinates 800, 600, size 320×80). Horizontal margins are dynamically calculated. For example, the overlay control has a horizontal offset of 0 pixels, the "Continue Game" child control has a horizontal offset of 800 pixels, a left offset parameter of 8000 = 800 pixels; the button width is 320 pixels, the container width is 1920 pixels, and the right offset parameter is 1920800320 = 800 pixels. Vertical margins are also dynamically calculated. For example, the overlay control has a vertical offset of 0 pixels, the child control "Continue Game" has a vertical offset of 500 pixels, and the top offset parameter is 5000 = 500 pixels; the button height is 80 pixels, the container height is 1080 pixels, and the bottom offset parameter is 108050080 = 500 pixels. Combine margin parameters with layout rules. For example, the slot parameters for the "Continue Game" button include fill offsets (left 800, right 800, top 500, bottom 500), and the alignment mode is set to horizontal fill (stretched to between the left and right margins) and vertical fill (stretched to between the top and bottom margins) to ensure the button is always centered.

[0244] It should be noted that there are various possibilities for the parameter generation methods of independent layout containers. In terms of container type, it can be extended to support picture-in-picture controls (such as a floating minimap layer) and dynamic masking layers (such as a darkening background layer during dialogue). In terms of parameter type, it can be compatible with percentage offsets (such as a left offset of 30% of the container width) or a mixture of absolute and proportional values. In terms of dynamic scenes, it can adapt to automatic recalculation when the device resolution changes (such as dynamically adjusting the fill offset when switching between portrait and landscape modes on a mobile phone). This application does not impose specific limitations on this.

[0245] This application's embodiments achieve precise layout of overlay containers by independently calculating the absolute margin parameters of child controls. The dynamic generation mechanism of fill offsets ensures that the position of child controls within the container strictly adheres to the coordinate definitions in the design draft; the application of horizontal and vertical fill modes guarantees the adaptability of child controls when the container size changes. This solution significantly improves the development efficiency of independent UI components such as pop-ups and floating tips, avoids misalignment problems caused by manual margin calculations, and supports flexible expansion for multi-device resolution adaptation and dynamic content scenarios, providing a reliable technical foundation for the efficient construction of complex interactive interfaces.

[0246] The following specific examples will further explain this application:

[0247] Using the PSD2UI tool, the production process is as follows: Figure 15 As shown, including but not limited to:

[0248] First, create a simple UI design in Unreal Engine, including the necessary elements for the interactive interface, such as the login button and the text to be displayed in text boxes. Save this as a UMG file.

[0249] The designer used the PSD2UI tool to convert the UMG interactive sketches into PSD design drafts. (This is a reverse workflow, where a similar image is exported from the PSD using the pixel coordinates of layers.)

[0250] The UI designer, starting with the unmodified PSD design draft, begins designing. This includes setting styles for each button and text box, and creating appropriate layouts, all to achieve an interactive interface that meets both player interaction needs and aesthetic preferences. Finally, the revised PSD file is saved.

[0251] The PSD2UI tool is used to export the modified PSD file to UMG for the engine to use. During this process, the 2D coordinate information of the layers needs to be converted into the layout information of each control's container, i.e., slot information, and then set. This ensures that the layout of the UMG matches the visual effect in the PSD. In the main workflow, the slot information of the corresponding UI controls in the UMG is set based on the layer position information of each UI element in the PSD. This process is automatically handled by the code in the PSD2UI tool.

[0252] The UI designer's task is to drag the PSD file (file 1) into the Unreal Engine's content browser, as follows: Figure 16 As shown: Dragging triggers the PSD2UI tool's workflow, automatically generating a corresponding UMG interface in the content browser. For example... Figure 17 As shown, importing ScrollBoxRoot.psd generates a ScrollBoxRoot.uasset file. ScrollBoxRoot.uasset is recognized as a UMG interface in Unreal Engine, which can be edited. The Unreal Engine interface for editing ScrollBoxRoot is expanded. Visually, ScrollBoxRoot.psd and ScrollBoxRoot.uasset are identical. While the PSD uses x, y two-dimensional coordinates to position each square image, the UMG uses the fill, size, horizontal alignment, and vertical alignment settings within the square image's slot information to define the layout.

[0254] In PSD, the interactive interface is described by multiple nested layers, with each UI control corresponding to a set of layers. Each layer can have four parameters set to determine its display effect: width (W), height (H), horizontal offset (X), and vertical offset (Y).

[0255] like Figure 18 As shown, the Image_47 layer is a background image in the UI interface. Its X=0, y=0 indicates that its top left corner is at point (0,0), which is the top left side of the stage. Its W=500, Y=700 indicates that its size is 500 pixels wide and 700 pixels high.

[0256] As you can see, Image_47 is ScrollBox_1 <scrollbox>A sublayer of the layer, which means that Image_47 is a child UI control of the scroll list ScrollBox_1.

[0257] UMG UI controls all have a root node, which can be a container control. Container controls only have size, not coordinate information, so the position information of child UI controls is entirely relative. If a child UI control of the root node is also a container, then the position information of its child control is only related to its parent control (that is, the child UI control of the root node), and not to the root node's container.

[0258] like Figure 19 As shown, the root node is a scrollbar, and Image_47 is its child control. Therefore, the position information of Image_47, that is, its slot information, is relative to the scrollbar. The scrollbar has another child control, scrollbar B. The position information of scrollbar B is relative to the root of the scrollbar, but the position information of Button_107 is related to scrollbar B, but not to the scrollbar itself.

[0259] Then, the scrollbar is a container control, so it allows child controls to be arranged in a specific way.

[0260] like Figure 20 As shown, the position calculation method for UI controls in PSD is the same, which can be understood as an x ​​and y offset relative to the top left corner. However, the UI controls in UMG are all related to their parent container controls, and their relative position offset is determined by their slot information. Moreover, the layout rules for different container controls are completely different. Because container controls have slot information, the slot information of different types of container controls can be calculated separately. The following will explain this using different container controls as examples:

[0261] Single container control:

[0262] 1. Button control:

[0263] A button control can contain another control as its child control. The slots for its child controls are button slots, such as... Figure 8 As shown.

[0264] The alignment modes include, but are not limited to:

[0265] Horizontal alignment: This refers to different layout methods of child controls relative to their parent controls in the horizontal direction, including: horizontal left alignment, such as... Figure 21 As shown: The leftmost edge of the child control coincides with the leftmost edge of the parent control, serving as the starting coordinate. Horizontally center-aligned, as shown... Figure 22 As shown: The starting coordinates are the center point of the child control in the horizontal x-direction, which coincides with the center point of the parent control in the x-direction. Align horizontally to the right, as shown. Figure 23 As shown: the rightmost edge of the child control coincides with the rightmost edge of the parent control, serving as the starting coordinate. Horizontal fill, as shown... Figure 24 As shown: Ignoring the size of the child control itself, stretch the child control horizontally, ensuring that its leftmost edge coincides with the leftmost edge of the parent control, and its rightmost edge coincides with the rightmost edge of the parent control.

[0266] As can be seen, except for horizontal fill, the other three alignment methods ensure that the size of the child control itself is consistent with its actual size when laying out, only affecting the starting point. Horizontal fill, however, stretches the child control during layout, ensuring that it fills the entire horizontal area.

[0267] Vertical alignment: There are four vertical alignment methods, including: Vertical upward alignment: The top edge of the child control coincides with the top edge of the parent control, serving as the starting point. Vertical center alignment: The center point of the child control in the y-direction coincides with the center point of the parent control in the y-direction, serving as the starting point. Vertical downward alignment: The bottom edge of the child control coincides with the bottom edge of the parent control, serving as the starting point. Vertical fill: Stretch and compress the child control so that its top edge coincides with the top edge of the parent control, and its bottom edge coincides with the bottom edge of the parent control.

[0268] Fill: Fill represents the offset of the child control relative to the starting point. Fill can be set in four directions: top, bottom, left, and right.

[0269] like Figure 25 As shown, the left padding is set to 30 pixels, so you can see that the child control has a 30-pixel offset relative to the parent control. If the 30-pixel offset weren't set, because it's horizontal padding, the leftmost edge of the child control should be at the starting point, which is also the leftmost edge of the parent control. Therefore, padding is essentially an offset relative to the starting point in the layout, and this offset can be negative. For example... Figure 25 If the rightmost position is -30, then the rightmost position of the child control will exceed the display range of the parent control and will be offset 30 pixels to the right. Similarly, top padding is the offset relative to the topmost starting point, and bottom padding is the offset relative to the bottommost starting point.

[0270] Horizontal alignment can be achieved using horizontal fill, and vertical alignment can be achieved using vertical alignment. Then, the offset values ​​in the four directions of the fill are calculated.

[0271] like Figure 26 As shown, during the forward guidance process, when calculating the slots of the UMG's child controls, the WHXY values ​​of the control's layer and the WHXY values ​​of the child controls are read, and then the values ​​in the slot information are calculated according to the strategy.

[0272] In the Button control, the strategy is:

[0273] Get the layer information (WHXY) of the child and parent controls;

[0274] Calculate the horizontal left offset: child control X – parent control X;

[0275] Calculate the horizontal offset to the right: child control X + child control W - (parent control X + parent control W);

[0276] Calculate the vertical top offset: child control Y – parent control Y;

[0277] Calculate the vertical bottom offset: child control Y + child control H - (parent control Y + parent control Y);

[0278] Set the fill value of the child control (left offset, right offset, top offset, bottom offset), horizontal fill, and vertical fill.

[0279] SizeBox control:

[0280] Similar to the Button control, its child control slots are size box slots. Therefore, the calculation rules are the same as for the Button control. The strategy remains the same: horizontal alignment uses horizontal fill, vertical alignment uses vertical fill, and then the offset values ​​in the four directions of the fill are calculated.

[0281] Checkbox:

[0282] The checkbox control has a default checkmark icon as a child control, and you can add another child control in addition. For example... Figure 10 As shown, the layout of these two controls is such that they are vertically centered and horizontally left-aligned. The default order is that the checkmark icon comes first, followed by the added child controls, and they are distributed horizontally.

[0283] Get the WHXY layer of the checked pattern, and get the WHXY layer of the child control;

[0284] Left fill = Sub-control layer X - (Checked pattern layer X + Checked pattern layer W);

[0285] Get the WHXY values ​​of the parent control's checkbox layer;

[0286] Top fill = child control layer Y + child control layer H / 2 – (parent control layer Y + parent control layer H / 2);

[0287] Right padding and bottom padding = 0;

[0288] Set the fill parameters for the checkboxes, and leave the rest at their default values.

[0289] ScaleBox control:

[0290] The child control slot of the zoom box control is the zoom box slot. However, it cannot set the padding; it can only set the horizontal and vertical alignment. For example... Figure 11 As shown, the position of its child controls relative to it can only be one of nine layout methods, not an arbitrary position.

[0291] To address this, we calculate the visually closest approach between the UMG and PSD files, and then set the horizontal and vertical alignment. Calculation rules:

[0292] Get the layer WHXY of the child control and the layer WHXY of the parent control;

[0293] Calculate the offset for the three horizontal alignment methods:

[0294] Horizontal left alignment offset OffsetLeft = child control X – parent control X;

[0295] Horizontal center alignment offset OffsetCenter = (child control X + child control W) / 2 - (parent control X + parent control W) / 2;

[0296] Horizontal right alignment offset OffsetRight = child control X + child control W – (parent control X + parent control W);

[0297] Choose the alignment with the smallest absolute value among OffsetLeft, OffsetCenter, and OffsetRight. For example, if OffsetLeft = -1, OffsetCenter = 20, and OffsetRight = 5, then |OffsetLeft| < |OffsetRight| < |OffsetCenter|, so choose horizontal left alignment.

[0298] Calculate the vertical alignment offset:

[0299] Vertical upward alignment offset OffsetTop = Child control Y – Parent control Y;

[0300] Vertical center alignment offset OffsetCenter = (child control Y + child control H) / 2 - (parent control Y + parent control H) / 2;

[0301] Vertical downward alignment offset OffsetBottom = child control Y + child control H – (parent control Y + parent control H);

[0302] Choose the alignment method that has the smallest absolute value among OffsetTop, OffsetCenter, and OffsetBottom.

[0303] Set the selected horizontal and vertical alignment of the scaling box slot of the child control.

[0304] Border control:

[0305] The child slots of the Border control are border slots, and their settings are exactly the same as those of the Button control. Therefore, their calculation rules are completely consistent with those of the Button control.

[0306] SafeZone security zone control:

[0307] The child control slots of SafeZone are safe zone slots, such as... Figure 9 As shown, there are quite a few parameters. However, what's actually left are H alignment, V alignment, and padding, and the rules are the same as for the Button. Therefore, the calculation rules are the same as for the Button, except that when setting the slot information, the vertical alignment is changed to V alignment and the horizontal alignment is changed to H alignment, while the other parameters use their default values.

[0308] Multi-container controls:

[0309] Canvas control:

[0310] It is the most commonly used multi-container control in UMG. Its characteristic is that all child controls are only related to the Canvas control, and not to their sibling child controls.

[0311] The slots of child controls of the Canvas control are canvas slots, which have many parameter settings, such as... Figure 12 As shown, using position X, position Y, dimension X, and dimension Y, with all other parameters using default settings, the calculation rules are as follows:

[0312] Get the layer WHXY of the child control and the layer WHXY of the parent control;

[0313] Set the canvas slot for child controls:

[0314] Size X = Subcontrol W;

[0315] Size Y = Subcontrol H;

[0316] Position X = Child control X - Parent control X;

[0317] Position Y = Child control Y – Parent control Y.

[0318] It can be said that the layout method of Canvas is exactly the same as that of PSD, making it the simplest container control.

[0319] HorizontalBox control:

[0320] The slots for child controls of a HorizontalBox are horizontal frame slots, such as... Figure 13 As shown, in addition to fill, horizontal alignment, and vertical alignment, there is an extra parameter: size. Size can be set to Auto or Fill (the difference between Auto and Fill is explained in the key terms description). If the child control slot is set to Auto, then the rules are the same as for single-container controls; however, if it is set to Fill, then areas need to be divided.

[0321] The horizontal frame is a multi-container control that can have multiple child controls, and each child control affects the layout of the others. For example, if child control A occupies a portion of the area, then child control B cannot be included in that area. Here, we need to explain the layout methods for multi-container controls:

[0322] Iterate through the size information of all child controls and divide the area for each child control;

[0323] Each child control is laid out relative to its assigned area, based on horizontal alignment, vertical alignment, and padding. (The layout of child controls relative to their area is the same as that of a single container.)

[0324] Therefore, it can be seen that size only affects the division of the area. Once the area is divided, it's aligned in the same way as the Button control. If the size is set to automatic, it will allocate the area to the child control just enough to accommodate it. If the size is set to fill, then a coefficient must be entered, and the display size of the area will be determined based on this coefficient. For example... Figure 27 As shown, the specific process for dividing the region is as follows:

[0325] Iterate through all child controls and get the width W of the parent control;

[0326] If the child control is set to Auto, then the remaining space Retain = parent control W - child control W;

[0327] If it is Fill, the total fill factor FillNum = total fill factor FillNum + sub-control size factor;

[0328] After the traversal is complete, the remaining space (Retain) and the total fill factor (FillNum) are obtained, which allows us to determine the size of the child control area of ​​Fill.

[0329] Set the starting point Start = parent control X, and begin traversing the child controls;

[0330] If the child control is set to Auto, then the area W of the child control is equal to the area W of the child control. Therefore, the range of the child control is [Start, Start + child control W], and the starting point is corrected to: Start = Start + child control W.

[0331] If the child control is Fill, then the area W of the child control is (child control size factor / FillNum) * Retain. Therefore, the area range of the child control is [Start, Start + (child control size factor / FillNum) * Retain], and the starting point is corrected to: Start = Start + (child control size factor / FillNum) * Retain.

[0332] Because it's a horizontal direction, the height of each area is [parent control Y, parent control Y + parent control H]. At this point, the area division for all child controls is complete, resulting in a rectangular area, also described using WHXY. The remaining steps involve determining the layout based on the vertical and horizontal alignment of the child controls relative to the area, just like a single-container layout.

[0333] The conversion strategy from PSD is to use the Fill function to fill child controls, and then position them using horizontal and vertical fill alignment and fill offset. This is done to prevent "collapse." In multi-container scenarios, if one child control collapses, it can cause layout calculation errors for the remaining child controls. Therefore, using Fill and consistent horizontal and vertical fill ensures that collapse does not occur. Specific calculation rules are as follows:

[0334] S1, read the WHXY of the parent control layer, set the split point Split = parent control X, and set the fill space Total = 0.

[0335] S2, traverse the child controls, read the WHXY values ​​of the child control layer, and execute step S3.

[0336] S3, creates a Rect area for a child control;

[0337] S3-1, Rect.x = Split;

[0338] S3-2, Rect.w = child control X + child control W – Split;

[0339] S3-3, Rect.y = parent control Y;

[0340] S3-4, Rect.h = parent control H;

[0341] Execute S4 after creation.

[0342] S4. If the current control is the last child control, then if Rect.x + Rect.w < parent control X + parent control W, then the remaining area should be allocated to the last child control. Therefore, Rect.w = parent control X + parent control W – Rect.x.

[0343] S5: After the area is divided, and the child controls are aligned with both horizontal and vertical fills, you only need to determine the fill value to get the specific value. Given the layer WHXY of the child control, define the area Rect assigned to it.

[0344] S5-1, fill left = child control X – Rect.x;

[0345] S5-2, fill right = Rect.x + Rect.w – (child control X + child control W);

[0346] S5-3, fill top = child control Y – Rect.y;

[0347] S5-4, fill bottom = Rect.y + Rect.h – (child control Y + child control H);

[0348] After the calculation is complete, execute S6.

[0349] S6, The fill parameters of the current child control have been calculated, start resetting the iteration conditions.

[0350] The starting point of the next child control's area, Split, equals the child control's X area plus the child control's W area plus the fill right area.

[0351] Total fill space = Total + child control W;

[0352] After execution, process the next child control and proceed to step S3. However, if it is already the last child control, proceed to step S7.

[0353] S7, calculate the fill factor for each child control. Iterate through each child control and set its fill factor Size.Value = child control W / Total.

[0354] S8 sets the calculation results to the slot information of each child control. These are the fill coefficient Size.Value, size fill, fill Left, Right, Top, Bottom, horizontal fill alignment, and vertical fill alignment.

[0355] After setting it up, you'll see that the UMG file has the same effect as the PSD file.

[0356] Vertical control:

[0357] The slots for child controls in a VerticalBox are vertical box slots. Like horizontal boxes, vertical boxes are multi-container controls, meaning they can have multiple child controls, and each child control affects the layout of the others. Each child control is assigned a region, and after the region is defined, the child controls are positioned relative to that region. The layout method is the same as for horizontal boxes, except that each child control is laid out starting vertically. Here are the layout rules:

[0358] Iterate through all child controls and get the height H of the parent control;

[0359] If the child control is set to Auto, then the remaining space Retain = parent control H – child control H;

[0360] If it is Fill, the total fill factor FillNum = total fill factor FillNum + sub-control size factor.

[0361] After the traversal is complete, the remaining space (Retain) and the total fill factor (FillNum) are obtained, which allows us to determine the size of the child control area of ​​Fill.

[0362] Set the starting point Start = parent control Y, and begin traversing child controls;

[0363] If the child control is set to Auto, then the area H of the child control is equal to the area H of the child control. Therefore, the range of the child control is [Start, Start + child control H], and the starting point is corrected to: Start = Start + child control H.

[0364] If the child control is Fill, then the area H of the child control is (child control size factor / FillNum) * Retain. Therefore, the area range of the child control is [Start, Start + (child control size factor / FillNum) * Retain], and the starting point is corrected to: Start = Start + (child control size factor / FillNum) * Retain.

[0365] Because it's a vertical direction, the horizontal range of each area is [parent control X, parent control X + parent control W]. At this point, the area division for all child controls is complete, resulting in a rectangular area, also described using WHXY. The remaining steps involve determining the layout based on the vertical and horizontal alignment of the child controls relative to the area, consistent with single-container layout.

[0366] To avoid "collapse," we uniformly use Fill and both horizontal and vertical fill to ensure that collapse does not occur. Specific calculation rules are as follows:

[0367] S1, read the WHXY of the parent control layer, set the split point Split = parent control Y, and set the fill space Total = 0.

[0368] S2, traverse the child controls, read the WHXY values ​​of the child control layer, and execute step S3.

[0369] S3, create a Rect area for a child control:

[0370] S3-1, Rect.x = parent control X;

[0371] S3-2, Rect.w = parent control W;

[0372] S3-3, Rect.y = Split;

[0373] S3-4, Rect.h = child control Y + child control H – Split;

[0374] Execute S4 after creation.

[0375] S4. If the current control is the last child control, then if Rect.y + Rect.h < parent control Y + parent control H, then the remaining area should be allocated to the last child control. Therefore, Rect.h = parent control Y + parent control H – Rect.y.

[0376] S5: After the area is divided, and the child controls are aligned with both horizontal and vertical fills, you only need to determine the fill value to get the specific value. Given the layer WHXY of the child control, define the area Rect assigned to it.

[0377] S5-1, fill left = child control X – Rect.x;

[0378] S5-2, fill right = Rect.x + Rect.w – (child control X + child control W);

[0379] S5-3, fill top = child control Y – Rect.y;

[0380] S5-4, fill bottom = Rect.y + Rect.h – (child control Y + child control H);

[0381] After the calculation is complete, execute S6.

[0382] S6, The fill parameters of the current child control have been calculated, start resetting the iteration conditions.

[0383] The starting point of the next child control's area, Split, equals the child control's Y-axis plus the child control's H-axis plus the fill bottom.

[0384] Fill space Total = Total + child control H;

[0385] After execution, process the next child control and proceed to step S3. However, if it is already the last child control, proceed to step S7.

[0386] S7, calculate the fill factor for each child control. Iterate through each child control and set its fill factor Size.Value = child control H / Total.

[0387] S8 sets the calculation results to the slot information of each child control. These are the fill coefficient Size.Value, size fill, fill Left, Right, Top, Bottom, horizontal fill alignment, and vertical fill alignment.

[0388] After setting it up, you'll see that the UMG file has the same effect as the PSD file.

[0389] StackBox control:

[0390] The child controls of a StackBox have slots that are stack box slots. Stack box controls can be set to vertical or horizontal orientation. When set to horizontal, the stack box is a HorizontalBox; when set to vertical, it is a VerticalBox. Therefore, the calculation rule for stack boxes is:

[0391] If the stack box is currently horizontal, use the settings of HorizontalBox to set all child controls; if the stack box is currently vertical, use the settings of VerticalBox to set all child controls.

[0392] ScrollBox control: The child controls of a ScrollBox have their own scrollbox slots. Scrollbox controls can be set to vertical or horizontal orientation. When set to horizontal, the scrollbox is a HorizontalBox; when set to vertical, it's a VerticalBox. Therefore, the calculation rule for the scrollbox is: if the scrollbox is currently horizontal, use the HorizontalBox setting method for all child controls; if the scrollbox is currently vertical, use the VerticalBox setting method for all child controls. Scrollboxes are similar to StackBoxes, the only difference being that scrollboxes can scroll out of bounds to reveal content, while StackBoxes cannot. However, their layout rules are consistent, so no special handling is needed.

[0393] Overlay Control: The child control slots of the Overlay control are overlay slots. You can see that only padding, horizontal alignment, and vertical alignment can be set. This is because although the Overlay is a multi-container control, the layout of each child control is only affected by the parent control; there is no relationship between the child controls themselves. Therefore, the alignment of each child control in the Overlay can be considered as the alignment rule for a Button control. The calculation rule is as follows:

[0394] S1, traverse all child controls, and then proceed to step S2.

[0395] S2, retrieves the layer information WHXY of the child and parent controls.

[0396] S3, calculate the left offset in the horizontal direction: child control X – parent control X.

[0397] S4, calculate the horizontal offset to the right: child control X + child control W - (parent control X + parent control W).

[0398] S5, calculate the top offset in the vertical direction: child control Y – parent control Y.

[0399] S6, Calculate the bottom offset in the vertical direction: child control Y + child control H - (parent control Y + parent control Y).

[0400] S7 sets the fill value of the child control (left offset, right offset, top offset, bottom offset), horizontal fill, and vertical fill.

[0401] S8, proceed to the next child control and proceed to step S2. If it is the last child control, then the process ends.

[0402] WidgetSwitcher control: Reflector control

[0403] The slots for child controls in WidgetSwitcher are control switcher slots. Like Overlay, WidgetSwitcher's layout for each child control depends only on its parent control and differs from other controls, so it uses the same algorithm, which will not be elaborated further. The difference between WidgetSwitcher and Overlay is that WidgetSwitcher can only display one child control at a time, while Overlay can display all child controls simultaneously, but this does not affect the UI layout algorithm.

[0404] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0405] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0406] According to another aspect of the embodiments of this application, an apparatus for generating an interface layout for implementing the above-described interface layout generation method is also provided. For example... Figure 28 As shown, the device includes:

[0407] The first display module 2802 is used to display design data for generating the interface layout, wherein the design data includes the shape parameters of the controls in the interface layout and the layer relationships;

[0408] The first determining module 2804 is used to determine the container category of the control based on the layer relationship, wherein the container category includes single-container controls and multi-container controls, the single-container control is allowed to contain one child control with a control slot, and the multi-container control is allowed to contain at least two child controls with the control slot;

[0409] The second determining module 2806 is used to determine the slot parameters corresponding to the control slot based on the container category and the shape parameters, wherein the slot parameters are used to indicate the display position of the corresponding control in the target engine;

[0410] The second display module 2808 is used to display the target interface layout in the target engine based on the slot parameters.

[0411] As an optional approach, the device determines the slot parameters corresponding to the control slot based on the container category and shape parameters in the following manner: when the container category is a single-container control, the device calculates the horizontal offset parameter in the horizontal direction and the vertical offset parameter in the vertical direction of the sub-control based on the shape parameters of the sub-control corresponding to the single-container control and the shape parameters of the single-container control, wherein the shape parameters include horizontal offset value, vertical offset value, width, and height; the device sets the fill offset based on the horizontal offset parameter and the vertical offset parameter, and sets the alignment mode corresponding to the sub-control to determine the slot parameters, wherein the slot parameters include the fill offset and the alignment mode, and the alignment mode includes horizontal alignment and vertical alignment.

[0412] As an optional approach, the device determines the slot parameters corresponding to the control slot based on the container category and shape parameters in the following manner: when the single container control includes at least one of a button control, a safe area control, a size box control, and a bounding box control, a left offset parameter is determined based on the horizontal offset value of the child control corresponding to the single container control and the horizontal offset value of the single container control, and a right offset parameter is determined based on the horizontal offset value and width of the child control and the horizontal offset value and width of the single container control, wherein the horizontal offset parameters include the left offset parameter and the right offset parameter; a top offset parameter is determined based on the vertical offset value of the child control and the vertical offset value of the single container control, and a bottom offset parameter is determined based on the vertical offset value and height of the child control and the vertical offset value and height of the single container control, wherein the vertical offset parameters include the top offset parameter and the bottom offset parameter; a fill offset is set based on the left offset parameter, the right offset parameter, the top offset parameter, and the bottom offset parameter, and the alignment mode of the child control is set to horizontal fill and vertical fill to determine the slot parameters.

[0413] As an optional approach, the device determines the slot parameters corresponding to the control slot based on the container category and shape parameters in the following manner: when the single container control includes a checkbox control, the left offset parameter is determined based on the horizontal offset value of the child control of the checkbox control, the horizontal offset value of the checkbox pattern, and its width; the top offset parameter is determined based on the vertical offset value and height of the child control and the vertical offset value and height of the checkbox control, wherein the vertical offset parameter includes the top offset parameter; the fill offset is set based on the left offset parameter and the top offset parameter, and the alignment mode of the child control is set to vertical center alignment and horizontal left alignment to determine the slot parameters.

[0414] As an optional approach, the device determines the slot parameters corresponding to the control slot based on the container category and shape parameters in the following manner: when the single container control includes a scaling box control, it determines the horizontal left offset parameter, horizontal center offset parameter, and horizontal right offset parameter based on the horizontal offset value and width of the child control of the scaling box control, as well as the horizontal offset value and width of the scaling box control; it determines the vertical upward offset parameter, vertical center offset parameter, and vertical downward offset parameter based on the vertical offset value and height of the child control, as well as the vertical offset value and height of the scaling box control; it determines the horizontal alignment mode of the child control based on the horizontal left offset parameter, horizontal center offset parameter, and horizontal right offset parameter, and determines the vertical alignment mode of the child control based on the vertical upward offset parameter, vertical center offset parameter, and vertical downward offset parameter, thereby determining the slot parameters.

[0415] As an optional approach, the device determines the alignment mode of the scaling box control in the horizontal direction based on horizontal left offset parameters, horizontal center offset parameters, and horizontal right offset parameters, and determines the alignment mode of the scaling box control in the vertical direction based on vertical upward offset parameters, vertical center offset parameters, and vertical downward offset parameters, thereby determining the slot parameters: setting the horizontal alignment mode of the sub-control with the smallest absolute value among the horizontal left offset parameters, horizontal center offset parameters, and horizontal right offset parameters; setting the vertical alignment mode of the sub-control with the smallest absolute value among the vertical upward offset parameters, vertical center offset parameters, and vertical downward offset parameters; and determining the slot parameters.

[0416] As an alternative, the device is used to determine the slot parameters corresponding to the control slot based on the container category and shape parameters in the following manner: when the container category is a multi-container control, the slot parameters are determined based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control.

[0417] As an optional approach, the device determines slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control in the following manner: when the slot type of the control slot is a canvas slot, the horizontal dimension offset of each sub-control is determined based on the width of each sub-control corresponding to the multi-container control, and the vertical dimension offset of each sub-control is determined based on the height of each sub-control; the horizontal position offset of each sub-control is determined based on the horizontal offset value of each sub-control and the horizontal offset value of the multi-container control, and the vertical position offset of each sub-control is determined based on the vertical offset value of each sub-control and the vertical offset value of the multi-container control; the slot parameters are determined based on the horizontal dimension offset, vertical dimension offset, vertical position offset, and horizontal position offset.

[0418] As an optional approach, the device determines slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control in the following manner: when the slot type of the control slot is a horizontal frame slot, and the multi-container control includes at least one of a horizontal frame control and a stack frame control and a scroll frame control set to the horizontal direction, the device sequentially traverses each sub-control of the multi-container control, divides each sub-control into corresponding regions based on the width of the multi-container control, the width of each sub-control, and the size information, and determines a first region offset parameter of each sub-control in the corresponding region based on the horizontal offset value, vertical offset value, width, and height of each sub-control; and determines slot parameters for each sub-control based on the first region offset parameter and a first fill factor, wherein the first fill factor is determined by the width of each sub-control and the first historical fill space corresponding to each sub-control, the first historical fill space is determined by the width of the previously traversed sub-control and the first historical fill space, and the initial value of the first historical fill space is 0.

[0419] As an optional solution, the device is used to sequentially traverse each child control of a multi-container control when the slot type of the control slot is a horizontal frame slot and the multi-container control includes at least one of a horizontal frame control and a stacked frame control and a scroll frame control set to a horizontal direction, in the following manner: Based on the width of the multi-container control, the width of each child control, and size information, a corresponding region is divided for each child control; and a first region offset parameter of each child control in the corresponding region is determined based on the horizontal offset value, vertical offset value, width, and height of each child control. When the slot type of the control slot is a horizontal frame slot and the multi-container control includes at least one of a horizontal frame control and a stacked frame control and a scroll frame control set to a horizontal direction, the device sequentially traverses each child control of the multi-container control and performs the following operation: where the control that divides the region each time is considered the first current control, the size information of the first current control is the fill mode, and the alignment mode of the first current control is horizontal fill and vertical fill: based on the vertical offset value of the multi-container control and... The vertical offset value and height of the region are determined. The horizontal offset value and width of the region are determined based on the first starting point position corresponding to the first current control, the horizontal offset value and width of the first current control. The first starting point position is determined by the horizontal offset value and width of the previously traversed child control and the right offset parameter. When the first current control is the first traversed child control, the first starting point position is the horizontal offset value of the multi-container control. When the first current control is the last traversed child control, and the sum of the horizontal offset value and the width of the region is less than the sum of the horizontal offset value and the width of the multi-container control, the width of the region is determined by the horizontal offset value, width and the horizontal offset value of the region of the multi-container control. The left offset parameter, right offset parameter, top offset parameter and bottom offset parameter of the first current control are determined based on the vertical offset value, region height, region horizontal offset value, region width and the horizontal offset value, vertical offset value, width and height of the first current control. The first region offset parameter includes the left offset parameter, right offset parameter, top offset parameter and bottom offset parameter.

[0420] As an optional approach, the device determines slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control in the following manner: when the slot type of the control slot is a vertical box slot, and the multi-container control includes a vertical box control and at least one of a stack box control and a scroll box control set in a vertical direction, the device sequentially traverses each sub-control of the multi-container control, divides each sub-control into corresponding regions based on the height of the multi-container control, the height of each sub-control, and the size information, and determines a second region offset parameter of each sub-control in the corresponding region based on the horizontal offset value, vertical offset value, width, and height of each sub-control; and determines slot parameters for each sub-control based on the second region offset parameter and a second fill factor, wherein the second fill factor is determined by the height of each sub-control and the second historical fill space corresponding to each sub-control, the second historical fill space is determined by the height of the previously traversed sub-control and the second historical fill space, and the initial value of the second historical fill space is 0.

[0421] As an optional solution, the device is used to sequentially traverse each sub-control of a multi-container control when the slot type of the control slot is a vertical box slot and the multi-container control includes at least one of a vertical box control and a stack box control and a scroll box control set in a vertical direction, in the following manner: Based on the height of the multi-container control, the height of each sub-control, and the size information, a corresponding region is divided for each sub-control; and based on the horizontal offset value, vertical offset value, width, and height of each sub-control, a second region offset parameter of each sub-control in the corresponding region is determined. The device then sequentially traverses each sub-control of the multi-container control and performs the following operations, wherein each control that divides the region is considered the second current control, the size information of the second current control is the fill mode, and the alignment mode of the second current control is horizontal fill and vertical fill: The horizontal offset value and region width of the region are determined based on the horizontal offset value and width of the multi-container control; and the second starting point position of the second current control is determined based on... The vertical offset and height of the region are determined by the vertical offset and height of the second current control. The position of the second starting point is determined by the vertical offset and height of the child controls previously traversed by the second current control, as well as the downward offset parameter. When the second current control is the first child control traversed, the position of the second starting point is the vertical offset of the multi-container control. When the second current control is the last child control traversed, and the sum of the region's vertical offset and height is less than the sum of the vertical offset and height of the multi-container control, the region's height is determined by the vertical offset, height, and region's vertical offset of the multi-container control. The left offset, right offset, top offset, and bottom offset parameters of the second current control are determined based on the region's vertical offset, region height, region horizontal offset, region width, and the second current control's horizontal offset, vertical offset, width, and height. The second region's offset parameters include the left offset, right offset, top offset, and bottom offset parameters.

[0422] As an optional approach, the device determines slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control in the following manner: When the sub-controls of the multi-container control do not affect each other, and the multi-container control includes at least one of an overlay control and a control reflector control, the device sequentially traverses each sub-control of the multi-container control, determines the left offset parameter of each sub-control based on the horizontal offset value of each sub-control and the horizontal offset value of the multi-container control, and determines the right offset parameter of each sub-control based on the horizontal offset value and width of each sub-control, as well as the horizontal offset value and width of the multi-container control; determines the top offset parameter of each sub-control based on the vertical offset value of each sub-control and the vertical offset value of the multi-container control, and determines the bottom offset parameter of each sub-control based on the vertical offset value and height of each sub-control, as well as the vertical offset value and height of the multi-container control; sets a fill offset based on the left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter, and sets the alignment mode of each sub-control to horizontal fill and vertical fill, thereby determining the slot parameters, wherein the slot parameters include the fill offset and the alignment mode.

[0423] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0424] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0425] According to one aspect of this application, a computer program product is provided, the computer program product comprising a computer program.

[0426] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0427] Figure 29 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown.

[0428] It should be noted that, Figure 29 The computer system 2900 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0429] like Figure 29 As shown, the computer system 2900 includes a central processing unit (CPU) 2901, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 2902 or programs loaded from storage section 2908 into random access memory (RAM) 2903. The RAM 2903 also stores various programs and data required for system operation. The CPU 2901, ROM 2902, and RAM 2903 are interconnected via a bus 2904. An input / output interface 2905 (I / O interface) is also connected to the bus 2904.

[0430] The following components are connected to the input / output interface 2905: an input section 2906 including a keyboard, mouse, etc.; an output section 2907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 2908 including a hard disk, etc.; and a communication section 2909 including a network interface card such as a local area network card, modem, etc. The communication section 2909 performs communication processing via a network such as the Internet. A drive 2910 is also connected to the input / output interface 2905 as needed. Removable media 2911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on the drive 2910 as needed so that computer programs read from them can be installed into the storage section 2908 as needed.

[0431] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 2909, and / or installed from removable medium 2911. When the computer program is executed by central processing unit 2901, it performs various functions defined in the system of this application.

[0432] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 2909, and / or installed from removable media 2911. When the computer program is executed by central processing unit 2901, it performs various functions provided in the embodiments of this application.

[0433] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described interface layout generation method is also provided. This electronic device may be... Figure 1 The terminal device or server shown. This embodiment uses this electronic device as an example for illustration. Figure 30 As shown, the electronic device includes a memory 3002 and a processor 3004. The memory 3002 stores a computer program, and the processor 3004 is configured to execute the steps in any of the above method embodiments via the computer program.

[0434] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.

[0435] Optionally, in this embodiment, the processor may be configured to execute the methods in the embodiments of this application via a computer program.

[0436] Alternatively, as those skilled in the art will understand, Figure 30 The structure shown is for illustrative purposes only. Figure 30 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 30 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 30 The different configurations shown.

[0437] The memory 3002 can be used to store software programs and modules, such as the program instructions / modules corresponding to the interface layout generation method and apparatus in this embodiment. The processor 3004 executes various functional applications and data processing by running the software programs and modules stored in the memory 3002, thereby realizing the aforementioned interface layout generation method. The memory 3002 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 3002 may further include memory remotely located relative to the processor 3004, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 3002 may be used, but is not limited to, to store design data and other information. As an example, such as... Figure 30 As shown, the memory 3002 may include, but is not limited to, the first display module 2802, the first determining module 2804, the second determining module 2806, and the second display module 2808 in the interface layout generation device. Furthermore, it may include, but is not limited to, other module units in the interface layout generation device, which will not be elaborated upon in this example.

[0438] Optionally, the transmission device 3006 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 3006 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 3006 is a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0439] In addition, the above-mentioned electronic device also includes: a display 3008 for displaying the above-mentioned controls; and a connection bus 3010 for connecting the various module components in the above-mentioned electronic device.

[0440] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.

[0441] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of an electronic device reads computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the electronic device to perform the interface layout generation method provided in various alternative implementations of the above-described interface layout generation aspect.

[0442] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store methods for performing the embodiments of this application.

[0443] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0444] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0445] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more electronic devices to execute all or part of the steps of the methods described in the various embodiments of this application.

[0446] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0447] In the several embodiments provided in this application, it should be understood that the disclosed application can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0448] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0449] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0450] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.< / scrollbox>

Claims

1. A method for generating an interface layout, characterized in that, include: Display design data for generating the interface layout, wherein the design data includes the shape parameters of the controls in the interface layout and the layer relationships; The container category of the control is determined based on the layer relationship, wherein the container category includes single-container controls and multi-container controls. The single-container control is allowed to contain one child control with a control slot, and the multi-container control is allowed to contain at least two child controls with the control slot. Based on the container category and the shape parameters, the slot parameters corresponding to the control slot are determined, wherein the slot parameters are used to indicate the display position of the corresponding control in the target engine; The target interface layout is displayed in the target engine based on the slot parameters.

2. The method according to claim 1, characterized in that, Determining the slot parameters corresponding to the control slot based on the container category and the shape parameters includes: When the container category is the single container control, the horizontal offset parameter of the child control in the horizontal direction and the vertical offset parameter in the vertical direction are calculated based on the shape parameters of the child control corresponding to the single container control and the shape parameters of the single container control. The shape parameters include horizontal offset value, vertical offset value, width and height. Based on the horizontal offset parameter and the vertical offset parameter, the fill offset is set, and the alignment mode corresponding to the sub-control is set to determine the slot parameter, wherein the slot parameter includes the fill offset and the alignment mode, and the alignment mode includes horizontal alignment and vertical alignment.

3. The method according to claim 2, characterized in that, Determining the slot parameters corresponding to the control slot based on the container category and the shape parameters includes: When the single container control includes at least one of a button control, a safe area control, a size box control, and a bounding box control, a left offset parameter is determined based on the horizontal offset value of the child control corresponding to the single container control and the horizontal offset value of the single container control, and a right offset parameter is determined based on the horizontal offset value and width of the child control and the horizontal offset value and width of the single container control, wherein the horizontal offset parameter includes the left offset parameter and the right offset parameter; The top offset parameter is determined based on the vertical offset value of the child control and the vertical offset value of the single container control, and the bottom offset parameter is determined based on the vertical offset value and height of the child control and the vertical offset value and height of the single container control, wherein the vertical offset parameter includes the top offset parameter and the bottom offset parameter. Based on the left offset parameter, the right offset parameter, the top offset parameter, and the bottom offset parameter, the fill offset is set, and the alignment mode of the sub-control is set to horizontal fill and vertical fill, and the slot parameter is determined.

4. The method according to claim 2, characterized in that, Determining the slot parameters corresponding to the control slot based on the container category and the shape parameters includes: When the single container control includes a checkbox control, the left offset parameter is determined based on the horizontal offset value of the child controls of the checkbox control, the horizontal offset value of the checkbox pattern, and its width. The top offset parameter is determined based on the vertical offset value and height of the sub-control and the vertical offset value and height of the checkbox control, wherein the vertical offset parameter includes the top offset parameter; Based on the left offset parameter and the top offset parameter, the fill offset is set, and the alignment mode of the sub-control is set to vertical center alignment and horizontal left alignment, and the slot parameters are determined.

5. The method according to claim 2, characterized in that, Determining the slot parameters corresponding to the control slot based on the container category and the shape parameters includes: When the single container control includes a scaling box control, the horizontal left offset parameter, the horizontal center offset parameter, and the horizontal right offset parameter are determined based on the horizontal offset value and width of the child controls of the scaling box control and the horizontal offset value and width of the scaling box control. The vertical upward offset parameter, vertical center offset parameter, and vertical downward offset parameter are determined based on the vertical offset value and height of the sub-control and the vertical offset value and height of the zoom box control. Based on the horizontal left offset parameter, the horizontal center offset parameter, and the horizontal right offset parameter, the alignment mode of the sub-control in the horizontal direction is determined, and based on the vertical upward offset parameter, the vertical center offset parameter, and the vertical downward offset parameter, the alignment mode of the sub-control in the vertical direction is determined, and the slot parameter is determined.

6. The method according to claim 5, characterized in that, The process of determining the horizontal alignment mode of the scaling box control based on the horizontal left offset parameter, the horizontal center offset parameter, and the horizontal right offset parameter, and determining the vertical alignment mode of the scaling box control based on the vertical upward offset parameter, the vertical center offset parameter, and the vertical downward offset parameter, and determining the slot parameters, includes: Set the parameter with the smallest absolute value among the horizontal left offset parameter, the horizontal center offset parameter, and the horizontal right offset parameter to the alignment mode of the sub-control in the horizontal direction; Set the parameter with the smallest absolute value among the vertical upward offset parameter, the vertical center offset parameter, and the vertical downward offset parameter as the alignment mode of the sub-control in the vertical direction; Determine the slot parameters.

7. The method according to claim 1, characterized in that, Determining the slot parameters corresponding to the control slot based on the container category and the shape parameters includes: When the container category is the multi-container control, the slot parameters are determined based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control.

8. The method according to claim 7, characterized in that, The process of determining the slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control includes: When the slot type of the control slot is a canvas slot, the horizontal dimension offset of each sub-control is determined based on the width of each sub-control corresponding to the multi-container control, and the vertical dimension offset of each sub-control is determined based on the height of each sub-control. The horizontal offset of each sub-control is determined based on the horizontal offset value of each sub-control and the horizontal offset value of the multi-container control, and the vertical offset of each sub-control is determined based on the vertical offset value of each sub-control and the vertical offset value of the multi-container control. The slot parameters are determined based on the horizontal dimension offset, the vertical dimension offset, the vertical position offset, and the horizontal position offset.

9. The method according to claim 7, characterized in that, The process of determining the slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control includes: When the slot type of the control slot is a horizontal frame slot, and the multi-container control includes at least one of a horizontal frame control and a stack frame control and a scroll frame control set to the horizontal direction, the sub-controls of the multi-container control are traversed sequentially. Based on the width of the multi-container control, the width of each sub-control, and the size information, the corresponding area is divided for each sub-control. Based on the horizontal offset value, vertical offset value, width, and height of each sub-control, the first area offset parameter of each sub-control in the corresponding area is determined. Based on the first region offset parameter and the first fill coefficient of each sub-control, the slot parameter is determined for each sub-control respectively. The first fill coefficient is determined by the width of each sub-control and the first historical fill space corresponding to each sub-control. The first historical fill space is determined by the width of the previously traversed sub-control and the first historical fill space. The initial value of the first historical fill space is 0.

10. The method according to claim 9, characterized in that, When the slot type of the control slot is a horizontal frame slot, and the multi-container control includes at least one of a horizontal frame control and a stack frame control and a scroll frame control set to a horizontal direction, the process involves sequentially traversing each child control of the multi-container control, dividing each child control into corresponding areas based on the width of the multi-container control, the width of each child control, and the size information, and determining the first area offset parameter of each child control in the corresponding area based on the horizontal offset value, vertical offset value, width, and height of each child control, including: When the slot type of the control slot is a horizontal box slot, and the multi-container control includes at least one of a horizontal box control and a stack box control and a scroll box control set to the horizontal direction, the following operations are performed sequentially through each child control of the multi-container control, wherein the control that divides the area each time is regarded as the first current control, the size information of the first current control is the fill mode, and the alignment mode of the first current control is horizontal fill and vertical fill: The vertical offset value and height of the region are determined based on the vertical offset value and height of the multi-container control; The horizontal offset value and width of the region are determined based on the first starting point position corresponding to the first current control, the horizontal offset value and the width of the first current control. The first starting point position is determined by the horizontal offset value and width of the previously traversed child control and the right offset parameter. When the first current control is the first traversed child control, the first starting point position is the horizontal offset value of the multi-container control. When the first current control is the last traversed child control, and the sum of the horizontal offset value and the width of the region is less than the sum of the horizontal offset value and the width of the multi-container control, the width of the region is determined by the horizontal offset value, the width of the multi-container control and the horizontal offset value of the region. Based on the vertical offset value of the region, the height of the region, the horizontal offset value of the region, the width of the region, and the horizontal offset value, vertical offset value, width, and height of the first current control, the left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter of the first current control are determined, wherein the first region offset parameter includes the left offset parameter, the right offset parameter, the top offset parameter, and the bottom offset parameter.

11. The method according to claim 7, characterized in that, The process of determining the slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control includes: When the slot type of the control slot is a vertical box slot, and the multi-container control includes at least one of a vertical box control and a stack box control and a scroll box control set in the vertical direction, the sub-controls of the multi-container control are traversed sequentially. Based on the height of the multi-container control, the height of each sub-control, and the size information, the corresponding area of ​​each sub-control is divided. Based on the horizontal offset value, vertical offset value, width, and height of each sub-control, the second area offset parameter of each sub-control in the corresponding area is determined. Based on the second region offset parameter and the second fill coefficient of each sub-control, the slot parameter is determined for each sub-control respectively. The second fill coefficient is determined by the height of each sub-control and the second historical fill space corresponding to each sub-control. The second historical fill space is determined by the height of the previously traversed sub-control and the second historical fill space. The initial value of the second historical fill space is 0.

12. The method according to claim 11, characterized in that, When the slot type of the control slot is a vertical box slot, and the multi-container control includes a vertical box control and at least one of a stack box control and a scroll box control set in a vertical direction, the process involves sequentially traversing each child control of the multi-container control, dividing each child control into corresponding areas based on the height of the multi-container control, the height of each child control, and the size information, and determining a second area offset parameter for each child control within the corresponding area based on the horizontal offset value, vertical offset value, width, and height of each child control, including: The following operations are performed sequentially on each child control of the multi-container control, wherein the control that divides the area each time is regarded as the second current control, the size information of the second current control is the fill mode, and the alignment mode of the second current control is horizontal fill and vertical fill: The horizontal offset value and width of the region are determined based on the horizontal offset value and width of the multi-container control; The vertical offset value and height of the region are determined based on the second starting point position corresponding to the second current control, the vertical offset value and the height of the second current control. The second starting point position is determined by the vertical offset value and height of the child controls previously traversed by the second current control, as well as the downward offset parameter. When the second current control is the first child control traversed, the second starting point position is the vertical offset value of the multi-container control. When the second current control is the last child control traversed, and the sum of the vertical offset value and the height of the region is less than the sum of the vertical offset value and the height of the multi-container control, the height of the region is determined by the vertical offset value, the height of the multi-container control, and the vertical offset value of the region. Based on the vertical offset value of the region, the height of the region, the horizontal offset value of the region, the width of the region, and the horizontal offset value, vertical offset value, width, and height of the second current control, the left offset parameter, right offset parameter, top offset parameter, and bottom offset parameter of the second current control are determined, wherein the second region offset parameter includes the left offset parameter, the right offset parameter, the top offset parameter, and the bottom offset parameter.

13. The method according to claim 7, characterized in that, The process of determining the slot parameters based on the slot type of the control slot, the shape parameters of each sub-control, and the shape parameters of the container control includes: When the child controls of the multi-container control do not affect each other, and the multi-container control includes at least one of overlay control and control reflector control, the child controls of the multi-container control are traversed sequentially, and the left offset parameter of each child control is determined based on the horizontal offset value of each child control and the horizontal offset value of the multi-container control, and the right offset parameter of each child control is determined based on the horizontal offset value and width of each child control and the horizontal offset value and width of the multi-container control. The top offset parameter of each sub-control is determined based on the vertical offset value of each sub-control and the vertical offset value of the multi-container control, and the bottom offset parameter of each sub-control is determined based on the vertical offset value and height of each sub-control and the vertical offset value and height of the multi-container control. Based on the left offset parameter, the right offset parameter, the top offset parameter, and the bottom offset parameter, the fill offset is set, and the alignment mode of each sub-control is set to horizontal fill and vertical fill, and the slot parameter is determined, wherein the slot parameter includes the fill offset and the alignment mode.

14. An apparatus for generating an interface layout, characterized in that, include: The first display module is used to display design data for generating the interface layout, wherein the design data includes the shape parameters of the controls in the interface layout and the layer relationships; The first determining module is used to determine the container category of the control based on the layer relationship, wherein the container category includes single-container controls and multi-container controls, the single-container control is allowed to contain one child control with a control slot, and the multi-container control is allowed to contain at least two child controls with the control slot; The second determining module is used to determine the slot parameters corresponding to the control slot based on the container category and the shape parameters, wherein the slot parameters are used to indicate the display position of the corresponding control in the target engine; The second display module is used to display the target interface layout in the target engine based on the slot parameters.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed by a processor, performs the method described in any one of claims 1 to 13.

16. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program performs the steps of the method described in any one of claims 1 to 13.

17. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 13 through the computer program.