Game interface display method and electronic device
By separating the main scene and user interface elements in the unfolded state of the foldable screen and adjusting the screen parameters, the problems of poor display effect and high power consumption of foldable screen electronic devices in the unfolded state are solved, achieving a high-quality display and low-power gaming experience.
Patent Information
- Application Number
- PCT/CN2025/094861
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-12
- Filing Date
- 2025-05-14
- Publication Date
- 2026-01-15
AI Technical Summary
When electronic devices with foldable screens run games in their unfolded state, the game interface fails to adapt to the size of the foldable screen, resulting in poor display quality and high power consumption.
When the foldable screen is unfolded, the main scene and user interface elements in the game interface are displayed separately on different screens, and the display effect and power consumption are optimized by adjusting the screen parameters (brightness, refresh rate, resolution, touch refresh rate) of each screen.
It achieves high-quality display of the main scene, improves user experience, reduces the overall power consumption of electronic devices, avoids the obstruction and interference of interface elements on the screen, and optimizes game operation.
Smart Images

Figure CN2025094861_15012026_PF_FP_ABST
Abstract
Description
A method for displaying a game interface and an electronic device
[0001] This application claims priority to Chinese Patent Application No. 202410939776.3, filed on July 12, 2024, entitled "A Method for Displaying a Game Interface and an Electronic Device", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal technology, and in particular to a method for displaying a game interface and an electronic device. Background Technology
[0003] Electronic devices with foldable screens can have both folded and unfolded states. When the device is folded, the screen is folded, resulting in a smaller display area. When unfolded, the screen is not folded, leading to a larger display area. Currently, when running games on foldable devices in the unfolded state, the game interface does not fit the screen size, resulting in poor display quality and higher power consumption due to the larger screen. Summary of the Invention
[0004] This application provides a method for displaying a game interface and an electronic device. When displaying a game interface, the large screen area of the unfolded foldable screen can be fully utilized to take advantage of the large screen, and the power consumption of the electronic device can be reduced by adjusting the screen parameters as needed.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] Firstly, a method for displaying a game interface is provided, applicable to an electronic device with a foldable screen. The foldable screen includes a first screen and a second screen that can be folded and unfolded. When the electronic device is in the unfolded state, the foldable screen is also in the unfolded state, allowing the electronic device to use the large screen formed by the unfolded foldable screen to separately display the main scene and user interface elements in the game interface. Specifically, when the foldable screen is in the unfolded state and displays the first game interface of the game application, the first screen of the foldable screen can display the main scene of the first game interface, and the second screen of the foldable screen can display the user interface elements of the first game interface. The user interface elements may include operation controls, through which the main scene can be manipulated.
[0007] In addition, the screen parameters of the first screen and the screen parameters of the second screen can satisfy at least one of the following: the brightness of the second screen is less than the brightness of the first screen, the screen refresh rate of the second screen is less than the screen refresh rate of the first screen, the resolution of the second screen is less than the resolution of the first screen, and the touch refresh rate of the first screen is less than the touch refresh rate of the second screen.
[0008] In the above solution, when the foldable screen is unfolded, the main game scene and user interface elements are displayed separately on different screens of the foldable screen, making full use of the large screen space. Simultaneously, separating the main scene and user interface elements avoids user interface elements obscuring or interfering with the main scene, achieving high-quality output display of the main scene. Furthermore, it prevents user interface elements from obscuring the main scene when triggered by the user, improving the user's gaming experience when using the foldable screen.
[0009] In addition, the brightness of the second screen is lower than that of the first screen. On the one hand, this can improve the visual experience of users when playing games. On the other hand, it will not affect the user's touch operation on the second screen, and it can also reduce the power consumption of the second screen, thereby reducing the overall power consumption of the electronic device.
[0010] The refresh rate of the second screen is lower than that of the first screen. On the one hand, this can improve the smoothness and clarity of the main scene displayed on the first screen, enhancing the user's visual experience while playing games. On the other hand, the user interface elements displayed on the second screen are mainly used for user interaction with the game, and the requirements for the smoothness and clarity of the image are lower. Therefore, reducing the refresh rate of the second screen will not affect user operation, but will also reduce the power consumption of the second screen, thereby reducing the overall power consumption of the electronic device.
[0011] The resolution of the second screen is lower than that of the first screen. On the one hand, this ensures the clarity of the main scene and improves the user's visual experience. On the other hand, compared with the main scene, the second screen does not need as many pixels to display the details of the user interface. Therefore, reducing the resolution of the second screen can reduce its power consumption, thereby reducing the overall power consumption of the electronic device.
[0012] The touch refresh rate of the first screen is lower than that of the second screen. On the one hand, the higher touch refresh rate of the second screen can improve its sensitivity, reduce issues such as touch dropouts and operation delays, and enhance the user's gaming experience. On the other hand, the first screen is mainly used to display the main scene, and users rarely perform touch operations on it. Therefore, electronic devices can reduce the touch refresh rate of the first screen without affecting the user's visual experience while playing games, and also reduce the power consumption of the first screen, thereby reducing the overall power consumption of the electronic device.
[0013] In one possible implementation of the first aspect, the method may further include: if the first target temperature of the first screen is greater than or equal to a first temperature threshold, the electronic device may perform at least one of the following: reducing the resolution of the first screen to a first resolution, reducing the brightness of the first screen to a first brightness, reducing the screen refresh rate of the first screen to a first screen refresh rate, and reducing the touch refresh rate of the first screen to a first touch refresh rate.
[0014] In another possible implementation of the first aspect, the above method may further include: acquiring the first temperature of each temperature acquisition point of the first screen, and determining the maximum value of each first temperature as the first target temperature, or determining the average value of each first temperature as the first target temperature.
[0015] In the above scheme, determining the maximum temperature among all temperature sampling points on the first screen as the temperature of the first screen can more accurately reflect the highest temperature of the first screen, thus allowing for faster implementation of corresponding cooling measures. Determining the average temperature of all temperature sampling points on the first screen as the temperature of the first screen can more accurately reflect the average temperature of the first screen.
[0016] In another possible implementation of the first aspect, the above method may further include: if the second target temperature of the second screen is greater than or equal to the second temperature threshold, the electronic device may perform at least one of the following: reducing the resolution of the second screen to a second resolution, reducing the brightness of the second screen to a second brightness, reducing the screen refresh rate of the second screen to a second screen refresh rate, and reducing the touch refresh rate of the second screen to a second touch refresh rate.
[0017] Among them, the second temperature threshold is lower than the first temperature threshold, the second resolution is lower than the first resolution, the second brightness is lower than the first brightness, the second screen refresh rate is lower than the first screen refresh rate, and the second touch refresh rate is higher than the first touch refresh rate.
[0018] In the above solution, the second temperature threshold of the second screen is lower than the first temperature threshold of the first screen, which can ensure that the perceived temperature of the second screen is better, thereby improving the user experience.
[0019] In another possible implementation of the first aspect, the above method may further include: acquiring the second temperature of each temperature acquisition point of the second screen, and determining the maximum value of each second temperature as the second target temperature, or determining the average value of each second temperature as the second target temperature.
[0020] In the above scheme, determining the maximum temperature among all temperature sampling points on the second screen as the temperature of the second screen can more accurately reflect the highest temperature of the second screen, thus allowing for faster implementation of corresponding cooling measures. Alternatively, determining the average temperature of all temperature sampling points on the second screen as the temperature of the second screen can more accurately reflect the average temperature of the second screen.
[0021] In another possible implementation of the first aspect, the above method may further include: first, in response to a touch operation received on the second screen of the foldable screen, obtaining second initial point information of the second screen; then, using a touch algorithm to filter noise information in the second initial point information to obtain effective point information of the second screen; and finally, performing a corresponding touch operation on the second screen according to the effective point information.
[0022] In the above solution, a touch algorithm is used to process the second initial point information on the second screen to obtain more accurate and effective point information. As a result, when performing the corresponding touch operation, it can better meet the user's touch purpose and improve the user's operating experience.
[0023] In another possible implementation of the first aspect, the above-mentioned use of a touch algorithm to filter noise information in the second initial point information to obtain effective point information of the second screen may include: using a touch algorithm to filter noise information in the second initial point information to obtain target point information of the second screen, and using a touch algorithm to correct the target point information to obtain effective point information.
[0024] In another possible implementation of the first aspect, the above method may further include: in response to a touch operation received on the first screen of the foldable screen, obtaining first initial point information of the first screen, and performing a corresponding touch operation on the first screen according to the first initial point information.
[0025] In the above scheme, since the first screen displays the main scene, users rarely perform touch operations on it. Therefore, compared to the second screen, the accuracy requirement for the point information on the first screen is lower. Based on this, the electronic device does not need to process the initial point information; instead, it can directly execute the corresponding touch operation on the first screen based on the initial point information. In other words, when the electronic device acquires the initial point information on the first screen, it does not need to run a touch algorithm, which further reduces the power consumption of the electronic device.
[0026] In another possible implementation of the first aspect, the electronic device further includes a third screen. The method may also include: when the electronic device is in a folded state, the foldable screen is also folded, and the electronic device displays a second game interface of the game application on the third screen. The second game interface includes both the main scene screen of the game application and user interface elements.
[0027] In another possible implementation of the first aspect, the third screen is located behind the first screen, with the foldable screen in a folded state. The first and second screens face each other, and the size of the third screen corresponds to that of the first screen. Therefore, when the foldable screen is folded, the game interface is not displayed on the foldable screen but on the third screen, and the first game interface displayed on the third screen includes the main scene and user interface elements. When the foldable screen is unfolded, the main scene and user interface elements of the second game interface can be displayed separately on the first and second screens of the foldable screen.
[0028] In the above solution, in the folded state, the first game interface displayed on the third screen includes the main scene screen. In the unfolded state, the main scene screen of the second game interface is displayed on the first screen of the folded screen. Since the size of the third screen corresponds to that of the first screen, it is equivalent to the main scene screen being displayed on the screen of the corresponding size when the folded screen is in the two different physical states of folded and unfolded. This ensures that the display range of the main scene screen remains unchanged or changes little before and after the folded screen is unfolded. There is no significant reduction in the range of the main scene screen, nor is there any stretching or deformation, thus ensuring the output quality of the main scene screen.
[0029] In another possible implementation of the first aspect, before the second game interface of the game application is displayed on the foldable screen, the electronic device can separately draw the main scene screen and the user interface elements in different areas of the target frame buffer. Specifically, the size of the target frame buffer corresponds to the size of the foldable screen, the first target area corresponds to the first screen, and the second target area corresponds to the second screen. The electronic device can draw the main scene screen of the game application in the first target area of the target frame buffer and draw the user interface elements of the game application in the second target area of the target frame buffer.
[0030] The above solution improves the rendering logic of the game application, enabling the electronic device to separately render the main scene and user interface elements in different areas of the target frame buffer corresponding to the foldable screen size. This allows for convenient separate display of the main scene and user interface elements in the subsequent display stage without the need for additional graphics processing, thus improving the efficiency of separate display and avoiding the consumption of system resources caused by additional processing.
[0031] In another possible implementation of the first aspect, if the user interface elements of the game application are set to be drawn in a non-off-screen manner, then the drawing and rendering process of the game application is generally set to be executed in the default frame buffer. Since the size of the default frame buffer is set to correspond to the size of the third screen, it is only suitable for the drawing process of the game interface in the folded state. When the folded screen is in the unfolded state, the size of the default frame buffer needs to be adjusted to obtain a target frame buffer corresponding to the size of the folded screen in order to adapt to the drawing process of the game interface in the unfolded state.
[0032] In the above solution, for the case where the user interface elements of the game application are drawn in a non-off-screen manner, the size of the default frame buffer is adjusted to dynamically generate a target frame buffer that is size-adapted to the folded state, thus ensuring subsequent separate drawing.
[0033] In another possible implementation of the first aspect, if the game application sets the rendering method for the user interface elements to off-screen rendering, then when the folded screen is in a folded state, a target frame buffer with a size adapted to the folded state is dynamically generated to replace the first initial frame buffer corresponding to the user interface elements. The first initial frame buffer is the frame buffer originally set in the game application for drawing user interface elements. Subsequent rendering instructions for the first initial frame buffer are redirected to the target frame buffer so that the redirected rendering instructions are executed in the target frame buffer for rendering processing.
[0034] In the above solution, for the case where the user interface elements of the game application are drawn in an off-screen manner, a target frame buffer that is adapted to the size of the folded state is dynamically generated to replace the original first initial frame buffer set in the game application to execute the corresponding rendering instructions, thereby achieving separate drawing.
[0035] In another possible implementation of the first aspect, if the game application sets the main scene screen and user interface elements to share a frame buffer, it means that the game application sets the main scene screen and user interface elements to be drawn in the same frame buffer in real time. Therefore, the frame buffer for drawing the main scene screen must also be the frame buffer for drawing the user interface elements. Thus, the electronic device can identify the frame buffer that executes the most rendering instructions in the rendering process. The identified frame buffer is both the frame buffer for the main scene screen and the first initial frame buffer corresponding to the user interface elements.
[0036] It is understandable that when rendering each frame, the frame buffer executes a certain number of rendering instructions. The number of rendering instructions executed by the frame buffer is related to the richness of the scene content; the richer the scene content, the more rendering instructions are executed when rendering that scene. Since the scene content of the main scene is usually richer than that of the user interface elements, the frame buffer executing the main scene will execute more rendering instructions. In the above scheme, because the rendering characteristics of the main scene are more obvious or prominent, when the main scene and user interface elements of a game application share a frame buffer, the first initial frame buffer corresponding to the user interface elements can be identified more accurately and conveniently based on the rendering characteristics of the main scene.
[0037] In another possible implementation of the first aspect, the electronic device may identify a frame buffer corresponding to a preset resource type from the candidate frame buffers based on the resource type of the resources used by the candidate frame buffers, and use it as the first initial frame buffer; wherein, the preset resource type refers to the resource type of the resources required to draw the user interface elements of the game application.
[0038] In the above solution, the electronic device can also conveniently identify the first initial frame buffer corresponding to the user interface element based on the drawing characteristics of the user interface element itself and the preset resource type. This solution is applicable in any case, whether the main scene screen and the user interface element share a frame buffer or not, supports any type of game application, and improves applicability.
[0039] In another possible implementation of the first aspect, the user interface elements of the game application are drawn using off-screen rendering, and the game application sets the main scene and user interface elements to not share a frame buffer. For this type of game application, since they do not share a frame buffer, the game application is originally set to render user interface elements in real-time in a first initial frame buffer and the main scene in real-time in a second initial frame buffer. Based on the solution of this application embodiment, after the electronic device generates a new target frame buffer to replace the first initial frame buffer, it redirects the rendering instructions for the first initial frame buffer to the target frame buffer. The instruction redirected to the target frame buffer is only a second rendering instruction instructing the rendering of user interface elements. The electronic device can then respond to the redirected second rendering instruction and render the user interface elements in real-time within the second target area of the target frame buffer. The first rendering instruction instructing the rendering of the main scene is still executed in the second initial frame buffer according to the game application's settings, so as to render the main scene in real-time in the second initial frame buffer. Then, the electronic device can paste the main scene rendered in the second initial frame buffer to the first target area of the target frame buffer.
[0040] In the above solution, for the case where the drawing method corresponding to the user interface elements of the game application is off-screen drawing, and the main scene screen and user interface elements of the game application are set not to share the same frame buffer, the main scene screen and user interface elements are drawn separately in different areas of the target frame buffer. This solution is applicable to game applications with various settings. It achieves separate drawing and separate display without changing the game application, which greatly improves the applicability of the method.
[0041] In another possible implementation of the first aspect, when the user interface elements of the game application are drawn using off-screen rendering, the electronic device can also adjust the size of the default frame buffer; the adjusted size of the default frame buffer corresponds to the size of the foldable screen. After separating and drawing the main scene and user interface elements of the game application in the target frame buffer, the image content drawn in the target frame buffer can be pasted into the adjusted default frame buffer for display, effectively connecting the separate drawing and separate display.
[0042] The above solution effectively connects separate drawing and separate display, ensuring the separate display of the main scene and user interface elements in the unfolded state of the foldable screen.
[0043] In another possible implementation of the first aspect, for a first rendering instruction in the rendering instruction stream, a viewport setting function is called to set the viewport position in the first target area in the target frame buffer, so as to draw the main scene image indicated by the first rendering instruction in the first target area; for a second rendering instruction in the rendering instruction stream, the viewport setting function is called to set the viewport position in the second target area in the target frame buffer, so as to draw the user interface element indicated by the second rendering instruction in the second target area.
[0044] In the above scheme, by analyzing the rendering instruction stream and calling the viewport setting function, the viewport position in the target frame buffer is adjusted in a timely manner, thus quickly and accurately realizing the separate rendering of the main scene and user interface elements.
[0045] In another possible implementation of the first aspect, the game application might configure some user interface elements to be drawn on the main scene screen. For example, in a combat game, user interface elements used to indicate the user's combat power or energy value belong to a preset element type, while element types other than the preset element type belong to non-preset element types. Therefore, when processing the rendering instruction stream, for a second rendering instruction corresponding to a preset element type, the electronic device can call the viewport setting function to adjust the viewport position to the first target area, so as to draw the user interface element indicated by the second rendering instruction within the first target area, thereby making this type of user interface element drawn on the main scene screen. For other second rendering instructions corresponding to non-preset element types, the viewport setting function can be called to set the viewport position to the second target area in the target frame buffer, continuing to draw it separately from the main scene screen.
[0046] The above solution does not mechanically separate the main scene and user interface elements. Instead, it combines the display requirements of the game application's interface and supports drawing some special user interface elements in the first target area used to draw the main scene. This allows the final game interface to fully utilize the advantages of the large screen while meeting the display requirements of the game application and accurately restoring the amount of information that the game application wants to express in the game interface.
[0047] Secondly, this application provides an electronic device comprising at least: a foldable screen, a memory, and one or more processors. The foldable screen can be folded into a first screen and a second screen. The foldable screen is used to display images, and the memory is used to store computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method described in any of the first aspects above.
[0048] In one possible implementation of the second aspect, the aforementioned electronic device further includes a third screen. The electronic device has an inwardly folding screen. This third screen serves as the outer screen of the folding screen and is used to display images.
[0049] Thirdly, this application provides a chip system applied to an electronic device, the chip system including one or more processors, the processors being used to invoke computer instructions to cause the electronic device to perform any of the methods described in the first aspect above.
[0050] Fourthly, this application provides a computer storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method described in any of the first aspects above.
[0051] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform any of the methods described in the first aspect.
[0052] It should be understood that the technical effects of the second to fifth aspects mentioned above can refer to the technical effects of the first aspect and any of its possible implementations, which will not be elaborated upon here. Attached Figure Description
[0053] Figure 1 is a schematic diagram of a conventional game interface provided in one embodiment;
[0054] Figure 2 is a schematic diagram of the structure of a foldable screen electronic device according to an embodiment;
[0055] Figure 3 is one of the schematic diagrams showing the interface differences of a game interface provided in one embodiment;
[0056] Figure 4 is a second schematic diagram of interface differences in a game interface provided in one embodiment;
[0057] Figure 5 is a schematic diagram of the interface differences of a game interface provided in one embodiment;
[0058] Figure 6 is one of the schematic diagrams of a game interface provided in an embodiment of this application;
[0059] Figure 7 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0060] Figure 8 is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;
[0061] Figure 9 is a flowchart illustrating one of the methods for displaying a game interface according to an embodiment of this application;
[0062] Figure 10 is a schematic diagram of the interface of the inward folding screen provided in an embodiment of this application;
[0063] Figure 11 is a schematic diagram of the interface of the outward folding screen provided in an embodiment of this application;
[0064] Figure 12 is a schematic diagram of a separate drawing provided in an embodiment of this application;
[0065] Figure 13 is a schematic diagram of viewport position adjustment provided in an embodiment of this application;
[0066] Figure 14 is one of the schematic diagrams of separate drawing without sharing a frame buffer provided in the embodiments of this application;
[0067] Figure 15 is a second schematic diagram of separate drawing without sharing a frame buffer, provided by an embodiment of this application;
[0068] Figure 16 is a second schematic flowchart of a method for displaying a game interface according to an embodiment of this application;
[0069] Figure 17 is a third flowchart illustrating a method for displaying a game interface according to an embodiment of this application;
[0070] Figure 18 is a second schematic diagram of a game interface provided in an embodiment of this application;
[0071] Figure 19 is a schematic diagram of the structure of a chip system provided in an embodiment of this application. Detailed Implementation
[0072] The terms "first" and "second" used in the embodiments of this application are only used to distinguish features of the same type and should not be construed as indicating relative importance, quantity, order, etc.
[0073] The terms "exemplary" or "for example" used in the embodiments of this application are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0074] The terms "coupling" and "connection" used in the embodiments of this application should be interpreted broadly. For example, they can refer to a physical direct connection or an indirect connection achieved through electronic devices, such as a connection achieved through resistors, inductors, capacitors or other electronic devices.
[0075] First, some concepts involved in the embodiments of this application will be introduced.
[0076] 1. Touch Reporting Rate: This refers to the number of valid touch data points a touchscreen can provide per unit of time. It directly affects the operational response speed of electronic devices and the gaming experience. A higher reporting rate means a faster touchscreen response speed, better responsiveness, and a more accurate reproduction of touch trajectories on the touchscreen. In some examples, the touch reporting rate can also be called the touch refresh rate.
[0077] 2. Game Interface: This generally includes two parts: the main scene screen and the user interface (UI) elements. The main scene screen refers to the virtual game environment, used to present the virtual world within the game. The user interface elements serve as the bridge between the user and the game, and can include menus, buttons, icons, and prompts. For ease of understanding, Figure 1 will be used as a reference below.
[0078] Figure 1 shows a schematic diagram of a conventional game interface provided in one embodiment.
[0079] For example, as shown in Figure 1, a conventional game interface 100 may include a main scene screen and user interface elements 110. User interface elements 110 may include icons or controls for interacting with the game. The display areas of user interface elements 110 and the main scene screen overlap. For example, the user interface elements are displayed overlaid on the main scene screen with the main scene screen as the background.
[0080] 3. Foldable screen: This is a flexible screen with excellent flexibility and the ability to be bent and folded. Electronic devices with foldable screens can be in an unfolded or folded state during use. Based on the folding direction, electronic devices can be divided into inward-folding (folding screens that fold inwards) and outward-folding (folding screens that fold outwards) electronic devices. This will be explained below with reference to Figure 2.
[0081] Taking a foldable screen that can be folded to form a first screen and a second screen, and in the unfolded state, the first screen and the second screen form a large screen as an example, whether it is an inward folding screen or an outward folding screen, it includes a first screen and a second screen that can be folded and unfolded together. However, there are the following differences between inward folding screens and outward folding screens:
[0082] If an electronic device has an inward-folding screen, it may also include a third screen, which can be located behind either the first or second inner screen. When the inward-folding screen is folded (i.e., in its folded state), the first and second screens face each other or are not visible to the user, but the third screen is visible. Therefore, the third screen can also be called the "outer screen," and the inward-folding screen can be called the "inner screen." When the outward-folding screen is folded, the first and second screens face opposite directions and are both visible to the user.
[0083] Therefore, it can be seen that whether it is an inward-folding screen or an outward-folding screen, when it is unfolded, the first screen and the second screen are on the same plane, thus forming a complete display area. For easier understanding, the following explanation is based on Figure 2.
[0084] Figure 2 shows a schematic diagram of the structure of a foldable screen electronic device according to one embodiment.
[0085] In one embodiment, as shown in FIG2, when the electronic device is in the unfolded state, the folding screen is in the unfolded state, and the first screen 210 and the second screen 220 of the folding screen are on the same plane to form a large screen.
[0086] Currently, most game applications are designed for small screens and are not adapted for large screens, resulting in a poor experience when playing games on a foldable screen in its unfolded state. Examples are given below:
[0087] In one gaming scenario, to ensure fairness, using a unfolded foldable screen to play games may sacrifice the game's screen area compared to a larger screen.
[0088] Taking mobile phones as an example, standard candybar phones often have limited screen size, causing some content to be unreadable. Foldable phones, on the other hand, typically have a larger screen size when unfolded, allowing for a larger display area. However, for some types of games, displaying more game content is often advantageous, creating an unfair advantage. For instance, in competitive games, displaying more game content is often beneficial, so if a foldable phone displays more content advantageous to the player compared to a candybar phone, it would be unfair to players using candybar phones. To prevent the unfolded foldable screen from displaying more game content and ensure fairness, some solutions actually display less game content when the screen is unfolded. However, this affects the output quality of the game content. For clarity, Figure 3 will be used as a reference below.
[0089] Figure 3 shows one of the interface differences of a game interface provided in one embodiment.
[0090] For example, as shown in Figure 3A, mobile phone 310 is a candybar phone, and mobile phone 310 displays the traditional game interface 100 of the game application. As shown in Figure 3B, mobile phone 320 is a foldable screen phone, and mobile phone 320 displays the first large-screen game interface 330 of the game application. The traditional game interface 100 and the first large-screen game interface 330 are the same display interface of the same game application.
[0091] Comparing Figure 3A and Figure 3B, we can see that the screen size of mobile phone 320 is larger than that of mobile phone 310. However, in order to ensure fairness for users of mobile phone 310 when playing games, the game screen area of the first large screen game interface 330 is smaller than that of the traditional game interface 100, that is, the game screen area of the large screen is sacrificed.
[0092] In another gaming scenario, the game application's display interface is not adapted to the size of the unfolded foldable screen (i.e., a large screen). Therefore, when displaying the game interface on a large screen, the image is stretched to fit the screen size. This results in distorted and deformed game visuals, poor image quality, and negatively impacts the user's gaming experience. For easier understanding, Figure 4 will be used as a reference below.
[0093] Figure 4 shows a second schematic diagram of interface differences in a game interface provided by one embodiment.
[0094] For example, as shown in Figure 4A, mobile phone 310 is a candybar phone, displaying the traditional game interface 100 of a game application. As shown in Figure 4B, mobile phone 320 is a foldable phone, displaying a second large-screen game interface 410 of a game application. The traditional game interface 100 and the second large-screen game interface 410 are the same display interface for the same game application.
[0095] Comparing Figure 4A and Figure 4B, we can see that the screen size of phone 320 is larger than that of phone 310. However, in order to fill the large screen of the foldable phone when it is unfolded, the game screen of the second large screen game interface 410 is stretched, resulting in game screen distortion and poor image quality.
[0096] In another gaming scenario, only a portion of the unfolded foldable screen is used to display the game interface. This results in other areas being unused. For example, unused screen areas may only display black areas without any image content. As a result, the game interface is neither aesthetically pleasing nor does it make full use of the advantages of the large screen, thus wasting display resources.
[0097] Figure 5 shows a third schematic diagram of interface differences for a game interface provided in one embodiment.
[0098] For example, as shown in Figure 5A, mobile phone 310 is a candybar phone, and mobile phone 310 displays a traditional game interface 100 of a game application. As shown in Figure 5B, mobile phone 320 is a foldable screen phone, and mobile phone 320 displays the traditional game interface 100 in a portion of the screen area (such as the first screen), while the unused screen area (such as the second screen) is filled with black.
[0099] Comparing Figure 5A and Figure 5B, it can be seen that the game interface on the 320 mobile phone is neither aesthetically pleasing nor makes full use of the advantages of the large screen, thus wasting display resources.
[0100] In addition, in any of the above game scenarios, there is a problem of high power consumption of electronic devices, which causes the electronic devices to overheat during the game, resulting in a poor user gaming experience.
[0101] To address the aforementioned issues, this application provides a method for displaying a game interface, applicable to electronic devices with foldable screens. When the foldable screen of the electronic device is unfolded, the advantages of the large screen are fully utilized to separate the main scene and user interface elements in the game interface for display. Furthermore, the areas displaying the main scene and the user interface elements are partitioned, enhancing the user's gaming experience. It should be noted that the foldable screen in this application can be either an inward-folding or outward-folding screen; there is no limitation on either.
[0102] Specifically, when the foldable screen is unfolded, it makes full use of the large screen space, separating the main game scene and user interface elements and displaying them separately on different screens of the foldable screen. This prevents user interface elements from obstructing or interfering with the main scene, achieving high-quality output display of the main scene and enhancing the gaming experience when using the foldable screen.
[0103] Partitioning the area displaying the main scene and the area displaying user interface elements can include at least one of the following: making the screen brightness of the screen displaying user interface elements lower than that of the screen displaying the main scene; making the screen refresh rate of the screen displaying user interface elements lower than that of the screen displaying the main scene; making the touch refresh rate of the screen displaying user interface elements higher than that of the screen displaying the main scene; and making the resolution of the screen displaying user interface elements lower than that of the screen displaying the main scene. This not only ensures the display quality of the screen displaying the main scene but also reduces the power consumption of the screen displaying user interface elements without affecting the user's interactive experience. Reducing the power consumption of the screen displaying user interface elements not only lowers the screen temperature of the user interface elements, improving the user's operating experience, but also reduces the overall power consumption of the electronic device.
[0104] In one embodiment, when the foldable screen is in the folded state, the electronic device can display the game interface shown in Figure 1 (which can be referred to as the second game interface) on a screen visible to the user. When the foldable screen is in the unfolded state, the electronic device can separate and display the main scene of the game application and user interface elements in different screen areas of the foldable screen to form a new game interface (which can be referred to as the first game interface).
[0105] For example, continuing as shown in Figure 1, in the second game interface, the main scene screen can be the base background of the user interface elements, which may cause the user interface elements to obscure or interfere with the main scene screen in some cases.
[0106] Figure 6 shows one of the schematic diagrams of a game interface provided in an embodiment of this application.
[0107] For example, as shown in Figure 6, the unfolded foldable screen displays the first game interface. In this case, the foldable screen can include a first screen and a second screen. The first screen can display the main scene of the first game interface, and the second screen can display the user interface elements of the first game interface. Compared to the traditional game interface in Figure 1, the first game interface shown in Figure 6 separates the main scene and user interface elements onto two different screens, ensuring that the main scene and user interface elements do not obstruct or interfere with each other.
[0108] As shown in Figure 6, the user interface elements include some operation controls. Separating the user interface elements from the main scene display fully utilizes the advantages of the large screen and avoids obstructing the game scene when the user operates these control elements, greatly improving the user experience. Moreover, by avoiding obstruction during game operation, it is possible to reduce misoperations or invalid interactions, thereby avoiding the consumption of system resources to respond to these invalid interactions and achieving the goal of saving system resources.
[0109] Furthermore, compared to the first large-screen game interface shown in Figure 3 (B), the second large-screen game interface shown in Figure 4 (B), and the game interface shown in Figure 5 (B), the first game interface in Figure 6 can display the main scene completely and reasonably on the first screen without abandoning the range of the main scene, thus ensuring the complete and high-quality output display of the game scene.
[0110] Furthermore, compared to the first large-screen game interface shown by B in Figure 3, the second large-screen game interface shown by B in Figure 4, and the game interface shown by B in Figure 5, the brightness of the first screen displaying the main scene of the first game interface in Figure 6 is greater than the brightness of the second screen displaying the user interface elements of the first game interface. This ensures sufficient brightness for the main scene, providing a better gaming experience, while simultaneously reducing the brightness of the user interface. This reduction in brightness, without affecting the user's interaction with the game, lowers the power consumption of the screen displaying the user interface elements, thereby reducing the power consumption of the second screen, lowering its temperature, and ultimately improving the gaming experience.
[0111] In some embodiments, the foldable screen of the electronic device can be folded into a first screen and a second screen, and the electronic device also includes a third screen. When the foldable screen is in the folded state, the electronic device can display a second game interface of the game application on the third screen. The second game interface includes the main scene screen and user interface elements of the game application.
[0112] In summary, when the foldable screen is folded, the electronic device displays the main scene of the game application and user interface elements together on the third screen; when the foldable screen is unfolded, the electronic device displays the main scene of the game application and user interface elements separately on the first and second screens of the foldable screen. Specifically, when the foldable screen is unfolded, the screen parameters of the first and second screens satisfy at least one of the following conditions: the brightness of the second screen is less than the brightness of the first screen; the refresh rate of the second screen is less than the refresh rate of the second screen; the touch refresh rate of the first screen is less than the touch refresh rate of the second screen; and the resolution of the second screen is less than the resolution of the first screen.
[0113] As can be understood, separate display refers to displaying the main scene and user interface elements in different screen areas. That is, one of the main scene and user interface elements is displayed on the first screen of the foldable screen, and the other is displayed on the second screen. The size of the screen used to display the main scene (the first or second screen) corresponds to the size of the third screen, allowing the main scene to be displayed at a normal ratio (i.e., the main scene can be displayed according to the drawing ratio in traditional game interfaces), thus achieving high-quality output display of the main scene.
[0114] For example, the size of the first screen corresponds to the size of the third screen. The electronic device can display the main scene on the first screen and display the user interface elements on the second screen, so that the size of the main scene displayed on the first screen corresponds to the size of the main scene in the first game interface displayed on the third screen.
[0115] The electronic devices involved in the embodiments of this application can also be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. Electronic devices can be mobile phones, wearable devices, tablets, computers with wireless transceiver capabilities, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, or wireless terminals in smart homes, etc. The embodiments of this application do not limit the specific technologies or device forms used in the electronic devices. The hardware structure of the electronic devices is described below with reference to Figure 7.
[0116] Figure 7 shows a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0117] In one embodiment, as shown in FIG7, the electronic device 700 may include: a processor 710, a memory 720, a universal serial bus (USB) interface 730, a power management module 740, an antenna, a communication module 750, a foldable screen 760, an audio module 770, a camera 780, a sensor module 790, etc.
[0118] Processor 710 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the electronic device 700. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0119] The memory 720 can be used to store computer executable program code, which includes instructions. The processor 710 executes various functional applications and data processing of the electronic device by running the instructions stored in the memory 720. The memory 720 may include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function (e.g., sound playback function, interface display function, etc.). The data storage area may store data created during the use of the electronic device (e.g., notification messages, etc.). Furthermore, the memory 720 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0120] The power management module 740 is used to connect the battery and the processor 710. The power management module 740 receives battery and / or power input to power the processor 710, memory 720, communication module 750, foldable screen 760, and camera 780, etc. The power management module 740 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 740 may also be located within the processor 710.
[0121] The communication module 750 can provide solutions for wireless communication applications on the electronic device 700, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR). The communication module 750 can be one or more devices integrating at least one communication processing module. The communication module 750 receives electromagnetic waves via an antenna, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to the processor 710. The communication module 750 can also receive signals to be transmitted from the processor 710, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via the antenna.
[0122] In some embodiments, the antenna of the electronic device 700 is coupled to the communication module 750, enabling the electronic device 700 to communicate with networks and other devices via wireless communication technologies. The wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BitTorrent, Global Navigation Satellite System (GNSS), WLAN, NFC, FM, and / or IR technologies. The GNSS may include Global Positioning System (GPS), BeiDou Navigation Satellite System (BDS), GLONASS, and / or Galileo.
[0123] Electronic device 700 implements display functions through a GPU, a foldable screen 760, and an application processor. The GPU is a microprocessor for image processing, connecting the foldable screen 760 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 710 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0124] The foldable screen 760 is used to display images, videos, etc. The foldable screen 760 includes a first screen and a second screen. The first and second screens can be liquid crystal displays (LCDs), organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), Mini-LEDs, Micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc. In this embodiment, the foldable screen 760 can be used to display a game interface. Each screen in the foldable screen of this embodiment includes a touch panel, therefore each screen of the foldable screen has touch functionality.
[0125] Electronic device 700 can achieve shooting function through ISP, camera 780, video codec, GPU, foldable screen 760 and application processor.
[0126] The audio module 770 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 770 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 770 may be located in the processor 710, or some functional modules of the audio module 770 may be located in the processor 710.
[0127] The camera 780 is used to capture still images or videos. An object passes through the lens, generating an optical image that is projected onto a photosensitive element. This photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP (Image Signal Processor) for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP (Digital Signal Processor) for further processing. The DSP converts the digital image signal into standard image signals in formats such as RGB and YUV.
[0128] The sensor module 790 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors, etc.
[0129] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 700. In other embodiments, the electronic device 700 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0130] Generally, the implementation of a function in an electronic device requires not only hardware support but also software cooperation. The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application's embodiment uses a layered architecture of Android. For example, the software architecture of the electronic device involved in the embodiments of this application will be introduced with reference to Figure 8.
[0131] Figure 8 shows a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application.
[0132] In one embodiment, as shown in Figure 8, a layered architecture can divide the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. As shown in Figure 8, the Android system can include four layers, from top to bottom: the application layer, the application framework layer (Framework layer), the native service layer (also known as the system library), and the kernel layer (also known as the driver layer).
[0133] The application layer can include a series of application packages, as shown in Figure 8. These application packages can include game applications and game managers, etc. In some examples, the application layer may be simply referred to as the application layer.
[0134] The application framework layer provides application programming interfaces (APIs), programming frameworks, and window manager services (WMS) for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 8, the application framework layer can include a game framework, that is, a framework used for game development. The window manager service can be used to control the size of the game application's perceived window.
[0135] The local service layer, also known as the system library, can include graphics libraries, surface managers, state monitoring modules, and separate drawing processing modules, etc.
[0136] The graphics library provides drawing, rendering, and other processing capabilities for 2D and 3D graphics within the application. In some embodiments, the graphics library may include at least one of the following: Open GL, Open GL ES for embedded systems, Vulkan, etc. Vulkan is a cross-platform 2D and 3D graphics application programming interface (API).
[0137] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0138] The state monitoring module detects and identifies changes in the physical form of the foldable screen, such as whether it is in an unfolded or non-unfolded state (e.g., folded or stand-up). For example, the state monitoring module can invoke a sensor service to activate sensors such as gyroscopes and accelerometers for detection. The state monitoring service can calculate the current angle between the first and second screens based on the detection data reported by each sensor. Thus, the state monitoring service can determine the physical form of the foldable screen, such as whether it is in an unfolded, folded, or stand-up state, based on the angle between the first and second screens. When the state monitoring module detects that the foldable screen is in an unfolded state, if a game application is currently running, it can trigger the separate rendering processing module to perform separate rendering processing.
[0139] The separate rendering processing module intercepts rendering commands issued by the game application in the application layer and modifies the rendering commands by executing the method in this embodiment, so that the processor performs separate rendering of the main scene and user interface elements based on the modified rendering commands. For example, the separate rendering processing module can change the position parameters drawn in the framebuffer to achieve separate rendering.
[0140] The kernel layer, also known as the driver layer, is the layer between hardware and software. The kernel layer includes drivers for various hardware components.
[0141] In some embodiments, the kernel layer may include at least a display driver, a graphics processing unit (GPU) driver, and a touch driver.
[0142] A display driver is software or hardware used to control and manage a display device. It acts as a bridge between the operating system and the display device, providing the operating system with access and control functions for the display device. For example, a display driver is used to display a game interface on a foldable screen. In this embodiment, the display driver may include a first display driver for a first screen of the foldable screen and a second display driver for a second screen of the foldable screen. The first display driver is used to adjust the brightness, resolution, and refresh rate of the first screen, and the second display driver is used to adjust the brightness, resolution, and refresh rate of the second screen.
[0143] A touch driver is software or hardware used to control and manage touch devices. It acts as a bridge between the operating system and the touch device, providing the operating system with access and control functions for the touch device. For example, a touch driver is used to perform touch operations on a game interface displayed on a foldable screen. In this embodiment, the touch driver may include a first touch driver for a first screen of the foldable screen and a second touch driver for a second screen of the foldable screen. The first touch driver is used to adjust the touch refresh rate of the first screen, and the second touch driver is used to adjust the touch refresh rate of the second screen.
[0144] It is understood that touch devices (such as touch panels) can currently be integrated into display devices, enabling the display device to simultaneously perform display and touch functions. Therefore, the aforementioned touch device can be a display device. For example, in this embodiment, the touch device is a foldable screen.
[0145] The graphics processor driver is used to drive the graphics processing unit (GPU) to process images.
[0146] It should be noted that the layers in the software structure shown in Figure 8, and the components contained in each layer, do not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more layers than shown, such as a system library (FWK LIB) layer. Each layer may include more or fewer components than shown. Furthermore, the aforementioned functional modules may be combined into a single functional module, and the layers may be combined into a single layer.
[0147] It is understood that, in order to implement the methods in the embodiments of this application, electronic devices include hardware and / or software modules that perform various functions. Based on the algorithmic steps of the examples described in conjunction with the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in a hardware-driven or software-driven manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments.
[0148] For ease of understanding, the following description uses a mobile phone with a foldable screen, where the foldable screen can be folded into a first screen and a second screen, and the mobile phone also includes a third screen, as an example. The method for displaying the game interface provided in the embodiments of this application will be introduced in conjunction with the software system structure shown in Figure 8.
[0149] Figure 9 shows a flowchart illustrating one of the methods for displaying a game interface according to an embodiment of this application. As shown in Figure 9, the method for displaying the game interface may include:
[0150] S901, after startup, the game application sends out rendering instruction streams.
[0151] For example, after a game application starts, it can call the graphics library in the system library and send a rendering instruction stream to the graphics library. This rendering instruction stream includes a first rendering instruction and a second rendering instruction. The first rendering instruction instructs the rendering of the game application's main scene, and the second rendering instruction instructs the rendering of the game application's user interface elements.
[0152] S902: When the foldable screen is in the folded state, the phone draws a second game interface based on rendering instructions and displays the second game interface on the third screen.
[0153] It can be understood that the second game interface is the traditional game interface 100 shown in Figure 1. For example, the state monitoring module in the system library can monitor the state of the foldable screen. When the system library detects that the physical state of the foldable screen is folded, it can trigger the execution of the original drawing and rendering logic through the graphics processor driver (i.e., GPU driver). That is, based on the graphics processor driver, the graphics processor is called to execute the rendering instruction stream to draw the second game interface, and based on the display driver, the second game interface is displayed on the third screen of the electronic device.
[0154] It should be noted that the original drawing and rendering logic will not be described in detail in the embodiments of this application. Instead, the new and improved drawing and rendering logic proposed in the embodiments of this application will be introduced in the following text.
[0155] S903. When the foldable screen switches from a folded state to an unfolded state, the phone generates a target frame buffer corresponding to the size of the foldable screen in the unfolded state.
[0156] For example, when the state monitoring module in the system library detects that the physical state of the foldable screen changes from the folded state to the unfolded state, the state monitoring module will trigger the execution of new drawing and rendering logic. For instance, the state monitoring module will notify the separate drawing processing module in the system library that the physical state of the foldable screen has changed from the folded state to the unfolded state.
[0157] At this point, the separate rendering processing module can execute the method in this embodiment of the application to generate a target frame buffer based on the graphics library support. The target frame buffer is a frame buffer used to separately render the main scene and user interface elements. The first target area in the target frame buffer corresponds to the first screen of the foldable screen, and the second target area in the target frame buffer corresponds to the second screen of the foldable screen.
[0158] It is understandable that the rendering commands issued by the game application are processed in the target frame buffer; that is, the GPU will subsequently draw the game-related scenes in the target frame buffer. For details, please refer to S904 below.
[0159] In one embodiment, the target frame buffer can be generated in any of the following ways:
[0160] Method 1: Create a new target framebuffer (i.e., a replacement framebuffer) that corresponds to the size of the unfolded folded screen.
[0161] Method 2: Adjust the size of the existing default frame buffer to generate a target frame buffer that corresponds to the size of the unfolded folded screen.
[0162] The default framebuffer is the background framebuffer used by default for display in the double buffering mechanism. It should be noted that the size of the framebuffer in each embodiment of this application actually refers to the size of the framebuffer attachments. It should be understood that each framebuffer is bound to corresponding attachments (i.e., framebuffer attachments), which can be color attachments, depth attachments, and stencil attachments, etc. The content subsequently drawn in the framebuffer is recorded in the added color or depth attachments, etc., of the framebuffer attachments. During display, the color or depth information recorded in these attachments corresponding to the framebuffer is extracted and drawn onto the screen to achieve the desired screen display effect.
[0163] Optionally, the method by which the separate drawing processing module generates the target frame buffer can differ depending on the UI element drawing method (i.e., the drawing method corresponding to the user interface elements of the game application). For example, if the UI element drawing method is off-screen drawing, the separate drawing processing module can generate the target frame buffer using the first method mentioned above, based on the support of the graphics library (or graphics API). If the UI element drawing method is not off-screen drawing, the separate drawing processing module can generate the target frame buffer using the second method mentioned above, based on the support of the graphics library. Off-screen drawing refers to the GPU creating a new buffer outside the current screen buffer for drawing and rendering operations. If the drawing method corresponding to the user interface elements of the game application is off-screen drawing, it means that the GPU will draw and render the user interface elements in a new frame buffer outside the currently displayed frame buffer (i.e., the default frame buffer). Not off-screen drawing means that it is not off-screen drawing; that is, it does not need to create a new frame buffer to draw and render the user interface elements, but can directly use the default frame buffer to draw and render the user interface elements.
[0164] It should be noted that when the foldable screen switches from the folded state to the unfolded state, a target frame buffer is generated. Subsequently, when the foldable screen is in the unfolded state, the target frame buffer can be used for corresponding processing without regenerating the target frame buffer.
[0165] S904. In different areas of the target frame buffer, the mobile phone separates the main scene screen and user interface elements to be drawn as instructed by the rendering instruction stream.
[0166] For example, the separate rendering processing module can analyze the rendering instruction stream to identify the first and second rendering instructions within it. Specifically, it can identify the rendering instruction that instructs the rendering of the main scene and the rendering instruction that instructs the rendering of user interface elements. Then, the separate rendering processing module can adjust the drawing position parameters in the target frame buffer and send the adjusted parameters to the GPU driver (i.e., the graphics processor driver). This causes the graphics processor to draw the main scene indicated by the first rendering instruction in the first target area of the target frame buffer and the user interface elements indicated by the second rendering instruction in the second target area of the target frame buffer. For instance, the separate rendering processing module can change the viewport position to adjust the drawing position parameters in the target frame buffer, thereby achieving separate rendering.
[0167] In one embodiment, when drawing user interface elements, the electronic device incorporates the coordinate information of each element, such as two-dimensional image coordinate information (i.e., UV coordinate information). Each user interface element has unique two-dimensional image coordinate information, thus its position on the game interface can be uniquely determined based on its two-dimensional image coordinate information. Therefore, modifying the two-dimensional image coordinate information of any user interface element can adjust its position on the game interface. This allows for flexible changes to the layout of user interface elements within the game interface.
[0168] The S905 phone will display the main scene and user interface elements separately on different screens of the foldable screen.
[0169] For example, after the graphics processor draws the main scene in the first target area of the target frame buffer and draws the user interface elements in the second target area, the content drawn in the target frame buffer can be sent to the display via the display driver, so that the main scene drawn in the first target area is displayed on the first screen of the foldable screen, and the user interface elements drawn in the second target area are displayed on the second screen of the foldable screen.
[0170] It should be noted that for some special user interface elements that need to be drawn in the main scene, the separate drawing processing module can also adjust the drawing position parameters so that the graphics processor draws them in the first target area instead of the second target area.
[0171] Furthermore, the following description, in conjunction with the accompanying drawings, uses a mobile phone with a foldable screen as an example to detail the game interface display method provided in the embodiments of this application. As mentioned above, the foldable screen on the mobile phone can be an inward-folding screen or an outward-folding screen, and there is no limitation thereto. It should be noted that the game interface display method in the embodiments of this application is not limited to mobile phones, but can also be applied to other electronic devices. The following description uses a mobile phone as an example only.
[0172] Optionally, the method provided in this application embodiment is executed in a specific target mode. After the target mode is enabled, the mobile phone can use this method to separate and display the main scene screen and user interface elements of the game application on the screen of different areas included in the foldable screen.
[0173] In one embodiment, the mobile phone can provide a preset entry point. When this preset entry point is triggered, the mobile phone controls the game application to enter the aforementioned target mode. It is understood that the mobile phone can also provide an entry point for exiting the target mode. This exit entry point can be the aforementioned preset entry point; for example, after entering the target mode via the preset entry point, if the preset entry point is triggered again, the target mode can be exited. The exit entry point can also be other than the aforementioned preset entry point, and this is not limited. Using preset entry points allows users to more flexibly determine the display method of the game interface, improving flexibility and convenience.
[0174] For example, the phone's default entry point can be set in the default page of the game application, such as the game application's homepage or settings page. Alternatively, the default entry point can be set in the game interface presented within the game application. For instance, an option or button corresponding to the default entry point can be added to the menu bar of the game interface. The electronic settings can respond to the user's triggering of the option corresponding to the default entry point, entering the target mode.
[0175] In another embodiment, the phone can directly start the target mode by default without user setting or triggering.
[0176] In another embodiment, the mobile phone can also adaptively select whether to activate the target mode for different types of game applications. Specifically, the mobile phone can analyze the type of the game application currently running and displayed in the foreground (hereinafter referred to as "current game application"). If the type of the current game application belongs to a preset game type, the target mode can be automatically activated, thereby automatically separating and displaying the main scene screen and user interface elements in the game interface of the game application on different screen areas of the foldable screen. If the type of the current game application does not belong to a preset game type, the original method can continue to be used, and the main scene screen and user interface elements can be overlaid and displayed in the foldable screen, that is, forming a traditional game interface as shown in Figure 1.
[0177] Optionally, the mobile phone can determine the type of the current game application based on at least one attribute, such as the name or description of the current game application.
[0178] For example, a preset game type can be a game type that can affect the user's (i.e., the player's) game operations from the main scene screen of the game application (i.e., the game scene screen). There can be one or more preset game types.
[0179] For example, in combat games where battles take place in a virtual world or virtual space, the main scene screen displays the positions or statuses of the two combatants, serving as an important reference or guide for the user's gameplay. Similarly, in games where players build virtual worlds, the main scene screen significantly impacts subsequent building operations. Therefore, for these game types, it is crucial that the main scene screen is displayed unobstructed and at a normal aspect ratio. Mobile phones can automatically activate target mode to separate the main scene screen from user interface elements.
[0180] After the target mode is activated, the mobile phone can execute the method in the embodiments of this application. When the foldable screen is in the unfolded state, the main scene screen of the game application is displayed on the first screen of the foldable screen, and the user interface elements of the game application are displayed on the second screen, so as to achieve the separate display of the main scene screen and the user interface elements.
[0181] In one embodiment, taking an inward-folding screen as an example, the inward-folding screen includes a first screen and a second screen. The phone also includes a third screen, which is located behind the first screen. The third screen corresponds in size to the first screen; when the folding screen is in the folded state, the first screen and the second screen face each other, and their display areas are not visible to the user, while the display area of the third screen is visible to the user.
[0182] Specifically, game developers have adapted the display to the size of the third screen. Therefore, when the phone's foldable screen is folded, the game interface can be displayed normally on the third screen. For example, it can display the traditional game interface shown in Figure 1 on the third screen, just like a candybar phone. After the phone's inward-folding screen switches from the folded state to the unfolded state, the inward-folding screen can unfold and display the first game interface. Specifically, the main scene is displayed on the first screen of the inward-folding screen, and the user interface elements are displayed on the second screen. The main scene and user interface elements displayed on different screens constitute a completely new first game interface. Since the sizes of the first and third screens correspond, the size of the main scene displayed on the first screen corresponds to the size of the main scene in the first game interface on the third screen after the phone's inward-folding screen is unfolded. It can be displayed normally without stretching or shrinking of the screen area, and it can also avoid the obstruction of user interface elements.
[0183] For ease of understanding, the following explanation will use a mobile phone with an inward folding screen, as shown in Figure 10. This mobile phone includes an outer screen (i.e., the third screen) and an inner screen (i.e., the inward folding screen). The inner screen includes two screens, namely the first screen and the second screen.
[0184] Figure 10 shows a schematic diagram of the interface of the inward folding screen provided in an embodiment of this application.
[0185] For example, as shown in Figures 10A and 10B, after the inner screen is unfolded, the outer screen is located behind the unfolded inner screen. It can be understood that the height of the inner screen is approximately twice the height of the outer screen; that is, the dimensions of the outer screen, the first screen, and the second screen are similar (i.e., their dimensions correspond). "Similar" can mean that the size difference is less than a preset range. When the inner screen is folded, the outer screen displays the second game interface (i.e., the traditional game interface) indicated by the arrow in Figure 10A. After the inner screen is unfolded, as shown in Figure 10B, the first screen of the inner screen can display a main scene with the same or similar size ratio as the second game interface in Figure 10A, and the second screen can display user interface elements with the same or similar size ratio as the second game interface in Figure 10B.
[0186] For example, as shown in Figure 8, when the phone is folded, it can display a traditional game interface on the outer screen for the user to input game operations. When the phone switches from folded to unfolded, the state monitoring module can detect this physical state change through sensors, thereby issuing a notification to trigger the separate drawing processing module to perform separate drawing processing. Then, as shown in Figure 10B, the separate display is performed on the unfolded inner screen.
[0187] In another embodiment, taking an outward-folding screen as an example, the outward-folding screen is also folded into a first screen and a second screen. When the outward-folding screen is in the folded state, the first screen and the second screen face away from each other. The first screen is used normally by the user, while the second screen is folded behind the first screen. At this time, the first screen becomes the third screen.
[0188] Specifically, when the outward-folding screen is folded, the second game interface is displayed on the third screen, which is essentially the first screen. The second game interface includes the main scene of the game application and user interface elements. When the outward-folding screen is unfolded, the first and second screens form a large screen, and the phone can display the first game interface of the game application on the unfolded outward-folding screen. This first game interface also includes the main scene of the game application and user interface elements, but they are displayed separately. That is, the main scene of the game application is displayed on the first screen of the unfolded outward-folding screen, and the user interface elements are displayed on the second screen of the unfolded outward-folding screen.
[0189] For ease of understanding, the following explanation will use a mobile phone with an outward folding screen, which includes two screens, namely the first screen and the second screen, as an example, with reference to Figure 11.
[0190] Figure 11 shows a schematic diagram of the interface of the outward folding screen provided in an embodiment of this application.
[0191] For example, A in Figure 11 shows the back of the outward-folding screen when it is in the folded state. At this time, the back of the second screen located in A of 11 is the first screen (not visible in the figure). When the outward-folding screen is in the folded state, the first screen can display a traditional game interface as shown in Figure 1. When the outward-folding screen switches from the folded state to the unfolded state, it displays the first game interface as shown in B of Figure 11. The main scene is displayed on the first screen of the outward-folding screen, and user interface elements are displayed on the second screen. Since the second screen and the camera are located on the back of the first screen when the outward-folding screen is in the folded state, the size of the second screen can be smaller than the size of the first screen. This is only an illustration to show that the second screen can be smaller than the first screen, but the size relationship between the first and second screens is not limited; the sizes of the first and second screens can be the same or similar.
[0192] As mentioned above, the aforementioned separate display is based on separate rendering during the rendering phase. It should be understood that separate rendering refers to rendering the main scene and user interface elements separately in different areas of the same frame buffer during the rendering phase. This frame buffer is the target frame buffer used to render the main scene and user interface elements. It should be noted that rendering here is not limited to real-time rendering; that is, it is not limited to rendering the main scene and user interface elements in real-time within the target frame buffer. If they are first rendered in real-time in another frame buffer and then pasted into the target frame buffer, this also counts as rendering within the target frame buffer. For example, after receiving a rendering instruction to render the main scene, rendering the main scene in real-time first in the initial frame buffer corresponding to the main scene, and then pasting the real-time rendered main scene into the target frame buffer, also counts as rendering the main scene within the target frame buffer. The initial frame buffer corresponding to the main scene refers to the frame buffer originally set in the game application for executing the first rendering instruction to render the main scene in real-time, in the absence of the method mentioned in the embodiments of this application.
[0193] It should be noted that the size of the target frame buffer corresponds to the size of the foldable screen. The target frame buffer includes a first target area and a second target area. The first target area corresponds to the first screen, and the content drawn within the first target area is used for display on the first screen. The size of the first target area corresponds to (is the same as or close to) the size of the first screen. The second target area corresponds to the second screen, and the content drawn within the second target area is used for display on the second screen. The size of the second target area also corresponds to (is the same as or close to) the size of the second screen. Therefore, the phone can draw the main scene image within the first target area of the target frame buffer and draw the user interface elements within the second target area of the target frame buffer, thus achieving separate drawing. Subsequently, during the display phase, the phone can display the main scene image drawn within the first target area of the target frame buffer on the first screen of the foldable screen, and display the user interface elements drawn within the second target area of the target frame buffer on the second screen of the foldable screen.
[0194] For ease of understanding, the separate drawing method will be described below with reference to Figure 12. Figure 12 shows a schematic diagram of a separate drawing method provided in an embodiment of this application.
[0195] In one embodiment, as shown in Figure 12A, the height H of the frame buffer used to draw the traditional game interface 100 is half the height 2H of the folded screen in the unfolded state, which is not compatible with the large screen size. Therefore, there will be problems such as sacrificing the game screen area and stretching the game screen as described above.
[0196] To address this issue, this embodiment generates a target frame buffer whose size corresponds to the size of the foldable screen in its unfolded state. As shown in Figure 12B, the target frame buffer used to draw the traditional game interface is twice the height of the initial frame buffer (the height of the traditional game interface is H, and the height of the target frame buffer is 2H). Subsequently, the main scene and user interface elements can be drawn separately in different areas of the target frame buffer by analyzing the rendering instruction stream (i.e., the draw call instruction stream) in real time. As shown in Figure 12C, the main scene is drawn in area 1201 of the target frame buffer, and the user interface elements are drawn in area 1202.
[0197] It is understandable that the Draw call instruction stream is the rendering instruction sent by the engine to the graphics API. The graphics API can be a graphics library, and API stands for Application Programming Interface.
[0198] Optionally, in another approach, the game's rendering stage is not improved. Instead, the original rendering logic of the game application is followed, rendering the main scene and user interface elements without distinguishing between areas. The final rendered interface is still the traditional game interface shown in Figure 1. Then, after the game interface is rendered, mapping relationships are created between controls and the operation controls in the user interface elements. The traditional game interface and these newly created controls are then displayed in different screen areas of the foldable screen. It is understood that the above approach of establishing control mapping relationships differs from the separate rendering stage implemented in this application's embodiment. In this application's embodiment, separate rendering is achieved during the rendering stage, separating the main scene and user interface elements for display. Compared to additional control mapping and other processing after rendering is complete, this saves system resources.
[0199] Optionally, the mobile phone can determine the target frame buffer for separating the rendering of the main scene and the user interface elements based on the rendering method corresponding to the user interface elements of the game application. This rendering method refers to the rendering method adopted for the user interface elements. For example, the rendering method corresponding to the user interface elements of a game application may include non-off-screen rendering or off-screen rendering. For each game application, the mobile phone can adopt one of these rendering methods to render the user interface elements of that game application.
[0200] It's understandable that different user interface elements in a game application require different rendering methods, which in turn can lead to different methods for generating the target frame buffer on a mobile device. The following section describes in detail how to generate the target frame buffer for different rendering methods.
[0201] In one embodiment, when the user interface elements of a game application are rendered using non-off-screen rendering, the phone can adjust the size of the default frame buffer to obtain a target frame buffer corresponding to the size of the foldable screen. For example, the phone can increase the size of the default frame buffer to obtain a target frame buffer corresponding to the size of the foldable screen.
[0202] It is understandable that, in non-off-screen rendering, both the main scene and user interface elements are rendered in real-time within a target framebuffer obtained by resizing the default framebuffer. This target framebuffer, resizing the default framebuffer, includes a first target region and a second target region. The phone can analyze the type of rendering instructions in the rendering instruction stream in real-time and adjust the viewport position to either the first or second target region based on the type of rendering instruction. Therefore, within the target framebuffer resizing the default framebuffer, the main scene and user interface elements are rendered separately in the first and second target regions in real-time.
[0203] As mentioned above, rendering instructions can include two types: first rendering instructions and second rendering instructions. The type of rendering instruction can be identified in at least two of the following ways:
[0204] Method 1: Identify the type of rendering instruction based on the resources required to execute the rendering instruction.
[0205] In one example, a specific resource type is used when drawing user interface elements. This specific resource type may include at least one of the following: a specific texture resource (e.g., the texture of a control button) required for drawing the user interface elements, a specific type of buffer, or a program required for drawing the user interface elements. Therefore, the phone can use the resource type required for drawing user interface elements as a preset resource type (i.e., the first preset resource type). The phone can analyze the resource type indicated by each rendering instruction (i.e., the type of resource required to execute the rendering instruction), compare the resource type corresponding to each rendering instruction with the first preset resource type, and determine the rendering instruction corresponding to the first preset resource type as the second rendering instruction used to instruct the drawing of user interface elements. Furthermore, the phone can determine the rendering instructions in the rendering instruction stream other than the second rendering instruction as the first rendering instruction.
[0206] In another example, the phone can analyze the specific resource types required for rendering the main scene and use them as preset resource types (i.e., the second preset resource type). The phone can analyze the resource types indicated by each rendering instruction and compare the resource types corresponding to each rendering instruction with the second preset resource type. The rendering instruction corresponding to the second preset resource type is then determined as the first rendering instruction used to instruct the rendering of user interface elements. Furthermore, the phone can determine the rendering instructions in the rendering instruction stream other than the first rendering instruction as the second rendering instruction. Similarly, the specific resource types required for rendering the main scene may include at least one of the following: specific texture resources, specific types of buffers, or programs required for rendering the main scene.
[0207] In addition, mobile phones can also identify the first rendering instruction and the second rendering instruction based on the first preset resource type and the second preset resource type, respectively, instead of using the process of elimination. This article does not limit this to the following.
[0208] Method 2: Identify and distinguish between the main scene drawing stage and the interface element drawing stage.
[0209] The main scene rendering stage is used to render the main scene visuals. The interface element rendering stage is used to render the user interface elements. It should be noted that method 2 is used when the main scene visuals and user interface elements share a frame buffer in the game application. Sharing a frame buffer means that the game application is configured to render the main scene visuals and user interface elements in real-time within the same frame buffer.
[0210] It's understandable that some game applications, when setting up a shared frame buffer for the main scene and user interface elements, will divide the rendering process into a main scene rendering stage and a user interface element rendering stage. That is, a certain number of first rendering instructions are executed first to render the main scene in real time—the main scene rendering stage. Then, a certain number of second rendering instructions are executed to render the user interface elements in real time—the user interface element rendering stage.
[0211] In one example, the number and order of rendering instructions executed in the main scene rendering stage and the interface element rendering stage are fixed. That is, a preset number of first rendering instructions can be executed first, followed by a preset number of second rendering instructions. Therefore, the mobile phone can distinguish between the main scene rendering stage and the interface element rendering stage based on the preset rendering order.
[0212] It should be understood that, normally, after receiving a rendering instruction stream, the mobile phone needs to parse each rendering instruction in the stream to identify whether it is the first or second rendering instruction, that is, whether the rendering instruction instructs the drawing of the main scene or the drawing of user interface elements. Using method 2 in this embodiment, the mobile phone does not need to parse and analyze each rendering instruction individually, i.e., it does not need to perform complex analysis of the relevant parameters of the rendering instructions. Instead, it can determine the first preset number of rendering instructions as the first rendering instructions and the last preset number as the second rendering instructions according to the preset drawing order. For example, if there are 100 rendering instructions, the first 50 can be determined as the first rendering instructions and the last 50 as the second rendering instructions. This method saves system resources and allows for faster and more convenient identification of the type of rendering instructions, thereby improving the efficiency of subsequent separate drawing.
[0213] In another example, the phone can also distinguish between the main scene rendering stage and the interface element rendering stage based on the characteristics of the clear command. It can be understood that during the main scene rendering stage, when rendering each frame of the main scene, calling the clear command will clear the color bits (i.e., the color bits) of the previous frame. However, after entering the interface element rendering stage, when rendering user interface elements, calling the clear command will not clear the color bits again. Therefore, the phone can distinguish between the main scene rendering stage and the interface element rendering stage based on whether the color bits are cleared when the clear command is called. The clear command is a function in a graphics library or image API used to clear the specified framebuffer attachments. The clear command can be the glClear command, a function in the OpenGL graphics library used to clear the framebuffer attachments. The clear command can also be a function from other graphics libraries; this article does not limit this.
[0214] Specifically, when executing each rendering instruction to draw, the mobile phone can monitor in real time whether the call to clear instruction clears the color bits. If the call to clear instruction clears the color bits, the rendering instruction is determined to be the first rendering instruction. If the call to clear instruction does not clear the color bits, the rendering instruction is determined to be the second rendering instruction.
[0215] In this example, instead of performing complex analyses such as resource parsing for rendering instructions, the type of rendering instruction can be easily and accurately identified based on the characteristics of the clearing instruction, which saves resources and improves efficiency.
[0216] In another example, once the second rendering instruction is identified, it can be determined that the interface element drawing stage has begun. If the number of second rendering instructions is explicit or preset in advance, then the subsequent preset number of rendering instructions can be identified as second rendering instructions by default, further saving system resources.
[0217] Furthermore, after identifying the type of rendering instruction, the viewport position can be adjusted through the following steps to achieve separate drawing:
[0218] Specifically, for the first rendering instruction in the rendering instruction stream, the mobile phone can call the viewport setting function to set the viewport position in the first target area of the target frame buffer, so as to draw the main scene image indicated by the first rendering instruction within the first target area. For the second rendering instruction in the rendering instruction stream, the mobile phone can call the viewport setting function to set the viewport position in the second target area of the target frame buffer, so as to draw the user interface elements indicated by the second rendering instruction within the second target area. For example, the viewport setting function could be the glViewport function, where glViewport is a function in OpenGL used to set the viewport for OpenGL rendering.
[0219] In one example, the electronic device separates the drawing process by setting different starting points for the viewport positions when drawing the main scene and user interface elements.
[0220] It's understandable that in traditional methods, during the game's rendering phase, the viewport starting point for drawing the main scene and user interface elements is the same. The viewport position refers to the location of the viewport (including its starting point and size). The viewport is the output area (or drawing area) used by a graphics library (such as OpenGL) for rendering; it's a rectangular area within a window. During rendering, the graphics library projects graphics into the viewport to generate the final image. Therefore, if the viewport starting point is the same—for example, both starting from the bottom left corner of the screen (0, 0)—the framebuffer areas used for drawing the main scene and user interface elements may overlap. For instance, if the relative coordinates of the main scene and user interface elements are both (1, 1), since their viewport starting points are the same, their drawing positions in the framebuffer will also be the same, resulting in overlapping drawing. Ultimately, during the display phase, the main scene and user interface elements will overlap and appear on the screen. For details, please refer to Figure 1. Assuming that the main scene and user interface elements are drawn with the bottom left corner (0,0) of the screen as the starting point of the viewport position, the user interface element 110 and the main scene content are drawn overlappingly in the frame buffer, so the user interface element 110 and the main scene are displayed overlappingly.
[0221] The starting point of the viewport position when drawing the main scene and user interface elements in the embodiments of this application is described below with reference to Figure 13. Figure 13 shows a schematic diagram of viewport position adjustment provided by an embodiment of this application.
[0222] For example, as shown in Figure 13, assuming the height of the foldable screen is 2H and the width is W, where the height of both the first and second screens of the foldable screen is H, and the height of the first and second target regions in the corresponding target frame buffer is also H, the coordinate position of the lower left corner of the first target region 1301 (i.e., the lower left corner of the first screen) is (0, H), and the coordinate position of the lower left corner of the second target region 1302 (i.e., the lower left corner of the second screen) is (0, 0). Based on this, in the rendering stage using the method of this embodiment, for the first rendering instruction, the electronic device can set the starting point of the viewport position to the lower left corner (0, H) of the first screen based on the viewport setting function, and for the second rendering instruction, the electronic device can set the starting point of the viewport position to the lower left corner (0, 0) of the second screen based on the viewport setting function, thereby separating the main scene and user interface elements and rendering them in different areas of the frame buffer during the rendering stage.
[0223] In one example, some user interface elements (e.g., those that don't require touch and primarily serve a prompting function) need to be displayed in the main scene. Taking a combat game as an example, user interface elements indicating a user's combat power or energy level need to be displayed in the game application's main scene to provide real-time feedback on the combat abilities of both sides. The type of these user interface elements is called a preset element type, which is a pre-defined element type for user interface elements to be drawn within a first target area. After receiving a second rendering instruction, the phone can analyze the element type of the user interface element instructed by the second rendering instruction. If the element type is a preset element type, the phone can call a viewport setting function to adjust the viewport position to the first target area to draw the user interface element instructed by the second rendering instruction within that area. If the element type of the user interface element instructed by the received second rendering instruction is not a preset element type, the phone can call a viewport setting function to adjust the viewport position to the second target area in the target frame buffer.
[0224] In another example, some user interface elements (e.g., those requiring simple touch input (such as clicking) and primarily serving as game prompts) can be displayed either in the main scene or within user interface elements. Taking a multiplayer game as an example, user interface elements used to provide game information can be displayed within the game application's main scene for easy viewing of match information; or displayed within the game application's user interface elements for easy touch input. This type of user interface element can be called a free element type, which is a pre-defined element type that can be drawn within a first or second target area. After receiving the second rendering instruction, the phone can analyze the element type of the user interface element indicated by the second rendering instruction. If the element type is a free element type, the phone can call the viewport setting function to adjust the viewport position to the first target area to draw the user interface element indicated by the second rendering instruction within the first target area; or, the phone can call the viewport setting function to adjust the viewport position to the second target area to draw the user interface element indicated by the second rendering instruction within the second target area.
[0225] For example, the user interface element that needs to be clicked and primarily serves as a game prompt is a map, as shown in Figures 6, 10, and 11 as map 610 displayed on the second screen. In some other examples, map 610 may be displayed on the first screen.
[0226] It should be noted that the game's rendering process is real-time, processing rendering commands in real time. Therefore, the viewport position is also dynamically adjusted in real time based on the rendering commands.
[0227] In one example, for a game application where the user interface elements are drawn off-screen, the phone can generate a new alternative framebuffer corresponding to the size of the foldable screen. This alternative framebuffer is the target framebuffer, and therefore includes a first target area corresponding to the first screen and a second target area corresponding to the second screen. The phone can then process subsequent second rendering instructions for drawing user interface elements within this second target area of the alternative framebuffer to draw the user interface elements in real time within that area. It can be understood that the main scene is drawn within the first target area of the alternative framebuffer.
[0228] The method for generating an alternative frame buffer may include: the mobile phone can identify the initial frame buffer corresponding to the user interface element, denoted as the first initial frame buffer. It can be understood that the first initial frame buffer refers to the frame buffer originally set in the game application for executing the second rendering instruction to draw user interface elements in real time, without employing the method mentioned in the embodiments of this application. The mobile phone can generate an alternative frame buffer for the first initial frame buffer, the size of which corresponds to the size of the foldable screen. The mobile phone can use this alternative frame buffer as the target frame buffer and perform redirection processing, that is, replace the first initial frame buffer with the alternative frame buffer, and redirect the rendering instructions for the first initial frame buffer to the alternative frame buffer to draw user interface elements in real time in the alternative frame buffer.
[0229] Specifically, after identifying the first initial frame buffer, the mobile phone can obtain the size parameters of the first initial frame buffer, which may include width and height. The mobile phone can keep the width of the first initial frame buffer unchanged, double the height, and use the enlarged size parameters as the size parameters of the alternative frame buffer to create an alternative frame buffer and add corresponding attachments to the alternative frame buffer.
[0230] In one example, since resolution is also determined by width and height, the size parameter can be characterized by the resolution parameter. For instance, the phone can obtain the resolution parameter W×H of the first initial frame buffer, double the height to get the resolution parameter W×2H, and then use W×2H as the resolution parameter of the replacement frame buffer to create a replacement frame buffer with a size of W×2H, and add corresponding attachments to it. It can be understood that the size of the foldable screen in its unfolded state is also W×2H, so the replacement frame buffer corresponds to the size of the foldable screen.
[0231] In one example, after generating the alternative framebuffer, the phone can record the first initial framebuffer and its associated IDs, and identify the rendering instructions bound to these associated IDs from the rendering instruction stream to determine if there are any rendering instructions that need to be executed in the first initial framebuffer. If so, the generated alternative framebuffer replaces the first initial framebuffer, redirecting the rendering instructions to the alternative framebuffer for execution. Because the higher dimension of the resolution parameter in the alternative framebuffer is twice that of the first initial framebuffer, the phone needs to adjust the viewport position to ensure the scene is rendered correctly when the alternative framebuffer is used for drawing.
[0232] In one embodiment, when the user interface elements of the game application are drawn in an off-screen manner, the following describes the method for identifying the first initial frame buffer corresponding to the user interface elements in two cases:
[0233] The first scenario: In a game application, user interface elements and the main scene screen share the same frame buffer.
[0234] In the first scenario, the mobile phone can determine the first initial frame buffer corresponding to a user interface element by identifying the frame buffer corresponding to the main scene screen. That is, it determines the first initial frame buffer corresponding to a user interface element based on the rendering features of the main scene screen. Since the main scene screen has richer content and its rendering features are more prominent, the first initial frame buffer corresponding to a user interface element can be identified more accurately based on the rendering features of the main scene screen.
[0235] In one example, the mobile phone can determine the frame buffer that executes the most rendering instructions in the rendering process as the first initial frame buffer. Specifically, the mobile phone can determine the frame buffer that executes the most rendering instructions in the prior rendering process as the first initial frame buffer. Prior rendering process refers to the rendering process for each frame in at least one prior rendering frame. Prior rendering frame refers to the frame rendered before the first initial frame buffer is identified.
[0236] It's understandable that before identifying the first initial frame buffer, the existing method (i.e., the existing rendering logic) can be used to render traditional game scenes (or second game scenes) frame by frame based on rendering instructions. During the rendering of a single frame, each rendering instruction is executed in its original bound frame buffer (i.e., the initial frame buffer), and each frame buffer is responsible for executing different types of rendering instructions. Since the main scene has richer content, rendering it requires executing or calling more rendering instructions. Therefore, the phone can identify the frame buffer that executes the most rendering instructions during the earlier rendering process (i.e., the rendering instruction execution result corresponding to at least one previously rendered frame) and determine it as the frame buffer used to render the main scene. Because the game application sets up a shared frame buffer for the main scene and user interface elements, the identified frame buffer belongs to the first initial frame buffer corresponding to the user interface element.
[0237] To more accurately determine the frame buffer used to render the main scene, it can be identified based on the execution results of rendering instructions corresponding to multiple frames (i.e., at least two frames) rendered earlier. The number of frames can be determined based on a preset limit. Specifically, for each frame in the multiple-frame-first-rendered sequence, the phone can determine the execution result of the rendering instructions corresponding to that frame and identify the frame buffer that executed the most rendering instructions during the rendering of that frame. Then, the phone can determine the frame buffer that executed the most rendering instructions throughout the rendering of the multiple-frame-first-rendered sequence as the frame buffer used to render the main scene. For example, if there are frame buffers 1 to N, and the multiple frames are 3, then after the first, second, and third frames are rendered, the phone can identify that during the rendering of the first frame, the frame buffer that executed the most rendering instructions among frame buffers 1 to N is frame buffer 2; similarly, during the rendering of the second and third frames, the frame buffer that executed the most rendering instructions is also frame buffer 2. Therefore, the phone can determine that frame buffer 2 is the frame buffer used to render the main scene.
[0238] In another example, the phone can analyze historical experience data to determine the size range of the frame buffer corresponding to the main scene. Then, the phone can match the size of each candidate frame buffer with this range, identifying those falling within the range as the frame buffer corresponding to the main scene. For example, the frame buffer corresponding to the main scene typically falls within the range of 1100×1100 to 1300×1300. If some candidate frame buffers are 1200×1200 and fall within this range, they can be identified as the frame buffer corresponding to the main scene. This solution, by pre-setting the frame buffer size range corresponding to the main scene, can identify the frame buffer corresponding to the main scene very quickly and conveniently, allowing for timely separation of the main scene and user interface elements at the start of the game, thus improving the user experience.
[0239] It should be noted that in the first scenario, the rendering instructions for the first initial frame buffer include both the second and first rendering instructions. Therefore, if redirection is performed (redirecting the rendering instructions for the first initial frame buffer to the alternative frame buffer), in addition to redirecting the second rendering instructions for the first initial frame buffer to the alternative frame buffer for execution, the first rendering instructions for the first initial frame buffer will also be redirected to the alternative frame buffer. The mobile phone can adjust the viewport position to render the main scene and user interface elements in real time in the alternative frame buffer.
[0240] It should be noted that in the first case, the first initial frame buffer corresponding to the user interface element can also be identified based on the characteristics of the user interface element itself, and there is no limitation on this.
[0241] The second scenario: In game applications, user interface elements are configured not to share the same frame buffer as the main scene.
[0242] In this context, "not sharing a frame buffer" means that the main scene and user interface elements set in the game application are not drawn in the same frame buffer in real time; that is, the main scene and user interface elements are drawn in different frame buffers in real time.
[0243] Since the two do not share a frame buffer, the mobile phone can identify the first initial frame buffer corresponding to a user interface element by using the relevant features of the user interface element.
[0244] Specifically, certain resource types are used when drawing user interface elements. Therefore, the mobile phone can use the resource types required for drawing user interface elements as preset resource types, also known as "first preset resource types." The mobile phone can analyze the resource types used by each candidate frame buffer and then identify the frame buffer corresponding to the first preset resource type from the candidate frame buffers. It can be understood that the resource type used by the frame buffer corresponding to the first preset resource type is that first preset resource type. The identified frame buffer is the first initial frame buffer corresponding to the user interface element. Specific resource types may include specific texture resources (e.g., the texture of control buttons) required for drawing user interface elements, specific types of buffers, and programs required for drawing user interface elements. In graphics drawing, "program" usually refers to code or software programs used to perform specific graphics drawing tasks.
[0245] After identifying the first initial frame buffer according to the above process, generating a corresponding alternative frame buffer, and redirecting the rendering instruction stream to the corresponding alternative frame buffer, the phone can then draw the main scene and user interface elements in the alternative frame buffer. Specifically, the user interface elements are drawn in real-time in the second target area of the alternative frame buffer, while the main scene can be drawn in real-time or non-real-time in the first target area of the alternative frame buffer. That is, the phone can draw the main scene in real-time within the first target area of the alternative frame buffer, or it can draw the main scene non-real-time within that first target area. For example, the phone can first execute the rendering instruction for instructing the drawing of the main scene in real-time in the initial frame buffer corresponding to the main scene, so that the main scene is first drawn in the corresponding initial frame buffer, and then paste the drawn main scene into the first target area of the alternative frame buffer.
[0246] In summary, the mobile phone can determine whether to render the main scene in real time in the alternative frame buffer based on whether the main scene screen and user interface elements share a frame buffer. To maintain consistency with the above description, we will refer to "setting user interface elements and the main scene screen to share a frame buffer in game applications" as the first case and "setting user interface elements and the main scene screen not to share a frame buffer in game applications" as the second case.
[0247] In the first scenario (where the user interface elements and the main scene share a frame buffer in a game application), because the user interface elements and the main scene share a substitute frame buffer, the rendering instructions redirected to the substitute frame buffer include not only the second rendering instruction (the rendering instruction used to instruct the drawing of the user interface elements) but also the first rendering instruction (the rendering instruction used to instruct the drawing of the main scene). Therefore, the phone can analyze the types of rendering instructions in the rendering instruction stream in real time and adjust the viewport position according to the types of rendering instructions, thereby drawing the main scene and user interface elements in real time within the substitute frame buffer.
[0248] Specifically, when the first rendering instruction is redirected to the alternative frame buffer, the phone can call the viewport setting function to set the viewport position in a first target area within the target frame buffer, so as to draw the main scene image indicated by the first rendering instruction within the first target area. For example, the main scene image is drawn in the upper half of the frame buffer. When the second rendering instruction is redirected to the alternative frame buffer, the phone can call the viewport setting function to set the viewport position in a second target area within the target frame buffer, so as to draw the user interface elements indicated by the second rendering instruction within the second target area. For example, the user interface elements are drawn in the lower half of the frame buffer.
[0249] In the second scenario (where user interface elements and the main scene do not share a frame buffer in the game application), upon receiving a first rendering instruction instructing the main scene to be drawn, the phone can still draw the main scene in real-time within the initial frame buffer corresponding to the main scene (denoted as the second initial frame buffer). Upon receiving a second rendering instruction instructing the drawing of user interface elements, the phone can redirect this second rendering instruction to an alternative frame buffer, thereby drawing the user interface elements in real-time within a second target area based on this second rendering instruction. Then, the phone can paste the main scene drawn in the second initial frame buffer into the first target area in the alternative frame buffer. In this way, the main scene and user interface elements can be drawn separately in different areas of the alternative frame buffer. For ease of understanding, the following explanation is provided in conjunction with Figures 14 and 15.
[0250] Figure 14 shows one of the schematic diagrams of separate drawing without sharing a frame buffer provided in an embodiment of this application.
[0251] In one example, as shown in Figure 14, the method for separating the rendering of user interface elements from the main scene in a game application may include the following steps:
[0252] Step 1: Send the rendering command stream from the mobile phone.
[0253] As can be seen from S901 above, the rendering instruction stream may include a first rendering instruction and a second rendering instruction. The first rendering instruction is used to instruct the rendering of the main scene screen of the game application, and the second rendering instruction is used to instruct the rendering of the user interface elements of the game application.
[0254] Specifically, the rendering instruction stream is issued by the game application on the phone.
[0255] Step 2: The phone redirects the second rendering instruction, which was originally allocated to the first initial frame buffer, to the alternative frame buffer.
[0256] Step 3: Draw the user interface elements indicated by the second rendering instruction in real time in region 1402 of the alternative frame buffer.
[0257] It is understandable that region 1401 in the replacement framebuffer is blank and is not drawn in that region.
[0258] Step 4: The phone renders the main scene in real time in the second initial frame buffer corresponding to the main scene screen.
[0259] Step 5: The phone pastes the main scene drawn in the second initial frame buffer into area 1401 in the replacement frame buffer.
[0260] Based on the above steps, it is possible to separate the main scene and user interface elements and draw them in different areas of the alternative frame buffer without sharing a frame buffer.
[0261] Figure 15 shows a second schematic diagram of separate drawing without sharing a frame buffer, provided by an embodiment of this application.
[0262] In another example, since the alternative framebuffer is temporary and cannot be used for display, after drawing the main scene and user interface elements separately in different areas of the alternative framebuffer, the phone will also paste the content drawn in the alternative framebuffer (i.e., the main scene and user interface elements) into the default framebuffer used for display. However, since the size of the original default framebuffer FB0 is smaller than the size of the alternative framebuffer, as shown in Figure 15, the method for separating the drawing of user interface elements and the main scene in a game application when they do not share a framebuffer can include:
[0263] Step 6: The phone can extend the original default frame buffer FB0 by 2 times.
[0264] In other words, the size of the default frame buffer is increased so that it corresponds to the size of the foldable screen. Therefore, the size of the increased default frame buffer also corresponds to the size of the replacement frame buffer.
[0265] Step 7: The phone can paste the main scene and user interface elements drawn in the replacement frame buffer into the enlarged default frame buffer for display.
[0266] It should be noted that after increasing the default frame buffer size, special operations such as rotation may cause the default frame buffer to be reset to its original size. Therefore, after receiving the swap buffer instruction, the mobile phone can determine the size of the default frame buffer when each frame is sent for display. If the size of the default frame buffer when a frame is sent for display does not match the size of the replacement frame buffer, it can request to increase the size of the default frame buffer again to make it correspond to the size of the replacement frame buffer.
[0267] For example, after recognizing the `swapBuffer` instruction, the phone can determine the size of FB0 when each frame is sent for display. If its size is W×H, then a new W×2H FB0 is requested to be generated to change the size of FB0 to W×2H. After changing the FB0 size, if the FB0 size obtained when sending a frame is not equal to W×2H, it means that the system has reset the size of the display buffer, and the phone needs to change the FB0 size to W'×2H'. Here, W'×2H' is the FB0 size after the change.
[0268] For example, after increasing the size of the default frame buffer, during the display process, the phone can swap the main scene image and user interface elements in the enlarged default frame buffer to the foreground frame buffer. The foreground frame buffer is used to display the main scene image in the first screen area and the user interface elements in the second screen area.
[0269] The preceding text described the various processes of the game interface display method provided in the embodiments of this application. The following describes the specific flow of the game interface display method provided in the embodiments of this application, taking an example of the method applied to a mobile phone, which may include a foldable screen and a third screen. The foldable screen can be folded into a first screen and a second screen. The foldable screen is in a folded state, the first screen and the second screen face each other, and the size of the third screen corresponds to that of the first screen. Referring to Figure 16, the following text describes the specific flow of the game interface display method provided in the embodiments of this application.
[0270] Figure 16 shows a second schematic flowchart of a game interface display method provided in an embodiment of this application. As shown in Figure 16, the game interface display method may include:
[0271] S1601, In response to the operation of unfolding the folding screen, the folding screen is in the unfolded state.
[0272] When the foldable screen is in the unfolded state, the following situations are handled:
[0273] (1) The user interface elements of the game application are drawn in a non-off-screen manner.
[0274] In this case, steps S1602 to S1603 can be performed.
[0275] (2) The user interface elements of the game application are drawn in an off-screen manner, and the user interface elements and the main scene share the same frame buffer.
[0276] In this case, steps S1604 to S1607 can be executed.
[0277] (3) The user interface elements of the game application are drawn in an off-screen manner, and the user interface elements and the main scene do not share the same frame buffer.
[0278] In this case, steps S1608 to S1613 can be performed.
[0279] In one embodiment, the processing logic corresponding to the above three cases can be bound to the game application by default. Specifically, for each game application, its UI element drawing method and whether the user interface elements share the frame buffer with the main scene screen can be determined in advance, that is, the target situation to which the game application belongs (i.e., which of the above three cases it belongs to). Then, according to the target situation to which the game application belongs, processing logic matching the target situation can be bound to the game application. After binding the processing logic, when the game application starts running, if the folded screen is unfolded, the bound processing logic matching the target situation can be automatically triggered for the game application. For example, if the UI element drawing method of game application 1 is off-screen drawing and the user interface elements share the frame buffer with the main scene screen, then when the folded screen is unfolded, steps S1604 to S1607 and S1614 to S1615 can be automatically executed without corresponding analysis and judgment processing.
[0280] In another embodiment, the processing logic corresponding to the above three situations does not need to be pre-bound to the game application by default. Instead, the mobile phone automatically identifies the target situation to which each game application belongs, thereby triggering the processing logic corresponding to the target situation. The specific processing steps of this embodiment will be described in detail in the embodiment shown in Figure 17 below.
[0281] S1602. Change the size of the default frame buffer FB0 to obtain the target frame buffer corresponding to the size of the unfolded folded screen.
[0282] S1603: Analyze the rendering command flow in real time and adjust the drawing position.
[0283] In one embodiment, the target frame buffer includes a first target region and a second target region. The first target region corresponds to a first screen; the second target region corresponds to a second screen.
[0284] Based on this, step S1603 may include: first, for the first rendering instruction in the rendering instruction stream, calling the viewport setting function to set the viewport position in the first target area in the target frame buffer, so as to draw the main scene screen indicated by the first rendering instruction in the first target area; second, for the second rendering instruction in the rendering instruction stream, calling the viewport setting function to set the viewport position in the second target area in the target frame buffer, so as to draw the user interface element indicated by the second rendering instruction in the second target area.
[0285] S1604. Identify the frame buffer that executes the most rendering instructions in the drawing process and obtain the first initial frame buffer corresponding to the user interface element.
[0286] S1605. For the first initial frame buffer, generate an alternative frame buffer corresponding to the size of the foldable screen.
[0287] S1606, redirect the first and second rendering instructions for the first initial frame buffer to the alternative frame buffer.
[0288] S1607: Analyze the rendering command stream in real time and adjust the drawing position.
[0289] Specifically, for the first rendering instruction in the rendering instruction stream, the viewport setting function is called to set the viewport position in the first target area in the substitute frame buffer, so as to draw the main scene screen indicated by the first rendering instruction in the first target area; for the second rendering instruction in the rendering instruction stream, the viewport setting function is called to set the viewport position in the second target area in the substitute frame buffer, so as to draw the user interface elements indicated by the second rendering instruction in real time in the second target area.
[0290] It should be noted that, due to the requirements of the game itself, some user interface elements need to be displayed in the main scene. For example, in a battle game, user interface elements used to indicate the user's combat power or energy value need to be displayed in the main scene of the game application to provide real-time feedback on the combat capabilities of both sides. Therefore, the phone also needs to pre-set a preset element type, which is a pre-defined element type of the user interface elements to be drawn within the first target area. After receiving the second rendering instruction, the phone can analyze the element type of the user interface element to be drawn as instructed by the second rendering instruction. If the element type is a preset element type, the phone calls the viewport setting function to adjust the viewport position to the first target area to draw the user interface element as instructed by the rendering instruction within the first target area. If the element type of the user interface element to be drawn as instructed by the second rendering instruction is not a preset element type, the phone can call the viewport setting function to set the viewport position to the second target area in the target frame buffer.
[0291] S1608. Identify the frame buffer corresponding to the preset resource type from the candidate frame buffers and use it as the first initial frame buffer corresponding to the user interface element.
[0292] The preset resource type is the resource type that needs to be used when drawing user interface elements.
[0293] S1609. For the first initial frame buffer, generate an alternative frame buffer corresponding to the size of the foldable screen.
[0294] S1610, Perform redirection processing to redirect the second rendering instruction for the first initial framebuffer to the alternative framebuffer.
[0295] S1611. Analyze the rendering instruction stream in real time, call the viewport setting function to set the viewport position in the second target area in the alternative frame buffer, and draw the user interface elements indicated by the second rendering instruction in real time within the second target area.
[0296] S1612. Based on the first rendering instruction, the main scene is drawn in real time in the second initial frame buffer corresponding to the main scene.
[0297] The first rendering instruction is used to instruct the rendering of the main scene.
[0298] S1613. Paste the main scene drawn in the second initial frame buffer into the first target area in the replacement frame buffer.
[0299] For the first case in S1601 above, step S1615 can be executed directly after step S1603 is completed.
[0300] For cases (2) and (3) in S1601 above, steps S1614 to S1615 can be executed after step S1607 or S1613.
[0301] S1614. Increase the size of the default frame buffer FB0; the increased size of the default frame buffer corresponds to the size of the foldable screen.
[0302] For example, the size of the default frame buffer FB0 can be changed from (W, H) to (W, 2H) to correspond to the size of the foldable screen.
[0303] S1615. Paste the main scene and user interface elements drawn in the replacement frame buffer into the enlarged default frame buffer for display.
[0304] Specifically, the phone can display the main scene and user interface elements based on the enlarged default frame buffer, so that when the foldable screen is in the unfolded state, the main scene of the game application is displayed on the first screen of the foldable screen, and the user interface elements are displayed on the second screen of the foldable screen.
[0305] The following describes the application of the method to a mobile phone, which may include an outer screen and an inner screen. The inner screen is a foldable screen that can be folded into a first screen and a second screen. The sizes of the first screen, the second screen, and the third screen are all corresponding. Referring to Figure 17, the specific flow of the game interface display method provided in this application embodiment will be introduced.
[0306] Figure 17 shows a third schematic flowchart of a game interface display method provided in an embodiment of this application. As shown in Figure 17, the game interface display method may include:
[0307] S1701, In response to the operation of unfolding the folding screen, the folding screen is in the unfolded state.
[0308] S1702. Determine whether user interface elements are drawn off-screen.
[0309] It should be noted that if it is determined that the user interface element is not drawn off-screen, i.e., not drawn off-screen, then steps S1703 and S1704 are executed; if it is determined that the user interface element is drawn off-screen, then step S1705 is executed.
[0310] It can be understood that S1702 is used to determine whether the drawing method corresponding to the user interface elements of the game application is off-screen drawing.
[0311] Specifically, after the foldable screen is unfolded, the phone can obtain game parameters and determine the rendering method for the user interface elements of the game application based on these parameters. For example, the phone can obtain the game's attribute parameters and determine the rendering method for the user interface elements based on these parameters. In some examples, the game's attribute parameters may include parameters characterizing the rendering method for the user interface elements, thereby determining the rendering method for each user interface element.
[0312] S1703. Change the size of the default frame buffer FB0 to obtain the target frame buffer corresponding to the size of the foldable screen.
[0313] S1704: Analyze the rendering command flow in real time and adjust the drawing position.
[0314] S1705. Determine whether user interface elements and the main scene screen share the same frame buffer.
[0315] It should be noted that if it is determined that the user interface elements and the main scene screen share the same frame buffer, then steps S1706 to S1709 are executed; if it is determined that the user interface elements and the main scene screen do not share the same frame buffer, then steps S1710 to S1715 are executed.
[0316] It can be understood that S1705 is used to determine whether the game application sets the user interface elements and the main scene screen to share the same frame buffer, that is, whether the user interface elements and the main scene screen are set to be drawn in the same frame buffer in real time. If so, they share the frame buffer; if not, they do not share the frame buffer.
[0317] Specifically, the mobile phone can obtain the game's attribute parameters and determine whether the user interface elements and the main scene screen share the same frame buffer based on the game's attribute parameters.
[0318] It is understandable that by automatically identifying the drawing method corresponding to the user interface elements and automatically identifying whether the user interface elements and the main scene screen share the same frame buffer, the corresponding processing logic can be triggered and executed. This enables the separate drawing and separate display of the main scene screen and user interface elements for any game. Even newly launched game applications can be automatically separated and displayed based on their game parameters, that is, automatically adapt to any game, improve applicability, and thus enhance the user experience.
[0319] S1706. Identify the frame buffer that executes the most rendering instructions in the drawing process and obtain the first initial frame buffer corresponding to the user interface element.
[0320] S1707. For the first initial frame buffer, generate an alternative frame buffer corresponding to the size of the foldable screen.
[0321] S1708, redirect the first and second rendering instructions for the first initial frame buffer to the alternative frame buffer.
[0322] S1709: Analyze the rendering command stream in real time and adjust the drawing position.
[0323] S1710. Identify the frame buffer corresponding to the preset resource type from the candidate frame buffers and use it as the first initial frame buffer corresponding to the user interface element.
[0324] The preset resource type is the resource type that needs to be used when drawing user interface elements.
[0325] S1711. For the first initial frame buffer, generate an alternative frame buffer corresponding to the size of the foldable screen.
[0326] S1712, Perform redirection processing to redirect the second rendering instruction for the first initial framebuffer to the alternative framebuffer.
[0327] S1713. Analyze the rendering instruction stream in real time, call the viewport setting function to set the viewport position in the second target area in the alternative frame buffer, and draw the user interface elements indicated by the second rendering instruction in real time within the second target area.
[0328] S1714. Based on the first rendering instruction, the main scene is drawn in real time in the second initial frame buffer corresponding to the main scene.
[0329] The first rendering instruction is used to instruct the rendering of the main scene.
[0330] S1715. Paste the main scene drawn in the second initial frame buffer into the first target area in the replacement frame buffer.
[0331] It is understandable that after executing step S1704, step S1717 can be executed. After executing step S1709 or S1715, steps S1716 to S1717 can be executed.
[0332] S1716. Increase the size of the default frame buffer FB0; the increased size of the default frame buffer corresponds to the size of the foldable screen.
[0333] S1717. Paste the main scene and user interface elements drawn in the replacement frame buffer into the enlarged default frame buffer for display.
[0334] In summary, in the game interface displayed using the method provided in this application embodiment, the main scene screen and user interface elements are displayed separately. For example, the main scene screen can be displayed on the first screen of the foldable screen, and the user interface elements can be displayed on the second screen, so that the main scene screen and user interface elements do not obscure each other and do not interfere with each other.
[0335] When users hold electronic devices, they typically hold them on the second screen of a foldable display. Therefore, displaying user interface elements on the second screen is more conducive to touch operations while playing games, resulting in a better user experience. The main scene is displayed on the first screen. Since users rarely touch the first screen while playing games, it does not obstruct the main scene, providing a better field of view for the user during gameplay.
[0336] The foregoing described the detailed process of separating the main scene and user interface elements in the game interface display method provided in this application embodiment. For example, the main scene is displayed on the first screen of a foldable screen of an electronic device (such as a mobile phone), and the user interface elements are displayed on the second screen of the same foldable screen. During this process, the processor, graphics processor, display screen, and other components in the electronic device will operate under high load, resulting in high power consumption and generating a large amount of heat. This can cause problems such as slow operation, lag, or even crashes in the electronic device, which not only affects the user experience but also negatively impacts the battery life of the electronic device and may even cause permanent damage.
[0337] Therefore, in the game interface display method provided in this application embodiment, the electronic device can also control the screen parameters of the first screen and the screen parameters of the second screen to satisfy at least one of the following: the brightness of the second screen is less than the brightness of the first screen, the screen refresh rate of the second screen is less than the screen refresh rate of the first screen, the resolution of the second screen is less than the resolution of the first screen, and the touch refresh rate of the first screen is less than the touch refresh rate of the second screen.
[0338] The first screen is used to display the main scene, so it has a higher brightness to enhance the user's visual experience while playing games. The second screen is used to display user interface elements, mainly for user interaction with the game. It does not require high brightness, so it has a lower brightness. This will not affect user operation and will also reduce the power consumption of the second screen, thereby reducing the overall power consumption of the electronic device.
[0339] The first screen has a higher refresh rate, which makes the main scene displayed on the first screen smoother and clearer, improving the user's visual experience when playing games. The second screen displays user interface elements, which are mainly used for user interaction with the game. The requirements for the smoothness and clarity of the screen are lower. Therefore, the refresh rate of the second screen can be lower, which will not affect the user's operation and can reduce the power consumption of the second screen, thereby reducing the overall power consumption of the electronic device.
[0340] The second screen has a higher touch refresh rate, which can improve its sensitivity, reduce issues such as touch dropouts and operation delays, and enhance the user's gaming experience. The first screen is mainly used to display the main scene, and users rarely perform touch operations on it. Therefore, electronic devices use a lower touch refresh rate for the first screen, which will not affect the user's visual experience while playing games, and can also reduce the power consumption of the first screen, thereby reducing the overall power consumption of the electronic device.
[0341] The first screen has a higher resolution, allowing it to display the main scene with more pixels, resulting in higher clarity and a better visual experience for the user while playing games. The second screen has a lower resolution, displaying the user interface with fewer pixels, resulting in lower clarity. Since the user interface doesn't require as much clarity as the main scene, it doesn't affect user operation. The lower resolution of the second screen also reduces its power consumption, thus lowering the overall power consumption of the electronic device.
[0342] The following section, in conjunction with Figure 18, introduces the screen parameters of the first and second screens in the foldable screen.
[0343] Figure 18 shows a second schematic diagram of a game interface provided in an embodiment of this application.
[0344] In one embodiment, as shown in Figure 18A, the brightness of the first screen of the foldable screen is high, and the brightness of the second screen is low. As shown in Figure 18B, the screen refresh rate of the first screen is high, and the screen refresh rate of the second screen is low. As shown in Figure 18C, the touch refresh rate of the first screen is low, and the touch refresh rate of the second screen is high. As shown in Figure 18D, the resolution of the first screen is high, and the resolution of the second screen is low. As shown in Figure 18E, the temperature of the second screen is approximately 8°C lower than that of the first screen, resulting in a better perceived temperature and thus improving the user experience.
[0345] As can be seen from the above, the temperature of each screen in a foldable screen in an electronic device is related to the power consumption of each screen. Therefore, the power consumption of each screen can be determined based on its temperature.
[0346] In one embodiment, the electronic device may include multiple temperature sensors, some of which can be used to collect the first temperature of each temperature collection point on the first screen of the foldable screen, and other temperature sensors can be used to collect the second temperature of each temperature collection point on the second screen of the foldable screen.
[0347] Next, the electronic device can determine the maximum value among the various first temperatures as the temperature of the first screen in the foldable screen (i.e., the first target temperature), or the electronic device can determine the average value of all the first temperatures as the first target temperature of the first screen in the foldable screen. Similarly, the electronic device can determine the maximum value among the various second temperatures as the temperature of the second screen in the foldable screen (i.e., the second target temperature), or the electronic device can determine the average value of all the second temperatures as the second target temperature of the second screen in the foldable screen.
[0348] Determining the maximum temperature among all temperature sensors on a screen as the screen's temperature provides a more accurate reflection of its highest temperature, allowing for faster implementation of cooling measures and thus reducing power consumption. Alternatively, determining the average temperature of all temperature sensors on a screen provides a more accurate reflection of the average temperature across all sensors.
[0349] In one example, after the game application starts—that is, while the main scene is displayed on the first screen of the foldable screen and the user interface elements are displayed on the second screen—each temperature sensor collects the temperature at its corresponding temperature collection point at a fixed frequency. In this way, the electronic device can obtain a first target temperature on the first screen of the foldable screen and a second target temperature on the second screen of the foldable screen at a fixed frequency after the game starts.
[0350] In one example, after the electronic device obtains the temperature of one screen of the foldable screen, it compares that temperature with a temperature threshold for that screen. Once the screen temperature is greater than or equal to the temperature threshold, the electronic device can perform at least one of the following operations on the screen:
[0351] Reduce the screen resolution to the target resolution, reduce the screen brightness to the target brightness, reduce the screen refresh rate to the target screen refresh rate, and reduce the screen touch refresh rate to the target touch refresh rate.
[0352] Specifically, for the first screen, if the first target temperature of the first screen is greater than or equal to the first temperature threshold, the electronic device performs at least one of the following operations: reducing the resolution of the first screen to the first resolution, reducing the brightness of the first screen to the first brightness, reducing the screen refresh rate of the first screen to the first screen refresh rate, and reducing the touch refresh rate of the first screen to the first touch refresh rate.
[0353] For example, when the first target temperature of the first screen is greater than or equal to a first temperature threshold, in addition to controlling the screen parameters of the first screen, the electronic device can also reduce the refresh rate of the game application. Reducing the refresh rate of the game application can also reduce the power consumption of the first screen, thereby reducing the temperature of the first screen.
[0354] Specifically, for the second screen, if the second target temperature of the second screen is greater than or equal to the second temperature threshold, the electronic device performs at least one of the following operations: reducing the resolution of the second screen to the second resolution, reducing the brightness of the second screen to the second brightness, reducing the screen refresh rate of the second screen to the second screen refresh rate, and reducing the touch refresh rate of the second screen to the second touch refresh rate.
[0355] During gameplay, users primarily interact with the game through user interface elements on the second screen, thus having more contact with it than with the first screen. Therefore, the temperature of the second screen has a greater impact on the user's gaming experience than the temperature of the first screen, resulting in a lower second temperature threshold than the first. This allows electronic devices to adjust the screen parameters of the second screen more promptly, thereby regulating its temperature and creating a more comfortable, ergonomic experience.
[0356] It is understandable that, since the brightness of the second screen is less than that of the first screen, the screen refresh rate of the second screen is less than that of the first screen, the touch refresh rate of the first screen is less than that of the second screen, and the resolution of the second screen is less than that of the first screen, the second resolution is less than the first resolution, the second brightness is less than the first brightness, the second screen refresh rate is less than the first screen refresh rate, and the second touch refresh rate is greater than the first touch refresh rate.
[0357] In one embodiment, when a user performs a touch operation on the second screen, the electronic device can acquire second initial point information on the second screen, and determine the user's touch position on the second screen based on the second initial point information. In order to more accurately reproduce the user's touch trajectory on the second screen, the electronic device can use a touch algorithm to process the second initial point information to obtain the effective point information when the user performs a touch operation on the second screen.
[0358] Specifically, when the electronic device receives a touch operation from the user on the second screen, it can obtain the second initial point information on the second screen; then, the electronic device uses a touch algorithm to filter out noise information in the second initial point information to obtain the effective point information of the second screen; finally, the electronic device can perform the corresponding touch operation based on the effective point information.
[0359] The process of filtering noise information from the initial point information using a touch algorithm to obtain valid point information for the second screen can include: First, the electronic device uses a touch algorithm to filter noise information from the initial point information to obtain target point information for the second screen. This avoids the electronic device responding to accidental touches by the user. Next, the electronic device uses a touch algorithm to correct the target point information to obtain valid point information. Typically, the accuracy of the initial point information collected by the electronic device is low. Correcting the target point information in the initial point information using a touch algorithm yields more accurate valid point information, thus better matching the user's touch purpose and improving the user experience.
[0360] In one embodiment, when a user performs a touch operation on the first screen, the electronic device can acquire first initial point information on the first screen. Based on this first initial point information, the user's touch position on the first screen can be determined. Since the first screen displays the main scene, users generally do not perform touch operations on it. Therefore, compared to the second screen, the accuracy requirement for point information is lower on the first screen. Based on this, the electronic device does not need to process the first initial point information; instead, it can directly execute the corresponding touch operation on the first screen based on the first initial point information. In other words, when the electronic device acquires the first initial point information on the first screen, it does not need to run a touch algorithm, which further reduces the power consumption of the electronic device.
[0361] As shown in Figure 19, this application embodiment also provides a chip system 1900, which includes at least one processor 1901 and at least one interface circuit 1902. The at least one processor 1901 and at least one interface circuit 1902 are interconnected via lines. The processor 1901 is used to support an electronic device in implementing the various steps in the above method embodiments, and the at least one interface circuit 1902 can be used to receive signals from other devices (e.g., memory) or to send signals to other devices (e.g., a communication interface). The chip system may include a chip and may also include other discrete devices.
[0362] This application also provides a computer-readable storage medium including computer instructions that, when executed on the electronic device, cause the terminal device to perform the functions or steps described in the method embodiments.
[0363] This application also provides a computer program product that, when run on a computer, causes the computer to perform the functions or steps described in the above method embodiments.
[0364] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0365] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0366] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0367] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0368] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. 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.
[0369] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for displaying a game interface, characterized in that, A method applicable to an electronic device having a foldable screen, the foldable screen comprising a first screen and a second screen that can be folded and unfolded relative to each other, the method comprising: When the electronic device is in the unfolded state and the foldable screen displays the first game interface of the game application, the first screen displays the main scene screen of the first game interface, and the second screen displays the user interface elements of the first game interface; the user interface elements include operation controls for manipulating the main scene screen. Wherein, the screen parameters of the first screen and the screen parameters of the second screen satisfy at least one of the following: The brightness of the second screen is less than that of the first screen; The refresh rate of the second screen is lower than that of the first screen; The resolution of the second screen is lower than the resolution of the first screen; and The touch refresh rate of the first screen is lower than that of the second screen.
2. The method according to claim 1, characterized in that, The method further includes: If the first target temperature of the first screen is greater than or equal to the first temperature threshold, then at least one of the following is performed: The resolution of the first screen is reduced to the first resolution; The brightness of the first screen is reduced to the first brightness level; The screen refresh rate of the first screen is reduced to the first screen refresh rate; and The touch refresh rate of the first screen is reduced to the first touch refresh rate.
3. The method according to claim 2, characterized in that, The method further includes: Obtain the first temperature of each temperature collection point on the first screen; The maximum value among the first temperatures is determined as the first target temperature, or the average value among the first temperatures is determined as the first target temperature.
4. The method according to claim 2 or 3, characterized in that, The method further includes: If the second target temperature of the second screen is greater than or equal to the second temperature threshold, then at least one of the following is performed: The resolution of the second screen is reduced to a second resolution; The brightness of the second screen is reduced to the second brightness level; The screen refresh rate of the second screen is reduced to the second screen refresh rate; and The touch refresh rate of the second screen is reduced to the second touch refresh rate; wherein, The second temperature threshold is less than the first temperature threshold; the second resolution is less than the first resolution; the second brightness is less than the first brightness; the second screen refresh rate is less than the first screen refresh rate; and the second touch refresh rate is greater than the first touch refresh rate.
5. The method according to claim 4, characterized in that, The method further includes: Obtain the second temperature of each temperature acquisition point on the second screen; The maximum value among the various second temperatures is determined as the second target temperature, or the average value among the various second temperatures is determined as the second target temperature.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: In response to a touch operation received on the second screen, the second initial point information of the second screen is obtained; The noise information in the second initial point information is filtered out using a touch algorithm to obtain the effective point information of the second screen; Execute the corresponding touch operation based on the valid point information.
7. The method according to claim 6, characterized in that, The step of filtering noise information in the second initial point information using a touch algorithm to obtain the effective point information of the second screen includes: The touch algorithm is used to filter out noise information in the second initial point information to obtain the target point information of the second screen; The target point information is corrected using the aforementioned touch algorithm to obtain the effective point information.
8. The method according to any one of claims 1-7, characterized in that, The method further includes: In response to a touch operation received on the first screen, the first initial point information of the first screen is obtained; Execute the corresponding touch operation based on the first initial point information.
9. The method according to any one of claims 1-8, characterized in that, The electronic device further includes a third screen, and the method further includes: When the foldable screen is in a folded state, the third screen displays the second game interface of the game application; The second game interface includes both the main scene screen of the game application and user interface elements.
10. The method according to any one of claims 1-9, characterized in that, Before the first screen displays the first game interface of the game application and the second screen displays the second game interface of the game application, the method further includes: The main scene of the game application is drawn in the first target area of the target frame buffer, and the user interface elements of the game application are drawn in the second target area of the target frame buffer. The size of the target frame buffer corresponds to the size of the foldable screen, the first target area corresponds to the first screen, and the second target area corresponds to the second screen.
11. The method according to claim 10, characterized in that, The user interface elements of the game application are drawn using non-off-screen rendering. Before drawing the main scene of the game application in the first target area of the target frame buffer and drawing the user interface elements of the game application in the second target area of the target frame buffer, the method further includes: Adjust the size of the default frame buffer to obtain the target frame buffer; The default frame buffer is the background frame buffer used by default for display in the double buffering mechanism, and the size of the default frame buffer corresponds to the size of the third screen.
12. The method according to claim 10, characterized in that, The user interface elements of the game application are drawn off-screen. Before drawing the main scene of the game application in the first target area of the target frame buffer and drawing the user interface elements of the game application in the second target area of the target frame buffer, the method further includes: For the first initial frame buffer corresponding to the user interface elements of the game application, the target frame buffer is generated; wherein, the first initial frame buffer refers to the frame buffer set in the game application for real-time drawing of user interface elements by the user, and the size of the first initial frame buffer corresponds to the size of the third screen; The rendering instructions for the first initial framebuffer are redirected to the target framebuffer.
13. The method according to claim 12, characterized in that, The game application is configured to share a frame buffer for its main scene screen and user interface elements. Before generating the target frame buffer from the first initial frame buffer corresponding to the user interface element of the game application, the method further includes: The frame buffer that executes the most rendering instructions during the drawing process is identified as the first initial frame buffer.
14. The method according to claim 12, characterized in that, Before generating the target frame buffer from the first initial frame buffer corresponding to the user interface element of the game application, the method further includes: Based on the resource type of the resources used by the candidate frame buffers, a frame buffer corresponding to a preset resource type is identified from the candidate frame buffers and used as the first initial frame buffer; wherein, the preset resource type refers to the resource type of the resources required when drawing the user interface elements of the game application.
15. The method according to claim 12 or 14, characterized in that, The game application sets its main scene and user interface elements to not share a frame buffer; before drawing the main scene of the game application in the first target area of the target frame buffer, the method further includes: Based on the first rendering instruction, the main scene is rendered in real time in the second initial frame buffer; the first rendering instruction is a rendering instruction used to instruct the rendering of the main scene of the game application; the second initial frame buffer refers to the frame buffer set in the game application for rendering the main scene in real time. The step of drawing the main scene of the game application in the first target area of the target frame buffer includes: The main scene drawn in the second initial frame buffer will be pasted into the first target area of the target frame buffer; The step of drawing the user interface elements of the game application in the second target area of the target frame buffer includes: Based on a second rendering instruction redirected to the target frame buffer, the user interface elements are drawn in real time within the second target area; the second rendering instruction is a rendering instruction used to instruct the drawing of the user interface elements of the game application.
16. The method according to claim 12, characterized in that, The method further includes: Adjust the size of the default frame buffer to correspond to the size of the foldable screen; After drawing the main scene of the game application in the first target area of the target frame buffer and drawing the user interface elements of the game application in the second target area of the target frame buffer, the method further includes: Paste the main scene and user interface elements of the game application drawn in the target frame buffer into the adjusted default frame buffer.
17. The method according to claim 10, characterized in that, The method further includes: The rendering instruction stream is analyzed in real time. For the first rendering instruction in the rendering instruction stream, the viewport setting function is called to set the viewport position in the first target area in the target frame buffer, so as to draw the main scene picture indicated by the first rendering instruction in the first target area. For the second rendering instruction in the rendering instruction stream, the viewport setting function is called to set the viewport position to the second target region in the target frame buffer, so as to draw the user interface elements indicated by the second rendering instruction within the second target region.
18. The method according to claim 17, characterized in that, The rendering instruction stream includes a second rendering instruction corresponding to a preset element type, and / or a second rendering instruction corresponding to a non-preset element type; the preset element type is a pre-set element type of the user interface elements to be drawn in the first target area; The user interface element drawn by the second rendering instruction corresponding to the non-preset element type belongs to the non-preset element type; the user interface element drawn by the second rendering instruction corresponding to the preset element type belongs to the preset element type. The step of calling the viewport setting function to set the viewport position in the second target region in the target frame buffer for the second rendering instruction in the rendering instruction stream includes: For the second rendering instruction corresponding to the non-preset element type, the viewport setting function is called to set the viewport position to the second target region in the target frame buffer; For the second rendering instruction corresponding to the preset element type, the viewport setting function is called to adjust the viewport position to the first target area, so as to draw the user interface element indicated by the second rendering instruction in the first target area.
19. An electronic device, characterized in that, The electronic device includes at least: a foldable screen, a memory, and one or more processors; the foldable screen can be folded into a first screen and a second screen; the foldable screen is used to display images, and the memory is used to store computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1-18.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-18.
Citation Information
Patent Citations
Method and device for displaying main screen and auxiliary screen of vehicle machine system and electronic equipment
CN110764725A
Touch method of equipment with folding screen and folding screen equipment
CN110839096A
Method for adapting game to folding screen
CN113209615A
Screen refresh rate adjusting method, electronic equipment and readable storage medium
CN114495864A
Game adaptation method and device, electronic equipment and computer readable storage medium
CN117398677A