Picture display method and device for screen switching, electronic equipment and storage medium
By setting the logical resolution and orientation of the game window on the terminal device and adjusting the display position and size of UI elements, the problem of large data processing volume during landscape and portrait screen switching is solved, improving screen switching efficiency and screen adaptability, and enhancing the gaming experience.
Patent Information
- Application Number
- CN202511080073.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-11-11
AI Technical Summary
During the switching between portrait and landscape modes, existing technologies require the maintenance of a large amount of configuration data, resulting in low screen switching efficiency and poor image adaptability.
By setting the logical resolution and logical orientation of the game window on the terminal device, the screen orientation switching situation is determined, and only the display position and size of UI elements are adjusted before and after the switching, so as to realize the mutual reuse of UI elements and reduce the amount of data processing.
It improves the efficiency of screen switching and the adaptability of image display, ensuring the smoothness of the landscape and portrait switching process and the gaming experience.
Smart Images

Figure CN120919633A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to screen display methods, apparatus, electronic devices and storage media for screen switching. Background Technology
[0002] Currently, most games are still landscape-oriented, allowing players to clearly observe details in the game scene and control virtual characters through interactions with UI elements such as controls. However, with advancements in terminal technology and gaming, screen display can now be adjusted, giving rise to portrait-oriented games. These games have rapidly gained popularity due to their ease of one-handed operation and suitability for fragmented gameplay.
[0003] In related technologies, to ensure the accuracy and richness of game display, a landscape UI, resources, and various positional configurations are set up in landscape mode to maximize the visual and operational experience. In order to ensure that the player's gaming experience is not affected in portrait mode, a set of UI, resources, and various positional configurations that match portrait mode are also set up to ensure the adaptability and accuracy of the graphical user interface display when the terminal device switches from landscape to portrait mode.
[0004] However, when switching between landscape and portrait modes using one set of configuration resources for landscape mode and another set for portrait mode, a lot of configuration data may need to be maintained, and a large amount of corresponding configuration data needs to be loaded in real time during the switching process, resulting in low efficiency in screen switching. Summary of the Invention
[0005] In view of this, the purpose of this disclosure is to provide a screen display method, apparatus, electronic device and storage medium for screen switching, which determines whether there is a screen orientation switch by setting the logical resolution and logical orientation of the game window displayed on the terminal device. Furthermore, for UI elements, only the display position and display size are adjusted before and after the switch, and all UI elements are reused to reduce the amount of maintenance and data processing during screen switching, thereby improving the efficiency of screen switching display and the screen display adaptability before and after the screen switch.
[0006] In a first aspect, embodiments of this disclosure provide a screen display method for screen switching, the screen display method comprising: Based on the size relationship between the length and width of the game window displayed on the terminal device at a first logical resolution, a first game screen is displayed in the game window with a first logical orientation; the first game screen displays at least a portion of the game scene and at least one UI element. In response to a change in the logical resolution of the game window, a second logical resolution of the game window is determined, and a second logical orientation is determined based on the size relationship between the width and height of the second logical resolution. Based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation to obtain the second game screen; wherein, each UI element under the second logical orientation reuses the function of the corresponding element under the first logical orientation. The second game screen is displayed in the game window with a second logical orientation.
[0007] Secondly, embodiments of this disclosure also provide a screen switching display device, the screen display device comprising: A first game screen display module is used to display a first game screen in the game window with a first logical orientation based on the size relationship between the length and width of the game window displayed on the terminal device and the first logical resolution of the game window; the first game screen displays at least a portion of the game scene and at least one UI element. The second logical orientation determination module is used to determine the second logical resolution of the game window in response to the change in the logical resolution of the game window, and to determine the second logical orientation based on the size relationship between the length and width of the second logical resolution. The second game screen determination module is used to adjust each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution, thereby obtaining the second game screen; wherein, each UI element under the second logical orientation reuses the corresponding element function under the first logical orientation; The second game screen display module is used to display the second game screen in the game window in a second logical orientation.
[0008] Thirdly, embodiments of this disclosure also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the screen switching display method as described in the first aspect.
[0009] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the screen switching display method as described in the first aspect.
[0010] The screen switching display method, apparatus, electronic device, and storage medium provided in this disclosure are based on the size relationship between the length and width of a game window displayed on a terminal device at a first logical resolution. A first game screen is displayed in the game window with a first logical orientation. The first game screen displays at least a portion of the game scene and at least one UI element. In response to a change in the logical resolution of the game window, a second logical resolution of the game window is determined, and a second logical orientation is determined based on the size relationship between the length and width of the second logical resolution. Based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation, resulting in a second game screen. Each UI element in the second logical orientation reuses the corresponding element function in the first logical orientation. The second game screen is displayed in the game window with the second logical orientation. Thus, by setting the logical resolution and logical orientation of the game window displayed on the terminal device, it is determined whether a screen orientation switch exists. Furthermore, the adjustment of the display position and size of UI elements before and after the switch is only a matter of mutual reuse, reducing the amount of data processing during maintenance and screen switching, thereby improving the efficiency of screen switching and the adaptability of the display before and after the screen switch.
[0011] Furthermore, during the game window's landscape / portrait switching process, the target scaling ratio can be determined based on the relationship between the virtual map's height and the logical resolution height after the switch. The virtual map is then processed according to the determined target scaling ratio before being displayed, which helps improve the aesthetics of the game screen and the player's gaming experience.
[0012] Furthermore, for the configuration data of the virtual characters displayed in the game screen, corresponding configuration data are configured under the first logical orientation (landscape) and the second logical orientation (portrait). After it is determined that the logical orientation of the game window has changed, the configuration is updated. After the configuration is updated, the data drives the performance change, so that the corresponding virtual characters, special effects and animations are updated synchronously. The battle process is not interrupted during the horizontal and vertical switching, realizing a seamless connection between the battle performance before and after the horizontal and vertical switching, improving the smoothness of the horizontal and vertical switching, and thus improving the player's game experience.
[0013] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this disclosure and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart illustrating a screen switching display method provided in an embodiment of this disclosure; Figure 2 A schematic diagram illustrating the logical orientation switching of a game window provided in an embodiment of this disclosure; Figure 3 A schematic diagram illustrating the instantiation of the first type of UI element and the second type of UI element provided in the embodiments of this disclosure; Figure 4 This is one of the schematic diagrams of a first game screen under a first logical orientation provided in an embodiment of this disclosure; Figure 5 This is one of the schematic diagrams of a second game screen under a second logical orientation provided in an embodiment of this disclosure; Figure 6 This is a schematic diagram of UI element stack switching provided in an embodiment of this disclosure; Figure 7 This is a second schematic diagram of a first game screen under a first logical orientation provided in an embodiment of this disclosure. Figure 8 This is a second schematic diagram of a second game screen under a second logical orientation provided in an embodiment of this disclosure; Figure 9 This is the third schematic diagram of the first game screen under the first logical orientation provided in the embodiments of this disclosure; Figure 10 This is the third schematic diagram of the second game screen under the second logical orientation provided in the embodiments of this disclosure; Figure 11 This is a schematic diagram of the configuration update driver process during the switching process provided in the embodiments of this disclosure; Figure 12 This is the fourth schematic diagram of the first game screen under the first logical orientation provided in the embodiments of this disclosure; Figure 13 This is the fourth schematic diagram of the second game screen under the second logical orientation provided in the embodiments of this disclosure; Figure 14 A schematic diagram of the structure of a screen switching display device provided in an embodiment of this disclosure; Figure 15 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. Based on the embodiments of this disclosure, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this disclosure.
[0017] First, the technical background of this disclosure will be introduced: Currently, most games are still landscape-oriented, allowing players to clearly observe details in the game scene and control virtual characters through interactions with UI elements such as controls. However, with advancements in terminal technology and gaming, screen display can now be adjusted, giving rise to portrait-oriented games. These games have rapidly gained popularity due to their ease of one-handed operation and suitability for fragmented gameplay.
[0018] In related technologies, to ensure the accuracy and richness of game display, a landscape UI, resources, and various positional configurations are set up in landscape mode to maximize the visual and operational experience. In order to ensure that the player's gaming experience is not affected in portrait mode, a set of UI, resources, and various positional configurations that match portrait mode are also set up to ensure the adaptability and accuracy of the graphical user interface display when the terminal device switches from landscape to portrait mode.
[0019] However, directly extending traditional landscape game implementations to portrait mode presents the following problems: Interface elements are prone to misalignment during screen orientation changes, requiring layout reconstruction but lacking a dynamic adaptation mechanism, leading to inconsistent button responses and incomplete content display; the operation logic and touch zones are not optimized for portrait mode, increasing the rate of accidental touches during one-handed operation. Furthermore, traditional adaptation solutions rely on multiple independent resources, requiring game resources of corresponding specifications based on screen orientation, potentially increasing development, testing, and maintenance costs by over 40% and making it difficult to maintain compatibility with frequently updated game content. The need to load large amounts of corresponding configuration data in real-time during screen orientation changes also results in low efficiency.
[0020] Based on this, the present disclosure provides a screen switching display method to reduce the amount of maintenance and data processing during screen switching, improve the efficiency of screen switching display, and enhance the adaptability of screen display before and after screen switching.
[0021] Please see Figure 1 , Figure 1 This is a flowchart illustrating a screen switching display method provided in an embodiment of this disclosure. Figure 1 As shown in the embodiments of this disclosure, the screen switching display method includes: S101. Based on the size relationship between the length and width of the first logical resolution of the game window displayed on the terminal device, a first game screen is displayed in the game window with a first logical orientation; the first game screen displays at least a portion of the game scene and at least one UI element.
[0022] S102. In response to the change in the logical resolution of the game window, determine the second logical resolution of the game window, and determine the second logical orientation based on the size relationship between the length and width of the second logical resolution.
[0023] S103. Based on the second logical resolution, each UI element is adjusted to adapt to the element display size and element display position of the second logical orientation to obtain the second game screen; wherein, each UI element under the second logical orientation reuses the element function corresponding to the first logical orientation.
[0024] S104. Display the second game screen in the game window with the second logical orientation.
[0025] The screen switching display method provided in this embodiment determines whether there is a screen orientation switch by setting the logical resolution and logical orientation of the game window displayed on the terminal device. Furthermore, for UI elements, only the display position and display size are adjusted before and after the switch, and all UI elements are reused to reduce the amount of maintenance and data processing during screen switching, thereby improving the efficiency of screen switching display and the screen display adaptability before and after the screen switch.
[0026] The exemplary steps of the embodiments of this disclosure are described below: S101. Based on the size relationship between the length and width of the first logical resolution of the game window displayed on the terminal device, a first game screen is displayed in the game window with a first logical orientation; the first game screen displays at least a portion of the game scene and at least one UI element.
[0027] In one alternative implementation, most games are still landscape-oriented, allowing players to clearly observe details in the game scene and control virtual characters through interactions with UI elements such as controls. However, with advancements in terminal technology and gaming, screen display can be adjusted, giving rise to portrait-oriented games. These games have rapidly developed due to their ease of one-handed operation and suitability for fragmented gameplay scenarios.
[0028] In related technologies, to ensure the accuracy and richness of game display, a landscape UI, resources, and various positional configurations are set up in landscape mode to maximize the visual and operational experience. In order to ensure that the player's gaming experience is not affected in portrait mode, a set of UI, resources, and various positional configurations that match portrait mode are also set up to ensure the adaptability and accuracy of the graphical user interface display when the terminal device switches from landscape to portrait mode.
[0029] However, when switching between landscape and portrait modes using a set of configuration resources for landscape mode and another set for portrait mode, a lot of configuration data may need to be maintained, and the corresponding data needs to be loaded in real time during the switching process, resulting in low efficiency in screen switching.
[0030] Based on this, the present disclosure provides a screen switching display method. By setting the logical resolution and logical orientation of the game window, it is determined whether there is a screen orientation switching situation. Furthermore, for UI elements, only the display position and display size are adjusted before and after the switching. All UI elements are reused to reduce the amount of maintenance and data processing during screen switching, thereby improving the efficiency of screen switching display and the screen display adaptability before and after the switching.
[0031] In one optional implementation, a logical resolution and logical orientation are set for the current game window. The logical orientation of the game window is determined based on the relationship between the length and width of the logical resolution, and is independent of the device orientation of the current terminal device.
[0032] Specifically, if the resolution length of the current game window is greater than its resolution width based on its logical resolution, then the logical orientation of the current game window is determined to be landscape; if the resolution length of the current game window is less than its resolution width based on its logical resolution, then the logical orientation of the current game window is determined to be portrait.
[0033] In one alternative implementation, when the terminal device is started, it is started with the logical orientation of landscape mode. That is, after the game starts, if the logical resolution of the current game window has not changed, the game window is displayed in landscape mode.
[0034] Specifically, the logical resolution is equal to the actual resolution of the current game window; that is, the value of the logical resolution is equal to the device resolution of the terminal device.
[0035] Here, device resolution refers to the screen dimensions of the hardware device, that is, the actual number of pixels the device has.
[0036] For example, the first logical resolution of the game window is consistent with the device resolution of the terminal device. The first logical resolution corresponds to the landscape orientation of the terminal device. If the device resolution of the terminal device is 1334*750, then the first logical resolution is also 1334*750.
[0037] In one alternative implementation, when the first game screen is displayed at a first resolution in the current game window, at least a portion of the game scene and at least one UI element are displayed in the first game screen.
[0038] Here, UI (User Interface) refers to all the visual and interactive elements in a game that allow players to interact with the game system. For example, UI elements are the components that players see on the screen, such as buttons, menus, icons, health bars, and maps, and how these UI elements respond to player actions such as clicks and swipes.
[0039] For example, one of the UI elements displayed in the current game screen is a view adjustment control. If a player triggers an operation on the view adjustment control, the orientation of the virtual character controlled by the player can be adjusted, thereby displaying different game screens in the graphical user interface.
[0040] Furthermore, it is necessary to monitor in real time whether the logical resolution of the game window changes. If it is determined that the logical resolution of the current game window has changed, the second logical resolution of the game window is determined, and based on the size relationship between the length and width of the second logical resolution, the second logical orientation is determined for subsequent adjustments.
[0041] S102. In response to the change in the logical resolution of the game window, determine the second logical resolution of the game window, and determine the second logical orientation based on the size relationship between the length and width of the second logical resolution.
[0042] In one optional implementation, the second logical resolution is the opposite of the device resolution of the terminal device; that is, the resolution width of the second logical resolution is smaller than the resolution height. The second logical resolution corresponds to the portrait orientation of the terminal device. For the above example, the second logical resolution is 750*1334.
[0043] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the logical orientation switching of the game window provided in an embodiment of this disclosure, as shown below. Figure 2 As shown, the current device resolution is 1334*750, width is 1334, and height is 750. The device's width is greater than its height, so it is in landscape mode. If the current logical resolution is also 1334*750, width is 1334, and height is 750, the width is greater than the height, and the current logical orientation is landscape. After switching, the logical resolution becomes 750*1334, width is 750, and height is 1334. The width is less than the height, and the logical orientation changes to portrait mode.
[0044] In one alternative implementation, the circumstances that cause the game window resolution to change may differ for different devices. For example, for terminal devices equipped with the iOS system, the game window resolution change is only triggered when the screen orientation changes, and the length and width are swapped. However, for terminal devices equipped with the Android system, due to the complexity of the Android system, in addition to the situation where the screen orientation changes, there is also a background picture-in-picture mode. For Android split-screen mode, the size of the game window is dynamically adjusted, and the current logical screen orientation is updated whenever the game window resolution changes.
[0045] In one alternative implementation, the change in the logical resolution of the game window may be triggered manually by the player or automatically by the device.
[0046] Specifically, the change in the logical resolution of the game window is determined through the following steps: a1: In response to a trigger operation on a screen control, determine that the logical resolution of the game window has changed; and / or, a2: In response to the gravity sensor of the terminal device receiving the pose adjustment signal of the terminal device, it is determined that the logical resolution of the game window has changed.
[0047] In one alternative implementation, a screen adjustment control can be set in the game screen. If it is determined that a player has triggered an operation on the screen adjustment control, and the player has issued a screen adjustment command, then it is determined that the logical resolution of the game window has changed.
[0048] In another alternative implementation, a gravity sensor is installed in the terminal device to monitor the acceleration data of the terminal device. Based on the changes in the acceleration data of the terminal device, the pose adjustment of the terminal device is determined. If a pose adjustment signal of the terminal device is received, it is determined that the logical resolution of the game window has changed.
[0049] Furthermore, after determining that the current game window is adjusted to the second logical resolution and the second logical orientation of the current game window, each UI element is adjusted to adapt its display size and position to the second logical orientation, thereby obtaining a second game screen adapted to the current logical orientation.
[0050] S103. Based on the second logical resolution, each UI element is adjusted to adapt to the element display size and element display position of the second logical orientation to obtain the second game screen; wherein, each UI element under the second logical orientation reuses the element function corresponding to the first logical orientation.
[0051] Furthermore, the selected second game screen is displayed in the game window, completing the device switch.
[0052] S104. Display the second game screen in the game window with the second logical orientation.
[0053] In this embodiment of the disclosure, when determining the second game screen, in order to ensure the adaptability of the second game screen display, it is necessary to adapt and adjust the UI elements in the game screen to ensure the accuracy of the game screen display. The following will describe the display adjustment of UI elements in the game screen.
[0054] In one alternative implementation, in order to ensure that the screen display after switching from the first logical orientation to the second logical orientation is completed quickly with minimal data configuration and data adjustment, the UI elements in the game screen can be classified, and the display method of the UI elements after the logical orientation switch can be determined according to the category to which the UI elements belong.
[0055] Specifically, the element categories of the UI elements include shared UI elements, first-class UI elements, and second-class UI elements; The shared UI elements are displayed simultaneously under both the first logical orientation and the second logical orientation; the first type of UI elements are displayed under the first logical orientation; and the second type of UI elements are displayed under the second logical orientation. The first type of UI element corresponds one-to-one with the second type of UI element. The corresponding first type of UI element and the second type of UI element have the same element function, but the element display position and element display size are different.
[0056] In one alternative implementation, shared UI elements can be displayed simultaneously under both the first logical orientation and the second logical orientation. Therefore, when displaying shared UI elements, no special underlying logic processing is required. It is only necessary to determine the display size and position of the shared UI elements based on the second logical resolution.
[0057] Specifically, when the element category of the UI element includes shared UI elements, the step "based on the second logical resolution, adjust each UI element to adapt its display size and position to the second logical orientation to obtain the second game screen" includes: b1: Based on the second logical resolution, adjust the display position and display size of the shared UI elements to determine the element display size and element display position of the shared UI elements that are adapted to the second logical resolution.
[0058] b2: Based on the element display size and element display position of the shared UI element, display the shared UI element in the second game screen.
[0059] In one alternative implementation, since shared UI elements can be displayed simultaneously under both the first and second logical orientations, it is not necessary to cancel the display of shared UI elements after switching from the first to the second logical orientation or vice versa. Instead, the display position and size of shared UI elements are adjusted directly according to the changed logical resolution to adapt the shared UI elements to the adjusted logical resolution and ensure the display accuracy of the game screen after the switch.
[0060] For example, if the current game window is in the first logical orientation (landscape), the shared UI element is a pop-up window with a width greater than its height. If the current game window switches from the first logical orientation to the second logical orientation (portrait), the pop-up window is retained, and the pop-up window is adapted to the display format of the second logical orientation, and is displayed as a pop-up window with a width less than its height.
[0061] In one alternative implementation, the first type of UI elements and the second type of UI elements are mirror images of each other. This ensures that the UI elements are completely isomorphic in both landscape and portrait modes. The second type of UI elements in portrait mode reuses the logic and implementation of the landscape UI to the maximum extent, thus minimizing the development workload.
[0062] In one optional implementation, during the underlying logic implementation, the class corresponding to the second type of UI element in portrait mode is a subclass of the class corresponding to the first type of UI element in landscape mode. When creating the class corresponding to the second type of UI element in portrait mode, it automatically inherits the attributes and methods (the functions of the UI element) of the class corresponding to the first type of UI element, and can implement new functions (the display position and display size of the UI element) through extension or modification.
[0063] For example, please refer to Figure 3 , Figure 3 A schematic diagram illustrating the instantiation of the first type of UI element and the second type of UI element provided in the embodiments of this disclosure, as shown below. Figure 3 As shown, the UIClassA_PortraitOri of the second type of UI element inherits from the UIClassA of the second type of UI element. In this way, UIClassA and UIClassA_PortraitOri are a pair of mirrored UIs. They were completely refactored before, with only differences in the layout and position of the child controls. Their functions are completely consistent, thus achieving maximum reusability with minimal workload, while ensuring the consistency of functions between the first and second types of UI elements. In each pair of mirrored UIs, the first type of UI element class corresponds to a second type of UI element class. The first type of UI element class is displayed in landscape mode, and the first type of UI element class is displayed in portrait mode.
[0064] In one alternative implementation, when switching between the first type of UI elements, the display of the current first type of UI element needs to be turned off when the logical orientation of the game window changes, and then the corresponding second type of UI element is displayed.
[0065] Specifically, when the element category of the UI element includes the first type of UI element, the step "based on the second logical resolution, adjust each UI element to adapt its display size and position to the second logical orientation to obtain the second game screen" includes: c1: Cancel the display of the first type of UI element and determine the second type of UI element corresponding to the first type of UI element.
[0066] c2: Display the second type of UI elements in the second game screen according to the element display size and element display position of the second type of UI elements under the second logical orientation.
[0067] In one alternative implementation, if the current UI element is a first type of UI element that is only displayed under the first logical orientation, then after determining that the game window has switched from the first logical orientation to the second logical orientation, it is necessary to cancel the modification of the first type of UI element, and display the second type of UI element in the second game screen according to the element display size and element display position of the second type of UI element under the second logical orientation.
[0068] For example, please refer to Figure 4 as well as Figure 5 , Figure 4 This is one of the schematic diagrams of a first game screen under a first logical orientation provided in an embodiment of this disclosure. Figure 5 This is one of the schematic diagrams of the second game screen under the second logical orientation provided in the embodiments of this disclosure, such as... Figure 4 as well as Figure 5 As shown, taking the backpack interface UI as an example, there are landscape backpack UIs and portrait backpack UIs. The backpack in landscape mode is an instance of the landscape backpack UI class, and the backpack in portrait mode is an instance of the portrait backpack UI class. Switching from landscape to portrait mode automatically closes the landscape backpack and automatically opens the portrait backpack; conversely, switching from portrait to landscape mode automatically closes the portrait backpack and automatically opens the landscape backpack.
[0069] In one alternative implementation, a player may open more than one UI element at the same time during the game. When the logical orientation of the current game window changes, it is necessary to keep the element display hierarchy of different UI elements unchanged, and then display each UI element in the second game screen according to the element category of each UI element.
[0070] Specifically, the step "based on the second logical resolution, adjust the display size and position of each UI element to fit the second logical orientation to obtain the second game screen" includes: d1: Determines the element display hierarchy among various UI elements.
[0071] d2: Based on the element category of each UI element, display each UI element in the second game screen according to its display size and position in the second logical orientation, and according to the corresponding element display level.
[0072] In this embodiment of the disclosure, the element display level of each UI element may refer to the occlusion situation of different elements when displayed in the game screen, etc. When a UI element with a higher element display level is displayed in the game screen, it will occlude UI elements with a lower element display level.
[0073] In one alternative implementation, a UI framework can be maintained during the underlying logic implementation to manage shared UI elements, first-class UI elements, and second-class UI elements. A stack can be used to manage all open UIs, with later-opened UIs on top of earlier-opened UIs. The UI stack is automatically restored after a change in orientation (horizontal or vertical), and the state of the first-class and second-class UI elements is automatically saved and restored.
[0074] Here, the display methods for shared UI elements, first-class UI elements, and second-class UI elements before and after switching are the same as those described above, and will not be repeated here.
[0075] For example, please refer to Figure 6 , Figure 6 This is a schematic diagram of UI element stack switching provided in the embodiments of this disclosure, such as... Figure 6 As shown, UI element C's C and C_PortraitOri, and UI element N's N and N_PortraitOri are mirror images of each other, representing the first and second types of UI elements. UI elements A and B are shared UI elements. Therefore, when switching from landscape to portrait mode, UI elements A and B, being shared UI elements, are retained. UI element C is replaced by its mirror image C_PortraitOri, and UI element N is replaced by its mirror image N_PortraitOri. Furthermore, the UI stack retains the opening order of the UI elements before and after the switch, ensuring the relative order of the opening layers of multiple interfaces after the landscape / portrait switch and maintaining UI consistency.
[0076] For example, please refer to Figure 7 as well as Figure 8 , Figure 7 This is the second schematic diagram of the first game screen under the first logical orientation provided in the embodiments of this disclosure. Figure 8 This is a second schematic diagram of the second game screen under the second logical orientation provided in the embodiments of this disclosure, as shown below. Figure 7 as well as Figure 8 As shown, in the first logical orientation (landscape), the X interface 710 (first type of UI element) is opened first, followed by the B interface 720 (shared UI element). After switching to the second logical orientation (portrait), this order is maintained, with the X interface 710 at the bottom and the B interface 720 at the top.
[0077] In another alternative implementation, a virtual map may also be displayed in the game interface. Regarding the display of the virtual map, after the game window switches from the first logical orientation to the second logical orientation, the display of the virtual map also needs to be adjusted to adapt to the change. The following will describe the display method of the virtual map before and after the switch: Specifically, the first game screen includes a virtual map; the screen display method further includes: e1: In response to a change in the logical resolution of the game window, determine the target scaling ratio of the virtual map based on the second logical resolution.
[0078] e2: After adjusting the virtual map according to the target scaling ratio, it is displayed in the second game screen.
[0079] In one alternative implementation, the virtual map is generally set according to a first logical orientation. That is, the width of the virtual map is generally greater than the height of the virtual map. At the same time, the height of the game window is relatively small under the first logical orientation, and the height of the virtual map is generally higher than the height of the game window. That is, only a part of the virtual map is displayed in the game window, and players can view the display of the virtual map in different positions by adjusting the virtual map.
[0080] Here, if you switch to the second logical orientation, the game window height will increase. At this point, the virtual map height may be smaller than the game window height, resulting in unrendered blank areas (usually black borders on the virtual map) in the game screen. This affects the aesthetics of the game display and consequently the player's gaming experience. Therefore, it's necessary to adjust the virtual map's scaling before and after the switch. Specifically, processing the virtual map according to the determined target scaling ratio before displaying it will help improve the aesthetics of the game screen and the player's gaming experience.
[0081] In one alternative implementation, the target scaling ratio for the virtual map can be determined by the ratio between the map height of the virtual map and the resolution height of the second resolution.
[0082] Specifically, the step "determining the target scaling ratio of the virtual map based on the second logical resolution" includes: f1: Determine the target scaling ratio based on the height ratio between the resolution height of the second logical resolution and the map height of the virtual map.
[0083] Here, based on the height ratio between the resolution height of the second logical resolution and the map height of the simulated map, the map height that best fits the current second logical resolution can be determined, and then the corresponding target scaling ratio can be determined. After scaling the virtual map, the virtual map is displayed in the second game screen in an appropriate manner.
[0084] In one alternative implementation, if it is determined that the height of the virtual map is greater than the resolution height of the second logical resolution, then there is no need to scale the virtual map; instead, the virtual map is displayed in the second game screen at its original display ratio.
[0085] In another optional implementation, if it is determined that the height of the virtual map is less than the resolution height of the second logical resolution, the virtual map needs to be scaled to a target scaling ratio before being displayed. The scaling ratio of the virtual map is set according to the historical scaling of the virtual map and the required display clarity of the virtual map. If the determined target scaling ratio does not exceed the preset scaling ratio, it is scaled according to the target scaling ratio. If the target scaling ratio is greater than the preset scaling ratio, the virtual map needs to be scaled according to the preset scaling ratio before being displayed in order to achieve the best display effect, thereby ensuring the scaling display effect.
[0086] Specifically, the step "adjusting the virtual map according to the target scaling ratio and displaying it in the second game screen" includes: g1: In response to the target scaling ratio being less than or equal to a preset scaling ratio, the virtual map is adjusted according to the target scaling ratio and displayed in the second game screen; or... g2: In response to the target scaling ratio being greater than the preset scaling ratio, the virtual map is adjusted according to the preset scaling ratio and then displayed in the second game screen.
[0087] In one optional implementation, the preset scaling ratio can be set according to the scaling of the historical virtual map and the required display clarity of the virtual map. The specific setting method is not limited here. For example, the preset scaling ratio can be 1.2 times the original display ratio.
[0088] In one possible implementation, if the target scaling ratio is greater than the preset scaling ratio, and the virtual map still cannot completely fill the current game screen after scaling the virtual map according to the preset scaling ratio, then for the part of the virtual map that cannot be filled, a gradient effect can be applied according to the display color of the virtual map to fill the area that the virtual map cannot fill, so as to ensure the aesthetics of the game screen display and thus improve the player's gaming experience.
[0089] For example, please refer to Figure 9 as well as Figure 10 , Figure 9 This is the third schematic diagram of the first game screen under the first logical orientation provided in the embodiments of this disclosure. Figure 10 This is the third schematic diagram of the second game screen under the second logical orientation provided in the embodiments of this disclosure, as shown below. Figure 9 as well as Figure 10 As shown, when the game window is in the first logical orientation, the height of the virtual map is greater than the resolution height of the first logical resolution, so part of the game scene in the virtual map is displayed in the game screen. In the first logical orientation, the virtual tree 910 cannot be fully displayed in the virtual map. When the game window is switched to the second logical orientation, the virtual map is adjusted according to the target scaling ratio, and the height of the virtual map becomes higher. At this time, the virtual tree 910 in the virtual map is fully displayed in the virtual map.
[0090] In another alternative implementation, a virtual character may also be displayed in the game interface. The control of the virtual character needs to be displayed according to different configuration data. The following will describe the display method of the virtual character before and after switching: Specifically, the screen display method further includes: h1: In response to a change in the logical resolution of the game window, based on the second configuration data for each virtual character under the second logical orientation, display the at least one virtual character in the second game screen.
[0091] The first game screen includes at least one virtual character; the at least one virtual character is displayed on the first game screen according to a first configuration data.
[0092] The first configuration data or the second configuration data of the virtual character includes at least one of the following: The virtual character's position in the game scene, the virtual character's skill effects, the virtual character's skill release position, and the virtual character's skill animation; the virtual character's skill effects and skill animations in the first configuration data and the second configuration data are consistent; the virtual character's position in the game scene and the virtual character's skill release position change according to the different logical resolutions of the game window.
[0093] In one optional implementation, configuration data for virtual characters is configured under a first logical orientation (landscape) and a second logical orientation (portrait). After determining that the logical orientation of the game window has changed, the configuration is updated. After the configuration is updated, the data drives the performance change, so that the corresponding virtual characters, effects and animations are updated synchronously. The battle process is not interrupted during the horizontal and vertical switching, and the battle performance before and after the horizontal and vertical switching is seamlessly connected, improving the smoothness of horizontal and vertical switching, thereby improving the player's game experience.
[0094] For example, please refer to Figure 11 , Figure 11 This is a schematic diagram of the configuration update driver process during the switching process provided in the embodiments of this disclosure, such as... Figure 11 As shown, when a screen orientation change event is detected, the virtual character placeholder configuration component determines whether the current configuration uses landscape configuration data (first configuration data) or portrait configuration data (second configuration data). After confirming that the configuration update is successful, the virtual character's position, effect release position, and character animation are updated. Then, in the display instance, the corresponding display is completed by updating the subroutine according to the character effect position and animation.
[0095] In one optional implementation, the virtual character's position and the skill release position will change depending on the first logical orientation and the second logical orientation. Specifically, the virtual character's position will change to adapt to the change in the second logical orientation, which will in turn cause the release position of the virtual skill to change.
[0096] For example, if the virtual skill is released for virtual character A, the corresponding skill effect needs to be displayed at the location of virtual character A after the virtual skill is released; if virtual character A is located in the upper right corner of the screen under the first logical orientation, the skill effect needs to be displayed in the upper right corner of the screen; if the game window is switched from the first logical orientation to the second logical orientation, and virtual character A is located at the top of the screen under the second logical orientation, the skill effect needs to be displayed at the top of the screen.
[0097] If a virtual skill is applied to multiple virtual characters simultaneously, the skill's release center needs to be determined based on the positions of the characters. The skill should then be released within the game window's display area, and the corresponding skill effects displayed should be shown. In the first logical orientation, if the skill's release center is in the center of the screen, the skill effects should be displayed centered on the screen center. However, if the game window switches from the first logical orientation to the second logical orientation, and the positions of the characters change, in the second logical orientation, if the skill's release center is in the upper left corner of the screen, the skill effects should be displayed centered on the upper left corner of the screen.
[0098] For example, please refer to Figure 12 as well as Figure 13 , Figure 12 This is the fourth schematic diagram of the first game screen under the first logical orientation provided in the embodiments of this disclosure. Figure 13 This is the fourth schematic diagram of the second game screen under the second logical orientation provided in the embodiments of this disclosure, as shown below. Figure 12 as well as Figure 13As shown, in the first logical orientation, different virtual characters are distributed on the left and right sides of the game screen. When the game window is switched from the first logical orientation to the second logical orientation, the virtual characters are distributed on the top and bottom sides of the game screen. However, the display of the virtual character information and skill effects is the same in both the first and second logical orientations, and the display method of skill effects is also the same. After the skill is released, the skill effect is displayed at the target object, and the character's health in the target object's character information decreases.
[0099] In this embodiment of the disclosure, the example of the game window switching from the first logical orientation to the second logical orientation is used for illustration. The switching method of the game window switching from the second logical orientation to the first logical orientation is the same as the switching method of switching from the first logical orientation to the second logical orientation, and will not be described again here.
[0100] The screen switching display method provided in this embodiment determines whether a screen orientation switch exists based on the size relationship between the width and height of a game window displayed on a terminal device and the first logical resolution. A first game screen is displayed in the game window with a first logical orientation. The first game screen displays at least a portion of the game scene and at least one UI element. In response to a change in the logical resolution of the game window, a second logical resolution of the game window is determined, and a second logical orientation is determined based on the size relationship between the width and height of the second logical resolution. Based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation, resulting in a second game screen. Each UI element in the second logical orientation reuses the corresponding element function in the first logical orientation. The second game screen is displayed in the game window with the second logical orientation. By setting the logical resolution and logical orientation of the game window displayed on the terminal device, it is determined whether a screen orientation switch exists. Furthermore, the adjustment of the display position and size of UI elements before and after the switch is only a matter of reuse, reducing the amount of data processing during maintenance and screen switching, thereby improving the efficiency of screen switching and the adaptability of the display before and after the screen switch.
[0101] Furthermore, during the game window's landscape / portrait switching process, the target scaling ratio can be determined based on the relationship between the virtual map's height and the logical resolution height after the switch. The virtual map is then processed according to the determined target scaling ratio before being displayed, which helps improve the aesthetics of the game screen and the player's gaming experience.
[0102] Furthermore, for the configuration data of the virtual characters displayed in the game screen, corresponding configuration data are configured under the first logical orientation (landscape) and the second logical orientation (portrait). After it is determined that the logical orientation of the game window has changed, the configuration is updated. After the configuration is updated, the data drives the performance change, so that the corresponding virtual characters, special effects and animations are updated synchronously. The battle process is not interrupted during the horizontal and vertical switching, realizing a seamless connection between the battle performance before and after the horizontal and vertical switching, improving the smoothness of the horizontal and vertical switching, and thus improving the player's game experience.
[0103] Based on the same inventive concept, this disclosure also provides a screen switching display device corresponding to the screen switching display method. Since the principle of the device in this disclosure for solving the problem is similar to the screen switching display method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0104] Please see Figure 14 , Figure 14 This is a schematic diagram of the structure of a screen switching display device provided in an embodiment of this disclosure. Figure 14 As shown, the screen display device 1400 includes: The first game screen display module 1410 is used to display a first game screen in the game window with a first logical orientation based on the size relationship between the length and width of the first logical resolution of the game window displayed on the terminal device; the first game screen displays at least a portion of the game scene and at least one UI element. The second logical orientation determination module 1420 is used to determine the second logical resolution of the game window in response to the change in the logical resolution of the game window, and to determine the second logical orientation based on the size relationship between the length and width of the second logical resolution. The second game screen determination module 1430 is used to adjust each UI element to adapt the element display size and element display position to the second logical orientation based on the second logical resolution, so as to obtain the second game screen; wherein, each UI element under the second logical orientation reuses the element function corresponding to the first logical orientation. The second game screen display module 1440 is used to display the second game screen in the game window in a second logical orientation.
[0105] In one optional implementation, the first game screen includes a virtual map; the screen display device 1400 further includes a virtual map display module (not shown in the figure), the virtual map display module being used for: In response to a change in the logical resolution of the game window, a target scaling ratio for the virtual map is determined based on the second logical resolution; The virtual map is adjusted according to the target scaling ratio and then displayed in the second game screen.
[0106] In one optional implementation, the first game screen includes at least one virtual character; the at least one virtual character is displayed on the first game screen according to a first configuration data; the screen display device 1400 further includes a virtual character display module (not shown in the figure), the virtual character display module being used for: In response to a change in the logical resolution of the game window, the at least one virtual character is displayed in the second game screen based on the second configuration data for each virtual character under the second logical orientation.
[0107] In one optional implementation, when the second game screen determination module 1430 adjusts the display size and position of each UI element to match the second logical orientation based on the second logical resolution to obtain the second game screen, the second game screen determination module 1430 is used to: Determine the display hierarchy of elements among the various UI elements; Based on the element category of each UI element, each UI element is displayed in the second game screen according to its display size and position in the second logical orientation, and in accordance with the corresponding element display hierarchy.
[0108] In one optional implementation, the element categories of the UI elements include shared UI elements, first-category UI elements, and second-category UI elements; The shared UI elements are displayed simultaneously under both the first logical orientation and the second logical orientation; the first type of UI elements are displayed under the first logical orientation; and the second type of UI elements are displayed under the second logical orientation. The first type of UI element corresponds one-to-one with the second type of UI element. The corresponding first type of UI element and the second type of UI element have the same element function, but the element display position and element display size are different.
[0109] In an optional implementation, when the element category of the UI element includes shared UI elements, the second game screen determination module 1430, when adjusting each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution to obtain the second game screen, is configured to: Based on the second logical resolution, adjust the display position and display size of the shared UI elements to determine the element display size and element display position of the shared UI elements that are adapted to the second logical resolution; Based on the display size and position of the shared UI elements, the shared UI elements are displayed in the second game screen.
[0110] In an optional implementation, when the element category of the UI element includes a first type of UI element, the second game screen determination module 1430, when adjusting each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution to obtain a second game screen, is configured to: Cancel the display of the first type of UI element, and determine the second type of UI element corresponding to the first type of UI element; Based on the display size and position of the second type of UI elements under the second logical orientation, display the second type of UI elements in the second game screen.
[0111] In an optional implementation, when the virtual map display module is used to determine the target zoom level of the virtual map based on the second logical resolution, the virtual map display module is used to: The target scaling ratio is determined based on the height ratio between the resolution height of the second logical resolution and the map height of the virtual map.
[0112] In an optional implementation, when the virtual map display module adjusts the virtual map according to the target scaling ratio and displays it in the second game screen, the virtual map display module is used to: In response to the target scaling ratio being less than or equal to a preset scaling ratio, the virtual map is adjusted according to the target scaling ratio and displayed in the second game screen; or... In response to the target scaling ratio being greater than the preset scaling ratio, the virtual map is adjusted according to the preset scaling ratio and then displayed in the second game screen.
[0113] In an optional implementation, the second logical orientation determination module 1420 is used to determine that the logical resolution of the game window has changed through the following steps: In response to a trigger operation on a screen control, determine that the logical resolution of the game window has changed; and / or, In response to the gravity sensor of the terminal device receiving a pose adjustment signal from the terminal device, it is determined that the logical resolution of the game window has changed.
[0114] In one optional implementation, the first configuration data or the second configuration data of the virtual character includes at least one of the following: The virtual character's position in the game scene, the virtual character's skill effects, the virtual character's skill release location, and the virtual character's skill animation; The skill effects and skill animations of the virtual characters in the first configuration data and the second configuration data are consistent; The virtual character's position in the game scene and the position where the virtual character releases skills vary depending on the logical resolution of the game window.
[0115] In one optional implementation, the first logical resolution is consistent with the device resolution of the terminal device; the second logical resolution is opposite to the device resolution of the terminal device; the first logical resolution corresponds to the landscape orientation of the terminal device; and the second logical resolution corresponds to the portrait orientation of the terminal device.
[0116] The screen switching display device provided in this embodiment of the present disclosure displays a first game screen in the game window with a first logical orientation based on the size relationship between the length and width of the first logical resolution of the game window displayed on the terminal device. The first game screen displays at least a portion of the game scene and at least one UI element. In response to a change in the logical resolution of the game window, a second logical resolution of the game window is determined, and a second logical orientation is determined based on the size relationship between the length and width of the second logical resolution. Based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation, resulting in a second game screen. Each UI element under the second logical orientation reuses the corresponding element function under the first logical orientation. The second game screen is displayed in the game window with the second logical orientation. In this way, by setting the logical resolution and logical orientation of the game window displayed on the terminal device, it is determined whether a screen orientation switch is currently occurring. Furthermore, for UI elements, only the display position and size are adjusted before and after the switch, and all UI elements are reused, thereby reducing the amount of data processing during maintenance and screen switching, and thus improving the efficiency of screen switching and the adaptability of the screen display before and after the screen switch.
[0117] Furthermore, during the game window's landscape / portrait switching process, the target scaling ratio can be determined based on the relationship between the virtual map's height and the logical resolution height after the switch. The virtual map is then processed according to the determined target scaling ratio before being displayed, which helps improve the aesthetics of the game screen and the player's gaming experience.
[0118] Furthermore, for the configuration data of the virtual characters displayed in the game screen, corresponding configuration data are configured under the first logical orientation (landscape) and the second logical orientation (portrait). After it is determined that the logical orientation of the game window has changed, the configuration is updated. After the configuration is updated, the data drives the performance change, so that the corresponding virtual characters, special effects and animations are updated synchronously. The battle process is not interrupted during the horizontal and vertical switching, realizing a seamless connection between the battle performance before and after the horizontal and vertical switching, improving the smoothness of the horizontal and vertical switching, and thus improving the player's game experience.
[0119] Please see Figure 15 , Figure 15 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Figure 15 As shown, the electronic device 1500 includes a processor 1510, a memory 1520, and a bus 1530.
[0120] Memory 1520 stores machine-readable instructions executable by processor 1510. When electronic device 1500 is running, processor 1510 communicates with memory 1520 via bus 1530, causing processor 1510 to execute the following instructions during operation: Based on the size relationship between the length and width of the game window displayed on the terminal device at a first logical resolution, a first game screen is displayed in the game window with a first logical orientation; the first game screen displays at least a portion of the game scene and at least one UI element. In response to a change in the logical resolution of the game window, a second logical resolution of the game window is determined, and a second logical orientation is determined based on the size relationship between the width and height of the second logical resolution. Based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation to obtain the second game screen; wherein, each UI element under the second logical orientation reuses the function of the corresponding element under the first logical orientation. The second game screen is displayed in the game window with a second logical orientation.
[0121] In one optional implementation, the instructions executed by the processor 1510 further include: In response to a change in the logical resolution of the game window, a target scaling ratio for the virtual map is determined based on the second logical resolution; The virtual map is adjusted according to the target scaling ratio and then displayed in the second game screen.
[0122] In one optional implementation, the first game screen includes at least one virtual character; the at least one virtual character is displayed on the first game screen according to a first configuration data; the instructions executed by the processor 1510 further include: In response to a change in the logical resolution of the game window, the at least one virtual character is displayed in the second game screen based on the second configuration data for each virtual character under the second logical orientation.
[0123] In one optional implementation, the instructions executed by the processor 1510, wherein adjusting each UI element to fit the element display size and element display position according to the second logical resolution to obtain the second game screen, includes: Determine the display hierarchy of elements among the various UI elements; Based on the element category of each UI element, each UI element is displayed in the second game screen according to its display size and position in the second logical orientation, and in accordance with the corresponding element display hierarchy.
[0124] In one optional implementation, the element categories of the UI elements include shared UI elements, first-category UI elements, and second-category UI elements; The shared UI elements are displayed simultaneously under both the first logical orientation and the second logical orientation; the first type of UI elements are displayed under the first logical orientation; and the second type of UI elements are displayed under the second logical orientation. The first type of UI element corresponds one-to-one with the second type of UI element. The corresponding first type of UI element and the second type of UI element have the same element function, but the element display position and element display size are different.
[0125] In one optional implementation, when the element category of the UI element includes shared UI elements, the step of adjusting each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution to obtain the second game screen includes: Based on the second logical resolution, adjust the display position and display size of the shared UI elements to determine the element display size and element display position of the shared UI elements that are adapted to the second logical resolution; Based on the display size and position of the shared UI elements, the shared UI elements are displayed in the second game screen.
[0126] In one optional implementation, when the element category of the UI element includes a first type of UI element, the step of adjusting each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution to obtain a second game screen includes: Cancel the display of the first type of UI element, and determine the second type of UI element corresponding to the first type of UI element; Based on the display size and position of the second type of UI elements under the second logical orientation, display the second type of UI elements in the second game screen.
[0127] In one optional implementation, the instructions executed by processor 1510, wherein determining the target scaling ratio of the virtual map based on the second logical resolution, includes: The target scaling ratio is determined based on the height ratio between the resolution height of the second logical resolution and the map height of the virtual map.
[0128] In one optional implementation, the instruction executed by processor 1510 to adjust the virtual map according to the target scaling ratio and display it in the second game screen includes: In response to the target scaling ratio being less than or equal to a preset scaling ratio, the virtual map is adjusted according to the target scaling ratio and displayed in the second game screen; or... In response to the target scaling ratio being greater than the preset scaling ratio, the virtual map is adjusted according to the preset scaling ratio and then displayed in the second game screen.
[0129] In one optional implementation, the instructions executed by the processor 1510 determine that the logical resolution of the game window has changed through the following steps: In response to a trigger operation on a screen control, determine that the logical resolution of the game window has changed; and / or, In response to the gravity sensor of the terminal device receiving a pose adjustment signal from the terminal device, it is determined that the logical resolution of the game window has changed.
[0130] In one optional implementation, the first configuration data or the second configuration data of the virtual character includes at least one of the following: The virtual character's position in the game scene, the virtual character's skill effects, the virtual character's skill release location, and the virtual character's skill animation; The skill effects and skill animations of the virtual characters in the first configuration data and the second configuration data are consistent; The virtual character's position in the game scene and the position where the virtual character releases skills vary depending on the logical resolution of the game window.
[0131] In one optional implementation, the first logical resolution is consistent with the device resolution of the terminal device; the second logical resolution is opposite to the device resolution of the terminal device; the first logical resolution corresponds to the landscape orientation of the terminal device; and the second logical resolution corresponds to the portrait orientation of the terminal device.
[0132] Using the above method, based on the size relationship between the length and width of the first logical resolution of the game window displayed on the terminal device, a first game screen is displayed in the game window with a first logical orientation; the first game screen displays at least part of the game scene and at least one UI element; in response to changes in the logical resolution of the game window, a second logical resolution of the game window is determined, and based on the size relationship between the length and width of the second logical resolution, a second logical orientation is determined; based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation, resulting in a second game screen; wherein, each UI element under the second logical orientation reuses the corresponding element function under the first logical orientation; the second game screen is displayed in the game window with the second logical orientation. In this way, by setting the logical resolution and logical orientation of the game window displayed on the terminal device, it can be determined whether a screen orientation switch is currently occurring. Furthermore, for UI elements, only the display position and size are adjusted before and after the switch; all UI elements are reused, reducing maintenance and data processing during screen switching, thereby improving the efficiency of screen switching and the adaptability of the display before and after the switch. Simultaneously, during the game window's landscape / portrait switching process, the target scaling ratio can be determined based on the relationship between the virtual map's height and the resolution height after the switch, and the determined target scaling ratio can be used to... Processing the virtual map proportionally before displaying it helps improve the aesthetics of the game screen and the player's gaming experience. Simultaneously, configuration data for the virtual characters displayed in the game screen is configured under both the first logical orientation (landscape) and the second logical orientation (portrait). Once the logical orientation of the game window changes, the configuration is updated. This data-driven change in configuration drives the performance changes, allowing the corresponding virtual characters, effects, and animations to update synchronously. The battle flow is not interrupted during landscape / portrait switching, achieving a seamless transition in battle performance before and after the switch, improving the smoothness of landscape / portrait switching, and ultimately enhancing the player's gaming experience.
[0133] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the following instructions: Based on the size relationship between the length and width of the game window displayed on the terminal device at a first logical resolution, a first game screen is displayed in the game window with a first logical orientation; the first game screen displays at least a portion of the game scene and at least one UI element. In response to a change in the logical resolution of the game window, a second logical resolution of the game window is determined, and a second logical orientation is determined based on the size relationship between the width and height of the second logical resolution. Based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation to obtain the second game screen; wherein, each UI element under the second logical orientation reuses the function of the corresponding element under the first logical orientation. The second game screen is displayed in the game window with a second logical orientation.
[0134] In one optional implementation, the instructions executed by the computer-readable storage medium further include: In response to a change in the logical resolution of the game window, a target scaling ratio for the virtual map is determined based on the second logical resolution; The virtual map is adjusted according to the target scaling ratio and then displayed in the second game screen.
[0135] In one optional implementation, the first game screen includes at least one virtual character; the at least one virtual character is displayed on the first game screen according to a first configuration data; the instructions executable by the computer-readable storage medium further include: In response to a change in the logical resolution of the game window, the at least one virtual character is displayed in the second game screen based on the second configuration data for each virtual character under the second logical orientation.
[0136] In one optional implementation, the instructions executed by the computer-readable storage medium, wherein adjusting each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution to obtain a second game screen, includes: Determine the display hierarchy of elements among the various UI elements; Based on the element category of each UI element, each UI element is displayed in the second game screen according to its display size and position in the second logical orientation, and in accordance with the corresponding element display hierarchy.
[0137] In one optional implementation, the element categories of the UI elements include shared UI elements, first-category UI elements, and second-category UI elements; The shared UI elements are displayed simultaneously under both the first logical orientation and the second logical orientation; the first type of UI elements are displayed under the first logical orientation; and the second type of UI elements are displayed under the second logical orientation. The first type of UI element corresponds one-to-one with the second type of UI element. The corresponding first type of UI element and the second type of UI element have the same element function, but the element display position and element display size are different.
[0138] In one optional implementation, in the instructions executable by the computer-readable storage medium, when the element category of the UI element includes shared UI elements, the step of adjusting each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution to obtain a second game screen includes: Based on the second logical resolution, adjust the display position and display size of the shared UI elements to determine the element display size and element display position of the shared UI elements that are adapted to the second logical resolution; Based on the display size and position of the shared UI elements, the shared UI elements are displayed in the second game screen.
[0139] In one optional implementation, in the instructions executable by the computer-readable storage medium, when the element category of the UI element includes a first type of UI element, the step of adjusting each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution to obtain a second game screen includes: Cancel the display of the first type of UI element, and determine the second type of UI element corresponding to the first type of UI element; Based on the display size and position of the second type of UI elements under the second logical orientation, display the second type of UI elements in the second game screen.
[0140] In one optional implementation, the instructions executable by the computer-readable storage medium, wherein determining the target scaling ratio of the virtual map based on the second logical resolution, includes: The target scaling ratio is determined based on the height ratio between the resolution height of the second logical resolution and the map height of the virtual map.
[0141] In one optional implementation, the instructions executed by the computer-readable storage medium, wherein adjusting the virtual map according to the target scaling ratio and displaying it in the second game screen, include: In response to the target scaling ratio being less than or equal to a preset scaling ratio, the virtual map is adjusted according to the target scaling ratio and displayed in the second game screen; or... In response to the target scaling ratio being greater than the preset scaling ratio, the virtual map is adjusted according to the preset scaling ratio and then displayed in the second game screen.
[0142] In one optional implementation, the instructions executed by the computer-readable storage medium determine that the logical resolution of the game window has changed through the following steps: In response to a trigger operation on a screen control, determine that the logical resolution of the game window has changed; and / or, In response to the gravity sensor of the terminal device receiving a pose adjustment signal from the terminal device, it is determined that the logical resolution of the game window has changed.
[0143] In one optional implementation, the first configuration data or the second configuration data of the virtual character includes at least one of the following: The virtual character's position in the game scene, the virtual character's skill effects, the virtual character's skill release location, and the virtual character's skill animation; The skill effects and skill animations of the virtual characters in the first configuration data and the second configuration data are consistent; The virtual character's position in the game scene and the position where the virtual character releases skills vary depending on the logical resolution of the game window.
[0144] In one optional implementation, the first logical resolution is consistent with the device resolution of the terminal device; the second logical resolution is opposite to the device resolution of the terminal device; the first logical resolution corresponds to the landscape orientation of the terminal device; and the second logical resolution corresponds to the portrait orientation of the terminal device.
[0145] Using the above method, based on the size relationship between the length and width of the first logical resolution of the game window displayed on the terminal device, a first game screen is displayed in the game window with a first logical orientation; the first game screen displays at least part of the game scene and at least one UI element; in response to changes in the logical resolution of the game window, a second logical resolution of the game window is determined, and based on the size relationship between the length and width of the second logical resolution, a second logical orientation is determined; based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation, resulting in a second game screen; wherein, each UI element under the second logical orientation reuses the corresponding element function under the first logical orientation; the second game screen is displayed in the game window with the second logical orientation. In this way, by setting the logical resolution and logical orientation of the game window displayed on the terminal device, it can be determined whether a screen orientation switch is currently occurring. Furthermore, for UI elements, only the display position and size are adjusted before and after the switch; all UI elements are reused, reducing maintenance and data processing during screen switching, thereby improving the efficiency of screen switching and the adaptability of the display before and after the switch. Simultaneously, during the game window's landscape / portrait switching process, the target scaling ratio can be determined based on the relationship between the virtual map's height and the resolution height after the switch, and the determined target scaling ratio can be used to... Processing the virtual map proportionally before displaying it helps improve the aesthetics of the game screen and the player's gaming experience. Simultaneously, configuration data for the virtual characters displayed in the game screen is configured under both the first logical orientation (landscape) and the second logical orientation (portrait). Once the logical orientation of the game window changes, the configuration is updated. This data-driven change in configuration drives the performance changes, allowing the corresponding virtual characters, effects, and animations to update synchronously. The battle flow is not interrupted during landscape / portrait switching, achieving a seamless transition in battle performance before and after the switch, improving the smoothness of landscape / portrait switching, and ultimately enhancing the player's gaming experience.
[0146] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0147] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus 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. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0148] 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.
[0149] In addition, the functional units in the various embodiments of this disclosure 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.
[0150] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion 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 a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0151] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A method for displaying images during screen switching, characterized in that, The screen display method includes: Based on the size relationship between the length and width of the game window displayed on the terminal device at a first logical resolution, a first game screen is displayed in the game window with a first logical orientation; the first game screen displays at least a portion of the game scene and at least one UI element. In response to a change in the logical resolution of the game window, a second logical resolution of the game window is determined, and a second logical orientation is determined based on the size relationship between the width and height of the second logical resolution. Based on the second logical resolution, each UI element is adjusted to adapt its display size and position to the second logical orientation to obtain the second game screen; wherein, each UI element under the second logical orientation reuses the function of the corresponding element under the first logical orientation. The second game screen is displayed in the game window with a second logical orientation.
2. The screen display method according to claim 1, characterized in that, The first game screen includes a virtual map; the screen display method further includes: In response to a change in the logical resolution of the game window, a target scaling ratio for the virtual map is determined based on the second logical resolution; The virtual map is adjusted according to the target scaling ratio and then displayed in the second game screen.
3. The screen display method according to claim 1, characterized in that, The first game screen includes at least one virtual character; the at least one virtual character is displayed on the first game screen according to a first configuration data; The screen display method further includes: In response to a change in the logical resolution of the game window, the at least one virtual character is displayed in the second game screen based on the second configuration data for each virtual character under the second logical orientation.
4. The screen display method according to claim 1, characterized in that, The step of adjusting each UI element to fit the display size and position of the element with the second logical orientation based on the second logical resolution to obtain the second game screen includes: Determine the display hierarchy of elements among the various UI elements; Based on the element category of each UI element, each UI element is displayed in the second game screen according to its display size and position in the second logical orientation, and in accordance with the corresponding element display hierarchy.
5. The screen display method according to claim 4, characterized in that, The UI elements are categorized into shared UI elements, first-class UI elements, and second-class UI elements. The shared UI elements are displayed simultaneously under both the first logical orientation and the second logical orientation; the first type of UI elements are displayed under the first logical orientation; and the second type of UI elements are displayed under the second logical orientation. The first type of UI element corresponds one-to-one with the second type of UI element. The corresponding first type of UI element and the second type of UI element have the same element function, but the element display position and element display size are different.
6. The screen display method according to claim 5, characterized in that, When the element category of the UI element includes shared UI elements, the step of adjusting each UI element to fit the element display size and element display position according to the second logical resolution to obtain the second game screen includes: Based on the second logical resolution, adjust the display position and display size of the shared UI elements to determine the element display size and element display position of the shared UI elements that are adapted to the second logical resolution; Based on the display size and position of the shared UI elements, the shared UI elements are displayed in the second game screen.
7. The screen display method according to claim 5, characterized in that, When the element category of the UI element includes the first type of UI element, the step of adjusting each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution to obtain the second game screen includes: Cancel the display of the first type of UI element, and determine the second type of UI element corresponding to the first type of UI element; Based on the display size and position of the second type of UI elements under the second logical orientation, display the second type of UI elements in the second game screen.
8. The screen display method according to claim 2, characterized in that, Determining the target zoom level of the virtual map based on the second logical resolution includes: The target scaling ratio is determined based on the height ratio between the resolution height of the second logical resolution and the map height of the virtual map.
9. The screen display method according to claim 2, characterized in that, The step of adjusting the virtual map according to the target scaling ratio and displaying it in the second game screen includes: In response to the target scaling ratio being less than or equal to a preset scaling ratio, the virtual map is adjusted according to the target scaling ratio and displayed in the second game screen; or... In response to the target scaling ratio being greater than the preset scaling ratio, the virtual map is adjusted according to the preset scaling ratio and then displayed in the second game screen.
10. The screen display method according to claim 1, characterized in that, The following steps are used to determine if the logical resolution of the game window has changed: In response to a trigger operation on the screen control, determine that the logical resolution of the game window has changed; And / or, In response to the gravity sensor of the terminal device receiving a pose adjustment signal from the terminal device, it is determined that the logical resolution of the game window has changed.
11. The screen display method according to claim 3, characterized in that, The first configuration data or the second configuration data of the virtual character includes at least one of the following: The virtual character's position in the game scene, the virtual character's skill effects, the virtual character's skill release location, and the virtual character's skill animation; The skill effects and skill animations of the virtual characters in the first configuration data and the second configuration data are consistent; The virtual character's position in the game scene and the position where the virtual character releases skills vary depending on the logical resolution of the game window.
12. The screen display method according to claim 1, characterized in that, The first logical resolution is the same as the device resolution of the terminal device; the second logical resolution is the opposite of the device resolution of the terminal device; the first logical resolution corresponds to the landscape orientation of the terminal device. The second logical resolution corresponds to the vertical screen orientation of the terminal device.
13. A screen switching display device, characterized in that, The display device includes: A first game screen display module is used to display a first game screen in the game window with a first logical orientation based on the size relationship between the length and width of the game window displayed on the terminal device and the first logical resolution of the game window; the first game screen displays at least a portion of the game scene and at least one UI element. The second logical orientation determination module is used to determine the second logical resolution of the game window in response to the change in the logical resolution of the game window, and to determine the second logical orientation based on the size relationship between the length and width of the second logical resolution. The second game screen determination module is used to adjust each UI element to adapt its display size and position to the second logical orientation based on the second logical resolution, thereby obtaining the second game screen; wherein, each UI element under the second logical orientation reuses the corresponding element function under the first logical orientation; The second game screen display module is used to display the second game screen in the game window in a second logical orientation.
14. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the screen switching display method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the screen switching display method according to any one of claims 1 to 12.