CN115878115A - Page rendering method, device, medium and electronic equipment - Google Patents

Page rendering method, device, medium and electronic equipment Download PDF

Info

Publication number
CN115878115A
CN115878115A CN202211679013.7A CN202211679013A CN115878115A CN 115878115 A CN115878115 A CN 115878115A CN 202211679013 A CN202211679013 A CN 202211679013A CN 115878115 A CN115878115 A CN 115878115A
Authority
CN
China
Prior art keywords
target
page
game
target page
rendering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211679013.7A
Other languages
Chinese (zh)
Inventor
熊文源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202211679013.7A priority Critical patent/CN115878115A/en
Publication of CN115878115A publication Critical patent/CN115878115A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure relates to a page rendering method, a device, a medium and an electronic device, wherein the method comprises the following steps: acquiring a code file of a target page to be rendered in a target game, wherein the code file is a code realized based on a cross-platform development framework; determining a display mode of the target page; if the display mode of the target page is a mixed sorting mode, generating a texture identifier corresponding to the target page; determining a target display level corresponding to the texture identifier in the target game based on the texture identifier; and in a game page corresponding to the target display level in the target game, rendering content corresponding to the target page based on a game rendering engine and the texture identifier. Therefore, the code of the target page can be multiplexed under the multi-terminal device, and the mixed sequencing between the content display of the target page and the game page in the target game is realized.

Description

Page rendering method, device, medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a page rendering method, apparatus, medium, and electronic device.
Background
There are many UI rendering modes for the mobile end, such as common Android and iOS native-end UI rendering modes, and UI rendering modes for H5 pages in webview. In gaming applications, there are also self-rendering engines, such as Unity, cos, etc. However, the rendering method is not general, and if a target page needs to be developed in a batch game application, in the related art, the target page is usually developed by using an H5 page, so as to implement multiplexing between a mobile client and a PC. However, H5 pages are difficult to fuse with game pages in gaming applications.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a page rendering method, including:
acquiring a code file of a target page to be rendered in a target game, wherein the code file is a code realized based on a cross-platform development framework;
determining a display mode of the target page;
if the display mode of the target page is a mixed sorting mode, generating a texture identifier corresponding to the target page;
determining a target display level corresponding to the texture identifier in the target game based on the texture identifier;
and in the target game and in a game page corresponding to the target display level, rendering content corresponding to the target page based on a game rendering engine and the texture identifier.
In a second aspect, the present disclosure provides a page rendering apparatus, the apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a code file of a target page to be rendered in a target game, and the code file is a code realized based on a cross-platform development framework;
the first determining module is used for determining the display mode of the target page;
the generating module is used for generating a texture identifier corresponding to the target page if the display mode of the target page is a mixed sorting mode;
a second determining module, configured to determine, in the target game, a target display level corresponding to the texture identifier based on the texture identifier;
and the first rendering module is used for rendering the content corresponding to the target page in the target game and in the game page corresponding to the target display level based on a game rendering engine and the texture identifier.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing apparatus, performs the steps of the method of the first aspect.
In a fourth aspect, the present disclosure provides an electronic device comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method of the first aspect.
By the technical scheme, the code development of the target page can be carried out on the basis of the cross-platform development frame platform, so that the code reuse under multi-terminal equipment is realized, and the workload of code development and the technical requirements on developers are effectively saved. In addition, in the process of page rendering, the target display level of the game page used for displaying the content of the target page in the target game is determined by the texture identifier corresponding to the target page, so that the mixed sequencing between the content display of the target page and the game page in the target game is realized, the fusion between the target page and the game page is convenient to realize, and the smoothness of game application operation is improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
FIG. 1 is a flow diagram of a method of page rendering provided in accordance with one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a hierarchical rendering approach in different rendering engines;
FIG. 3 is a schematic illustration of a page display in a gaming application provided in accordance with an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of an add-on target page display in a gaming application provided in accordance with another embodiment of the present disclosure;
FIG. 5 is a block diagram of a page rendering apparatus provided in accordance with one embodiment of the present disclosure;
FIG. 6 shows a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
It is understood that before the technical solutions disclosed in the embodiments of the present disclosure are used, the type, the use range, the use scene, etc. of the personal information related to the present disclosure should be informed to the user and obtain the authorization of the user through a proper manner according to the relevant laws and regulations.
For example, in response to receiving a user's active request, prompt information is sent to the user to explicitly prompt the user that the requested operation to be performed would require acquisition and use of personal information to the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the disclosed technical solution, according to the prompt information.
As an optional but non-limiting implementation manner, in response to receiving an active request from the user, the manner of sending the prompt information to the user may be, for example, a pop-up window, and the prompt information may be presented in a text manner in the pop-up window. In addition, a selection control for providing personal information to the electronic device by the user's selection of "agreeing" or "disagreeing" can be carried in the pop-up window.
It is understood that the above notification and user authorization process is only illustrative and not limiting, and other ways of satisfying relevant laws and regulations may be applied to the implementation of the present disclosure.
Meanwhile, it is understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the corresponding laws and regulations and the related regulations.
Fig. 1 is a flowchart of a page rendering method according to an embodiment of the present disclosure, and as shown in fig. 1, the method may include:
in step 11, a code file of a target page to be rendered in the target game is obtained, wherein the code file is a code realized based on a cross-platform development framework.
The code realized based on the cross-platform development framework can support multi-terminal multiplexing, different codes do not need to be developed for different clients of the target game, and different developments do not need to be carried out based on different development languages. Illustratively, the cross-platform development framework may be a ReactNative framework platform. The ReactNative is a JavaScript framework, the React component is rendered into a component of a native platform by combining the React and the native, front-end page development can be carried out on the basis of JSX, mixed js, css, html and the like, and page development can be carried out on the basis of a JavaScript language for developers. In the ReactNative framework, native development is adopted, front-end codes (such as js codes) are adopted to write business logic, and native components at both ends of Android and iOS are supported to render UI pages.
In step 12, the display mode of the target page is determined. The display mode can be used for representing the display mode of the target page in the target game. The display mode may include a mixed sort mode, a full page mode, a window mode, and the like. The target page may be an activity page added in the target game, such as a page developed for the yearly celebration, fan event, and the like of the target game.
For example, the display mode of the target page may be pre-configured, and then the display mode of the target page may be determined based on the configuration information of the target page. The configuration information corresponding to the target page may be implemented by a configuration file or a field, which is not limited in this disclosure.
In step 13, if the display mode of the target page is the mixed sorting mode, a texture identifier corresponding to the target page is generated.
In this step, if the display mode of the target page is a mixed ranking mode, it indicates that the target page needs to be displayed in a mixed manner with pages in the target game when being displayed, if the target page is not a page displayed at the top in the target game, that is, the target page is inserted into a game page of the target game for display, and the game page in the target game is used as a carrier for drawing content in the target page, so that the display of the target page is realized by ranking and displaying among a plurality of game pages in the target game.
Further, a rendering thread render may be created to render the target page, and accordingly, the texture identifier may be generated based on a glgentextues function, wherein in the rendering of the OpenGL interface, glgentextues is a function for generating a texture, which may generate a texture ID (TextureID) as a unique identifier of the texture content corresponding to the target page, so as to subsequently uniquely determine the corresponding target page based on the texture identifier.
In step 14, a target display level corresponding to the texture identification is determined in the target game based on the texture identification.
In this embodiment, when the developed display mode of the target page is a mixed sorting mode, it means that the display hierarchy corresponding to the target page and the game page needs to be determined.
Further, if the texture identifier uniquely determines the target page, in this embodiment, the target display level corresponding to the texture identifier may be determined in the target game based on the texture identifier, so as to implement, in the target game, based on the binding relationship between the texture identifier and the target display level, the mixed ordering between the game page bearing the content of the target page corresponding to the texture identifier and the game page inside the target game.
The texture identifier may be a texture ID (TextureID), which may be used to identify a memory address of each texture in the GPU memory, and the texture of each GPU (i.e., the canvas for displaying the target page) has a unique TextureID corresponding to the texture identifier. Therefore, the texture identifier of the target page may be associated with the target display level in the target game, so as to reserve a scene for the target page in the target game, and then the corresponding target display level may be determined in the target game based on the texture identifier, so that when the game page of the target display level is displayed, the corresponding target page may be determined based on the corresponding texture identifier, so as to insert the target page into the target game for display.
In step 15, in the game page corresponding to the target display level in the target game, content corresponding to the target page is rendered based on the game rendering engine and the texture identifier.
In this embodiment, the content corresponding to the target page is carried by a game page in the target game, for example, the target page corresponding to the game rendering engine may be determined based on the texture identifier, and then the content description code of the target page may be rendered in the code file to display the specific content in the target page.
Therefore, by the technical scheme, the code development of the target page can be carried out based on the cross-platform development frame platform, so that the code reuse under multi-terminal equipment is realized, and the workload of code development and the technical requirements on developers are effectively saved. In addition, in the process of page rendering, the target display level of the game page used for displaying the content of the target page in the target game is determined by the texture identifier corresponding to the target page, so that the mixed sequencing between the content display of the target page and the game page in the target game is realized, the fusion between the target page and the game page is convenient to realize, and the smoothness of the game application operation is improved.
In a possible embodiment, a three. Js frame and a read-three-fiber frame are introduced into a JSI frame of the ReactNative frame platform, so that a code file of the target page is rendered based on an OpenGL interface.
In the embodiment of the present disclosure, rendering of a target page may be implemented based on a code developed by a ReactNative framework platform based on an OpenGL interface in a game rendering engine, and then an OpenGL environment may be initialized under the condition that it is determined that a display mode of the target page is a mixed sequencing mode, that is, an OpenGL environment is created in the target page, and a relevant configuration of OpenGL is created based on a relevant parameter in the target game, for example, parameters EGLContext, EGLDisplay, and EGLConfig in the target game are obtained, thereby implementing environment configuration. The configuration of the OpenGL environment parameters may adopt an environment configuration mode commonly used in the art, which is not limited in this disclosure.
OpenGL (Open Graphics Library ) is a cross-language, cross-platform Application Programming Interface (API) for rendering 2D, 3D vector Graphics. As shown in fig. 2, a schematic diagram of a hierarchical rendering manner in different rendering engines is shown, as shown in fig. 2, in rendering engines of an Android side, a ReactNative framework and a game (e.g., unity), the rendering manner of a CPU \ GPU is adopted at the bottom layer, and in order to facilitate concise rendering of more 2D UIs at the Android side, a component and a rendering framework provided by a Skia library are introduced at the upper layer, so as to complete packaging of an Android native end component, that is, an Android UI can be understood as a Skia-based rendering manner. In the rendering engine of the game, the rendering of the UI is realized on the basis of the bottom layer 3D technology such as OpenGL/vulkan and the like. Therefore, when a new target page is added to the game, rendering at the UI level is difficult to merge due to a large difference between the rendering principle and the development language.
In the embodiment of the disclosure, the cross-platform development framework is a ReactNative framework platform, and the ReactNative framework platform can be constructed based on the ReactNative framework, wherein a JSI framework in the ReactNative framework can be used for supporting the rendering of an OpenGL interface, so that a code developed based on the framework platform disclosed by the disclosure can be suitable for the rendering of the OpenGL interface, a target page and a game application can be rendered based on the same rendering interface, and the rendering fusion between the target page and the game page is realized.
Furthermore, a three.js framework and a real-three-fiber framework are introduced into the JSI framework, wherein the three.js framework is introduced and is an open source framework, 3D APIs are defined, the 3D development framework can be supported while the OpenGL page can be rapidly supported at the front end, and the real-three-fiber framework is introduced so that the three.js framework can be supported in the ReactNative framework to support the rendering of the 3D page.
Therefore, through the cross-platform development framework, the communication with the OpenGL interface can be realized through the JSI framework in the ReactNative framework, and therefore the API in the thread. According to the technical scheme, the target page can be rendered by adopting the rendering capability of the OpenGL interface, so that the rendering mode of the target page is consistent with the bottom rendering mode in game application, meanwhile, based on the cross-end capability of the ReactNative framework, the code file developed based on the ReactNative framework platform can simultaneously support cross-end development of Android and iOS, based on the developed code file, the rendering multiplexing of the target page under a plurality of game platforms is realized, and the development and rendering processes of the target page are simplified. Meanwhile, the starting performance and the memory performance of the page corresponding to the Reactnative are high, so that the jamming in the process of loading and displaying the target page and excessive occupation of the memory of the terminal equipment are avoided to a certain extent, and the efficiency and the fluency of page display are further improved.
In a possible embodiment, before the step of determining the display mode of the target page, the method further comprises:
and acquiring a page configuration file, wherein the page configuration file comprises a page identifier of the target page and a display mode of the target page. For example, the developed target page may be configured in advance, and if the display mode of the target page is specified, the configuration file may be generated by associating the page identifier and the display mode of the target page.
Accordingly, the determining the display mode of the target page comprises:
and inquiring the page configuration file according to the page identification of the target page, and determining the display mode in the inquired result as the display mode of the target page.
Therefore, the display mode corresponding to the target page can be quickly and accurately determined based on the configuration file, so that the target page can be displayed based on different display modes in the following process.
As an example, the target display level corresponding to the target page is determined in the target game based on a configuration script corresponding to the target page, where a correspondence relationship between the page and the display level is indicated in the configuration script.
Illustratively, the target page of the development may be configured in advance, such as specifying a display hierarchy of the target page. As shown in fig. 3, a schematic diagram of page display in a target game is shown, where the pages G1 and G2 are both game pages in the target game, the pattern G1 is display content in the page G1, and the pattern G2 is display content in the page G2, and as for the target page a, a corresponding display level thereof may be set to be a layer 2, that is, it is required to be mixed with the pages G1 and G2, as shown in fig. 4, a schematic diagram of target page display is added in the target game, where the pattern a is display content in the page a, in this case, the display level of the target page a may be configured, and a configuration script is generated. Illustratively, the configuration script may be a Lua script.
Correspondingly, when the target game is started, the configuration script can be loaded, so that the display level corresponding to the newly added target page is determined by analyzing based on the configuration script, the internal parameters of the game application do not need to be modified, the newly added and configured target page is convenient, and dynamic issuing and newly added of the target page can be supported.
In one possible embodiment, the implementation of determining a target display level in the target game corresponding to the texture identifier based on the texture identifier may include:
and sending the texture identifier and the page identifier of the target page to the target game, so that the target game determines the display level corresponding to the texture identifier and the page identifier as the target display level corresponding to the texture representation.
In this embodiment, since the target page is to be displayed in a game page manner in the target game, a display container corresponding to the target page needs to be applied in the target game. Accordingly, the texture identifier and the page identifier corresponding to the target page may be transparently transmitted to the inside of the target game, and the target game may determine the target display level corresponding to the target page based on the page identifier, and further associate the texture identifier with the game page corresponding to the target display level. An external texture can be created as through texture2d. In the function, parameters Width and Height may be included to determine the Width and Height of the created texture, and the parameters also include (IntPtr) TextureId, which is the texture identifier corresponding to the target page. The parameters and parameter formats in the function and the implementation of the function are conventional in the art, and are not described herein again.
Therefore, according to the technical scheme, in the process of rendering the target page, the texture identifier can be transmitted to the target game in a transparent mode, so that the game pages can be sequenced in the target game based on the texture identifier, the display level of the target page is determined, page content corresponding to the texture identifier can be mixed and sequenced with the game pages in the target game, the fusion of the target page and the pages in the game is realized, the target page is prevented from being directly displayed on the top layer to cover the game pages, and the use requirements of a user are met.
In one possible embodiment, in the game page corresponding to the target display level in the target game, an exemplary manner of rendering content corresponding to the target page based on a game rendering engine and the texture identifier may include:
determining a target code corresponding to the page content of the target page from the code file according to the texture identifier;
rendering the object code through an open graphics interface (OpenGL interface) corresponding to the game rendering engine to render content corresponding to the object page into a game page corresponding to the object display level.
If the target page needs to be displayed in the target game, the game page corresponding to the target display level may determine the texture identifier associated with the target display level to determine which page should be rendered in the game page, and further determine what content should be displayed in the game page.
Illustratively, the texture identifier corresponds to the target page one to one, and then the target code corresponding to the content corresponding to the target page is determined from the code file based on the texture identifier, that is, the service code corresponding to the texture identifier is loaded, and the service code is the target code for describing the content corresponding to the target page, and then the service code can be rendered based on the OpenGL interface, so as to render the content corresponding to the target code into a game page, thereby realizing the display of the target page inside the target game.
Therefore, according to the technical scheme, when the target page is rendered, the texture which should be drawn in the game page is determined based on the texture identification of the target page, so that the content of the target page is drawn in the game page, the display of the newly added target page in the game application is realized, and the processes of adding and rendering the target page are further simplified.
In one possible embodiment, the method may further comprise:
and if the display mode is a full page mode and the target page is a 3D page, creating a display page corresponding to the target page, if activity is available, namely, additionally creating the display page to bear the content corresponding to the target page. In the full-page mode, if the target page is displayed in the process of displaying the animation and the sound in the target game, the game page in the target game needs to be interrupted, that is, after the displayed animation and the displayed sound are interrupted, the target page in the full-page mode is displayed.
Then, creating a target view for displaying the content of the open graphic interface, and mounting the target view to a root view of the display page; and rendering is carried out in the target view based on the code file, and the target page is obtained. Illustratively, the target view may be OpenGLview.
In this embodiment, if the display mode is the full page mode, it indicates that the target page needs to be displayed as a separate page, but not as a page within the target game, in this case, a carrier carrying the content of the target page needs to be created for the target page, and in the full page mode, the display page activity may be created as a display carrier for the target page.
Further, if the target page is a 2D page, native development is adopted in the ReactNative framework, and the target page supports rendering of the UI page through native components at both ends of Android and iOS, rendering can be performed based on the native components provided by the target page, rendering can be performed through a native textView component, a button component and the like at the Android end, and the rendering mode can be based on a mode commonly used in the field and is not described herein again.
If the target page is a 3D page, it needs OpenGL to render, for example, the target page can be rendered based on an OpenGLview view. Wherein, it has a corresponding root view Rootview in activity, so as to be used for mounting other sub-views to complete the content rendering in the page. On this basis, an OpenGLview view may be created, and the OpenGLview is mounted to the root view of the display page activity, and then rendering is performed in the OpenGLview based on the code file to draw the content of the target page into the OpenGLview, so as to display in the activity page, thereby realizing display of the target page.
Therefore, by the mode, the target page under the full-page mode can be rendered, the 2D and 3D pages can be rendered based on the code file developed by the ReactNative framework platform, the compatibility of the multi-terminal device under the platform in the target page development is facilitated, and the use by a user is facilitated. And the display modes of the target pages under a plurality of scenes in the target game can be supported through a plurality of display modes, so that the diversity of target page rendering is improved.
In one possible embodiment, the method may further comprise:
and if the display mode is a window mode and the target page is a 3D page, creating a display window for the target page, such as dialog. In the window mode, if the target page is displayed in the process of displaying the animation and the sound in the target game, the game page in the target game does not need to be interrupted, namely the target page in the window mode is displayed in the process of playing the displayed animation and the displayed sound.
Taking the root view of the display window as the Content attribute of the display window, further creating a target view for displaying the Content of the open graphical interface, and mounting the target view to the root view of the display window; and rendering is carried out in the target view based on the code file, and the target page is obtained. Illustratively, the target view may be OpenGLview.
Embedding of the window can be achieved through the Content attribute of the dialog, namely, a root view of the display window is used as the view to be embedded into the dialog, so that the Content in the target page can be rendered based on the root view. Similarly, in the window mode, the rendering manner of the 2D page and the 3D page is the same as the above-mentioned full page mode type, which is not described herein again.
Therefore, by means of the technical scheme, the target page can be rendered and displayed through the dialog box window in the game application, the display mode of the target page is further increased, the newly added diversity of the target page is improved, further the adaptation of more game applications can be achieved, the compatibility and usability of development and rendering of the target page are improved, and the user experience is improved.
In a possible embodiment, the code file of the target page may be developed and uploaded to the cloud, and then in step 11, the code file of the target page to be rendered in the target game is obtained, which may be the code file of the target page to be rendered in the target game obtained from the cloud when the target game is started, so that the target page is quickly rendered in the running process of the game application, and the rendering and displaying efficiency of the target page is improved.
For example, before the target page is rendered, for example, before the display mode of the target page is determined, whether the code file is accurately loaded to the local may be detected, and if the code file is not loaded to the local, an exception prompt may be output, so as to prompt a relevant person to perform exception attribution detection in time.
The present disclosure further provides a page rendering apparatus, as shown in fig. 5, the apparatus 10 includes:
a first obtaining module 100, configured to obtain a code file of a target page to be rendered in a target game, where the code file is a code implemented based on a cross-platform development framework;
a first determining module 200, configured to determine a display mode of the target page;
a generating module 300, configured to generate a texture identifier corresponding to the target page if the display mode of the target page is a mixed sorting mode;
a second determining module 400, configured to determine, in the target game, a target display level corresponding to the texture identifier based on the texture identifier;
a first rendering module 500, configured to render, in a game page corresponding to the target display level in the target game, content corresponding to the target page based on a game rendering engine and the texture identifier.
Optionally, the second determining module is further configured to:
and sending the texture identifier and the page identifier of the target page to the target game so that the target game determines the display level corresponding to the page identifier as the target display level corresponding to the texture identifier.
Optionally, the first rendering module comprises:
the first determining submodule is used for determining a target code corresponding to the page content of the target page from the code file according to the texture identifier;
and the rendering submodule is used for rendering the target code through an open graphic interface corresponding to the game rendering engine so as to render the content corresponding to the target page into the game page corresponding to the target display level.
Optionally, the apparatus further comprises:
the first creating module is used for creating a display page corresponding to the target page if the display mode is a full page mode and the target page is a 3D page;
the first processing module is used for creating a target view for displaying the content of the open graphical interface and mounting the target view to a root view of the display page;
and the second rendering module is used for rendering in the target view based on the code file to obtain the target page.
Optionally, the apparatus further comprises:
a second creating module, configured to create a display window for the target page if the display mode is a window mode and the target page is a 3D page;
a third determining module, configured to use a root view of the display window as a Content attribute of the display window;
the second processing module is used for creating a target view for displaying the content of the open graphic interface and mounting the target view to the root view of the display window;
and the third rendering module is used for rendering in the target view based on the code file to obtain the target page.
Optionally, the apparatus further comprises:
a first obtaining module, configured to obtain a page configuration file before the first determining module determines the display mode of the target page, where the page configuration file includes a page identifier of the target page and the display mode of the target page;
the first determination module is further to:
and inquiring the page configuration file according to the page identification of the target page, and determining the display mode in the inquired result as the display mode of the target page.
Optionally, the cross-platform development framework is a ReactNative framework platform, and a three. Js framework and a read-three-fiber framework are introduced into a JSI framework of the ReactNative framework platform, so that the code file of the target page is rendered based on an open graphical interface.
Referring now to FIG. 6, a block diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a code file of a target page to be rendered in a target game, wherein the code file is a code realized based on a cross-platform development framework; determining a display mode of the target page; if the display mode of the target page is a mixed sorting mode, generating a texture identifier corresponding to the target page; determining a target display level corresponding to the texture identifier in the target game based on the texture identifier; and in a game page corresponding to the target display level in the target game, rendering content corresponding to the target page based on a game rendering engine and the texture identifier.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of the module does not constitute a limitation to the module itself in some cases, for example, the first obtaining module may also be described as a module for obtaining a code file of a target page to be rendered in a target game.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Example 1 provides a page rendering method according to one or more embodiments of the present disclosure, wherein the method includes:
acquiring a code file of a target page to be rendered in a target game, wherein the code file is a code realized based on a cross-platform development framework;
determining a display mode of the target page;
if the display mode of the target page is a mixed sorting mode, generating a texture identifier corresponding to the target page;
determining a target display level corresponding to the texture identifier in the target game based on the texture identifier;
and in the target game and in a game page corresponding to the target display level, rendering content corresponding to the target page based on a game rendering engine and the texture identifier.
Example 2 provides the method of example 1, wherein the determining, in the target game based on the texture identifier, a target display level corresponding to the texture identifier includes:
and sending the texture identifier and the page identifier of the target page to the target game, so that the target game determines the display level corresponding to the page identifier as the target display level corresponding to the texture identifier.
Example 3 provides the method of example 1, where the rendering, in a game page corresponding to the target display hierarchy in the target game, content corresponding to the target page based on a game rendering engine and the texture identifier includes:
determining a target code corresponding to the page content of the target page from the code file according to the texture identifier;
and rendering the target code through an open graphic interface corresponding to the game rendering engine so as to render the content corresponding to the target page into the game page corresponding to the target display level.
Example 4 provides the method of example 1, wherein the method further comprises, in accordance with one or more embodiments of the present disclosure:
if the display mode is a full page mode and the target page is a 3D page, creating a display page corresponding to the target page;
creating a target view for displaying the content of the open graphic interface and mounting the target view to a root view of the display page;
and rendering is carried out in the target view based on the code file, and the target page is obtained.
Example 5 provides the method of example 1, wherein the method further comprises, in accordance with one or more embodiments of the present disclosure:
if the display mode is a window mode and the target page is a 3D page, establishing a display window aiming at the target page;
taking the root view of the display window as the Content attribute of the display window;
creating a target view for displaying contents of an open graphical interface and mounting the target view to a root view of the display window;
and rendering is carried out in the target view based on the code file, and the target page is obtained.
Example 6 provides the method of example 1, wherein, prior to the determining the display mode of the target page, the method further comprises:
acquiring a page configuration file, wherein the page configuration file comprises a page identifier of the target page and a display mode of the target page;
the determining the display mode of the target page comprises:
and inquiring the page configuration file according to the page identification of the target page, and determining the display mode in the inquired result as the display mode of the target page.
Example 7 provides the method of example 1, wherein the cross-platform development framework is a ReactNative framework platform, and a three. Js framework and a React-three-fiber framework are introduced into a JSI framework of the ReactNative framework platform, so that the code file of the target page is rendered based on an open graphics interface.
Example 8 provides a page rendering apparatus, in accordance with one or more embodiments of the present disclosure, wherein the apparatus comprises:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a code file of a target page to be rendered in a target game, and the code file is a code realized based on a cross-platform development framework;
the first determining module is used for determining the display mode of the target page;
the generating module is used for generating a texture identifier corresponding to the target page if the display mode of the target page is a mixed sorting mode;
a second determining module, configured to determine, in the target game, a target display level corresponding to the texture identifier based on the texture identifier;
and the first rendering module is used for rendering the content corresponding to the target page in the target game and the game page corresponding to the target display level based on a game rendering engine and the texture identifier.
Example 9 provides a computer readable medium having stored thereon a computer program that, when executed by a processing apparatus, performs the steps of the method of any of examples 1-7, in accordance with one or more embodiments of the present disclosure.
Example 10 provides, in accordance with one or more embodiments of the present disclosure, an electronic device comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method of any of examples 1-7.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and the technical features disclosed in the present disclosure (but not limited to) having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims (10)

1. A method for rendering a page, the method comprising:
acquiring a code file of a target page to be rendered in a target game, wherein the code file is a code realized based on a cross-platform development framework;
determining a display mode of the target page;
if the display mode of the target page is a mixed sorting mode, generating a texture identifier corresponding to the target page;
determining a target display level corresponding to the texture identifier in the target game based on the texture identifier;
and in a game page corresponding to the target display level in the target game, rendering content corresponding to the target page based on a game rendering engine and the texture identifier.
2. The method of claim 1, wherein determining a target display level in the target game corresponding to the texture identifier based on the texture identifier comprises:
and sending the texture identifier and the page identifier of the target page to the target game so that the target game determines the display level corresponding to the page identifier as the target display level corresponding to the texture identifier.
3. The method of claim 1, wherein rendering content corresponding to the target page in the target game in a game page corresponding to the target display level based on a game rendering engine and the texture identifier comprises:
determining a target code corresponding to the page content of the target page from the code file according to the texture identifier;
and rendering the target code through an open graphic interface corresponding to the game rendering engine so as to render the content corresponding to the target page into the game page corresponding to the target display level.
4. The method of claim 1, further comprising:
if the display mode is a full page mode and the target page is a 3D page, creating a display page corresponding to the target page;
creating a target view for displaying the content of the open graphical interface and mounting the target view to a root view of the display page;
and rendering is carried out in the target view based on the code file, and the target page is obtained.
5. The method of claim 1, further comprising:
if the display mode is a window mode and the target page is a 3D page, creating a display window for the target page;
taking the root view of the display window as the Content attribute of the display window;
creating a target view for displaying the content of the open graphical interface and mounting the target view to a root view of the display window;
and rendering is carried out in the target view based on the code file, and the target page is obtained.
6. The method of claim 1, wherein prior to the step of determining the display mode of the target page, the method further comprises:
acquiring a page configuration file, wherein the page configuration file comprises a page identifier of the target page and a display mode of the target page;
the determining the display mode of the target page comprises:
and inquiring the page configuration file according to the page identifier of the target page, and determining the display mode in the inquired result as the display mode of the target page.
7. The method according to claim 1, wherein the cross-platform development framework is a ReactNative framework platform, and a thread js framework and a real-thread fiber framework are introduced into a JSI framework of the ReactNative framework platform, so that the code file of the target page is rendered based on an open graphics interface.
8. An apparatus for rendering a page, the apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a code file of a target page to be rendered in a target game, and the code file is a code realized based on a cross-platform development framework;
the first determining module is used for determining the display mode of the target page;
the generating module is used for generating a texture identifier corresponding to the target page if the display mode of the target page is a mixed sorting mode;
a second determining module, configured to determine, in the target game, a target display level corresponding to the texture identifier based on the texture identifier;
and the first rendering module is used for rendering the content corresponding to the target page in the target game and the game page corresponding to the target display level based on a game rendering engine and the texture identifier.
9. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the steps of the method of any one of claims 1 to 7.
10. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method according to any one of claims 1 to 7.
CN202211679013.7A 2022-12-26 2022-12-26 Page rendering method, device, medium and electronic equipment Pending CN115878115A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211679013.7A CN115878115A (en) 2022-12-26 2022-12-26 Page rendering method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211679013.7A CN115878115A (en) 2022-12-26 2022-12-26 Page rendering method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115878115A true CN115878115A (en) 2023-03-31

Family

ID=85755583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211679013.7A Pending CN115878115A (en) 2022-12-26 2022-12-26 Page rendering method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115878115A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627402A (en) * 2023-07-19 2023-08-22 云筑信息科技(成都)有限公司 Method for realizing custom component configuration in low-code platform based on React

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627402A (en) * 2023-07-19 2023-08-22 云筑信息科技(成都)有限公司 Method for realizing custom component configuration in low-code platform based on React
CN116627402B (en) * 2023-07-19 2023-10-20 云筑信息科技(成都)有限公司 Method for realizing custom component configuration in low-code platform based on React

Similar Documents

Publication Publication Date Title
CN110046021B (en) Page display method, device, system, equipment and storage medium
CN110380955B (en) Message processing method and device and electronic equipment
CN111949358A (en) Dynamic display method, device, readable medium and electronic equipment
CN110058854B (en) Method, terminal device and computer-readable medium for generating application
CN115878115A (en) Page rendering method, device, medium and electronic equipment
CN111796825B (en) Bullet screen drawing method, bullet screen drawing device, bullet screen drawing equipment and storage medium
CN111580883B (en) Application program starting method, device, computer system and medium
CN113391811B (en) Function compiling method, function compiling device, electronic equipment and computer readable storage medium
CN112492399B (en) Information display method and device and electronic equipment
CN112148744A (en) Page display method and device, electronic equipment and computer readable medium
CN111324376A (en) Function configuration method and device, electronic equipment and computer readable medium
CN116320654A (en) Message display processing method, device, equipment and medium
CN110618811A (en) Information presentation method and device
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN111199519B (en) Method and device for generating special effect package
CN114489891A (en) Control method, system, device, readable medium and equipment of cloud application program
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN110618772B (en) View adding method, device, equipment and storage medium
CN111240657A (en) Method and device for generating SDK and electronic equipment
CN114357348B (en) Display method and device and electronic equipment
CN115250259B (en) Information interaction method and device and electronic equipment
CN115988255A (en) Special effect generation method and device, electronic equipment and storage medium
CN116801008A (en) Media information material processing method and device, electronic equipment and storage medium
CN111429585A (en) Image generation method and device, electronic equipment and computer readable storage medium
CN117743705A (en) Page display method, device, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination