Animation display control method, device, equipment, medium and program product
By rendering and updating only when the target object's scrolling distance reaches a preset value during animation display, the power consumption problem caused by frequent animation rendering is solved, and efficient resource utilization is achieved.
Patent Information
- Application Number
- CN202411397241.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-10-08
AI Technical Summary
In the prior art, frequent rendering and updating of animations results in large power consumption and reduces resource utilization.
By obtaining the current scrolling progress of the target object, the current scrolling distance is determined based on the current scrolling progress, the scrolling progress at the time of the last rendering update, and the object length information, and rendering updates are performed when the distance is greater than or equal to the preset distance to reduce invalid rendering.
The number of animation rendering updates is reduced, which reduces power consumption and improves resource utilization.
Smart Images

Figure CN119356584B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to computer technology, and in particular to an animation display control method, apparatus, device, medium, and program product. Background Art
[0002] With the rapid development of computer technology, animations with scrolling effects can be displayed on display interfaces, thereby enriching the animation display effect. Currently, animations are usually rendered and updated every fixed time, such as automatically refreshing every 0.00001 seconds. However, in the process of implementing the present disclosure, it was found that the existing technology has at least the following problems:
[0003] Since animation requires a large number of frequent rendering updates, it will lead to greater power consumption and reduce resource utilization. Summary of the Invention
[0004] The present disclosure provides an animation display control method, apparatus, device, medium and program product to reduce the number of animation rendering updates, thereby reducing power consumption and improving resource utilization.
[0005] In a first aspect, an embodiment of the present disclosure provides an animation display control method, comprising:
[0006] In response to the display of the target animation, obtaining a current scrolling progress of the target object, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner;
[0007] Determine a current scrolling distance of the target object from the current scrolling distance at the time of the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update, and the length information of the target object;
[0008] In response to the current scrolling distance being greater than or equal to a preset scrolling distance, the target object is rendered and updated so that the target object scrolls the current scrolling distance on the display interface.
[0009] In a second aspect, the present disclosure further provides an animation display control device, comprising:
[0010] a current scrolling progress acquisition module, configured to acquire the current scrolling progress of a target object in response to display of a target animation, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner;
[0011] a current scrolling distance determining module, configured to determine a current scrolling distance of the target object from the current scrolling distance of the target object to the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the last rendering update, and the length information of the target object;
[0012] The target object rendering and updating module is configured to update the rendering of the target object in response to the current scrolling distance being greater than or equal to a preset scrolling distance, so that the target object scrolls the current scrolling distance on the display interface.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the animation display control method as described in any one of the embodiments of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute the animation display control method as described in any one of the embodiments of the present disclosure.
[0018] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the animation display control method as described in any one of the embodiments of the present disclosure.
[0019] In an embodiment of the present disclosure, the current scrolling progress of the target object is obtained in response to the display of the target animation, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner; based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update, and the length information of the target object, the current scrolling distance of the target object from the time of the last rendering update is determined; when the current scrolling distance is greater than or equal to the preset scrolling distance, the target object is rendered and updated, so that the target object scrolls the current scrolling distance on the display interface, thereby ensuring that the target object scrolls a larger distance on the display interface during two adjacent rendering updates, avoiding the situation of invalid rendering updates when the scrolling distance is small, thereby reducing the number of rendering updates of the animation, reducing power consumption, and improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 This is a flow chart of an animation display control method provided by an embodiment of the present disclosure;
[0022] Figure 2 is a flowchart of another animation display control method provided by an embodiment of the present disclosure;
[0023] Figure 3 This is a flow chart of another animation display control method provided by an embodiment of the present disclosure;
[0024] Figure 4 It is a structural diagram of an animation display control device provided by an embodiment of the present disclosure;
[0025] Figure 5 It is a structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0028] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "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," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0029] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] Figure 1 This is a flow chart of an animation display control method provided in an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to situations where the rendering update of a scrolling animation is effectively controlled. The method can be executed by an animation display control device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0033] like Figure 1 As shown, the animation display control method specifically includes the following steps:
[0034] S110 . In response to display of a target animation, obtain a current scrolling progress of a target object, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner.
[0035] Among them, the target animation refers to the animation with a scrolling effect that needs to be displayed at present. For example, the target animation may refer to a marquee animation. The target object refers to the display content of the target animation. The target object may be composed of at least one of elements such as text, pattern and list. For example, the target object may be a copy or a table, etc. The target object is periodically displayed in a scrolling manner, thereby forming a target animation. The scrolling method means that only part of the content of the target object is displayed each time, and the displayed content is updated and changed over time, so as to achieve the scrolling display effect of the target object. The cyclic display refers to the display of two adjacent target objects end to end, so as to achieve multiple displays of the target object, and the complete display process of a target object corresponds to a cyclic process.
[0036] Among them, the current scrolling progress refers to the latest scrolling progress of the target object at the current moment. The current scrolling progress is dynamically updated over time, so that the displayed part of the target object can be dynamically updated. For example, the scrolling progress can be a progress from 0% to 100%. A scrolling progress of 0% corresponds to the part of the content that the target object first starts to display. A scrolling progress of 100% corresponds to the part of the content that the target object displays last. The current scrolling progress can be used to characterize the part of the content that the target object currently needs to display. It should be noted that the current scrolling progress is a variable that is dynamically updated over time and is controlled by the backend. It controls the progress to be displayed that the target object currently needs to display on the display interface, and is not the displayed progress that the target object currently displays on the display interface.
[0037] Specifically, the target animation is started on the display interface. For example, in response to the target animation display trigger operation, the target object is rendered for the first time, thereby displaying a portion of the target object's content on the display interface for the first time. After the target animation is rendered for the first time, the current scrolling progress of the target object can be obtained by calling the custom animation class control ValueAnimator. The custom animation class control is used to control the update of the target object's scrolling progress.
[0038] S120 : Determine a current scrolling distance of the target object from the current scrolling distance at the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the last rendering update, and the length information of the target object.
[0039] Among them, the scrolling progress of the target object at the time of the last rendering update can be used to characterize the partial content displayed by the target object at the time of the last rendering update. The length information of the target object may refer to the complete length information of the target object itself, that is, the length information of all the contents of the target object. The length information of the target object can be characterized by the number of pixels of the interface, such as taking the number of pixels occupied by a complete target object as the length information of the target object. The current scrolling distance may refer to the distance that the target object should scroll from the time of the last rendering update. For example, the current scrolling distance may refer to the distance between the position where the target object should be displayed and the position actually displayed at the time of the last rendering update. The current scrolling distance may also refer to the distance that the target object moves from the time of the last rendering update.
[0040] Specifically, based on the current scrolling progress of the target object, the scrolling progress at the last rendering update, and the length information of the target object, the current scrolling distance that the target object should scroll from the last rendering update can be detected in real time, and the current scrolling distance of the target object from the last rendering update can be accurately obtained.
[0041] S130: In response to the current scrolling distance being greater than or equal to the preset scrolling distance, rendering and updating the target object so that the target object scrolls the current scrolling distance on the display interface.
[0042] The preset scroll distance may refer to a pre-set minimum scroll distance for triggering a rendering update. For example, the preset scroll distance may be determined based on a minimum distance discernible to the naked eye. For example, the preset scroll distance may be greater than or equal to the minimum distance discernible to the naked eye, so that the naked eye can perceive changes in the position of the target object after each rendering update, thereby ensuring effective rendering updates. For example, the preset scroll distance may be set to 1 pixel, so that a rendering update is triggered only when the target object is scrolled at least 1 pixel.
[0043] Specifically, by detecting whether the current scrolling distance is greater than or equal to the preset scrolling distance, it is possible to determine whether the rendering update of the target object is currently triggered, thereby ensuring the effective rendering of the target animation. When the current scrolling distance is greater than or equal to the preset scrolling distance, the current rendering update of the target object is triggered, so that the target object scrolls the current scrolling distance on the display interface. Since the current scrolling distance is greater than or equal to the preset scrolling distance, the user can clearly observe the position movement of the target object on the display interface, and each rendering update is effective and meaningful. When the current scrolling distance is less than the preset scrolling distance, the rendering update of the target object will not be triggered, thereby avoiding the situation of invalid rendering updates when the scrolling distance is small, thereby reducing the number of rendering updates of the animation, reducing power consumption, and improving resource utilization.
[0044] Exemplarily, in response to the current scrolling distance being less than the preset scrolling distance, the process returns to executing the operation of obtaining the current scrolling progress of the target object in step S110 .
[0045] Specifically, when it is detected that the current scrolling distance is less than the preset scrolling distance, the current scrolling progress of the target object can be retrieved, and the above steps S120-S130 can be repeated based on the retrieved current scrolling progress to determine whether to trigger the next rendering update of the target object, thereby achieving effective control of the rendering update, so that the number of rendering updates of the target object can be effectively reduced during the entire display process of the target animation, avoiding invalid rendering updates, and greatly reducing power consumption.
[0046] The technical solution of the embodiment of the present disclosure obtains the current scrolling progress of the target object in response to the display of the target animation, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner; based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update, and the length information of the target object, the current scrolling distance of the target object from the time of the last rendering update is determined; when the current scrolling distance is greater than or equal to the preset scrolling distance, the target object is rendered and updated, so that the target object scrolls the current scrolling distance on the display interface, thereby ensuring that the target object scrolls a larger distance on the display interface during two adjacent rendering updates, avoiding the situation of invalid rendering updates when the scrolling distance is small, thereby reducing the number of rendering updates of the animation, reducing power consumption, and improving resource utilization.
[0047] Figure 2This is a flowchart of another animation display control method provided by an embodiment of the present disclosure. Building on the previously disclosed embodiments, this embodiment further describes the process of determining the current scroll distance of a target object from the time of the last rendering update. Explanations of terms that are identical or corresponding to those in the previously disclosed embodiments are omitted here.
[0048] like Figure 2 As shown, the animation display control method specifically includes the following steps:
[0049] S210 . In response to the display of the target animation, obtain the current scrolling progress of the target object, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner.
[0050] S220: Determine a change in the current progress from the last rendering update to the current scrolling progress based on the current scrolling progress and the scrolling progress of the target object at the last rendering update.
[0051] The current progress change may refer to the change between the current scrolling progress and the scrolling progress at the last rendering update. The current progress change may be used to represent the degree of movement between the current position to be displayed and the display position at the last rendering update.
[0052] For example, the current progress change from the last rendering update can be determined by at least two of the following implementations:
[0053] As an implementation method, step S220 may include: subtracting the scrolling progress of the target object at the time of the last rendering update from the current scrolling progress, and obtaining the difference as the change in the current progress from the current distance to the time of the last rendering update; wherein, when the current scrolling distance is less than the preset scrolling distance and the current scrolling progress is the maximum scrolling progress, the scrolling progress of the target object at the time of the last rendering update is updated to the minimum scrolling progress.
[0054] The maximum scrolling progress may refer to the maximum value that the scrolling progress can achieve, such as 100%, and the minimum scrolling progress may refer to the minimum value that the scrolling progress can achieve, such as 0%.
[0055] Specifically, when the current scrolling distance is less than the preset scrolling distance and the current scrolling progress is the maximum scrolling progress, it indicates that the rendering update of the target object will not be triggered at present, and when the current loop ends, it will immediately enter the next loop, that is, the scrolling progress will start to change from the minimum scrolling progress. At this time, it is necessary to reset the scrolling progress of the target object at the time of the last rendering update to the minimum scrolling progress, so as to ensure that the current scrolling distance obtained next time is always greater than or equal to the scrolling progress at the time of the last rendering update, and then the difference obtained by subtracting the scrolling progress at the time of the last rendering update from the current scrolling progress can be directly used as the current progress change.
[0056] As another implementation, step S220 may include: in response to the current scrolling progress and the scrolling progress of the target object at the time of the last rendering update being in the same cycle, subtracting the scrolling progress of the target object at the time of the last rendering update from the current scrolling progress, and using the obtained difference as the current progress change from the time of the last rendering update;
[0057] In response to the current scrolling progress and the scrolling progress of the target object at the last rendering update being in different cycles, the remaining scrolling progress of the last cycle is determined based on the scrolling progress of the target object at the last rendering update and the maximum scrolling progress, and the change in the current progress from the last rendering update is determined based on the current scrolling progress and the remaining scrolling progress.
[0058] Specifically, by detecting whether the current scrolling progress and the scrolling progress at the last rendering update are within the same cycle, the specific method for calculating the current progress change can be determined. For example, if the current scrolling progress and the scrolling progress at the last rendering update are within the same cycle, it indicates that the current scrolling progress is greater than the scrolling progress at the last rendering update. Therefore, the difference obtained by subtracting the scrolling progress at the last rendering update from the current scrolling progress can be directly used as the current progress change. When the current scrolling progress and the scrolling progress at the last rendering update are in different cycles, it indicates that the scrolling progress at the last rendering update was the scrolling progress within the last cycle. When the current scrolling progress obtained this time is the scrolling progress within the current cycle, the current scrolling progress may be smaller than the scrolling progress at the last rendering update. To this end, the difference obtained by subtracting the scrolling progress at the last rendering update from the maximum scrolling progress can be used as the remaining scrolling progress of the last cycle, and the current scrolling progress and the remaining scrolling progress can be added together, and the obtained addition result is used as the current progress change. Therefore, when rendering across cycles, by taking into account the remaining scrolling progress of the last cycle, the current progress change from the last rendering update can be more accurately determined, so that the position change of the target object on the display interface can be more uniform.
[0059] S230: Determine a current scrolling distance of the target object from the last rendering update based on the current progress change and the length information of the target object.
[0060] Specifically, the current progress change amount and the length information of the target object may be multiplied, and the obtained multiplication result is used as the current scrolling distance of the target object from the last rendering update.
[0061] Exemplarily, step S230 may include: determining the total length information of the target object based on the length information of the target object and the gap distance between two adjacent target objects; and determining the current scrolling distance of the target object from the last rendering update based on the current progress change and the total length information.
[0062] The gap distance between two adjacent target objects may refer to the gap interval when the two adjacent target objects are connected end to end during the cyclic display. The total length information of the target objects may refer to the complete length information of one cycle of the target objects.
[0063] Specifically, in addition to displaying the complete content of the target object itself, the gap content between two adjacent target objects is also displayed in a loop. The total length of the target object is obtained by adding the length information of the target object and the gap distance between the two adjacent target objects. The current progress change and the total length information are multiplied to obtain the current scroll distance of the target object from the last rendering update. By considering the gap distance between two adjacent target objects, the current scroll distance from the last rendering update can be more accurately determined, thereby further improving the accuracy of animation display control.
[0064] S240: In response to the current scrolling distance being greater than or equal to the preset scrolling distance, the target object is rendered and updated so that the target object scrolls the current scrolling distance on the display interface.
[0065] The technical solution of the embodiment of the present disclosure determines the current progress change from the current time to the last rendering update based on the current scrolling progress and the scrolling progress of the target object at the last rendering update, and based on the current progress change and the length information of the target object, can accurately determine the current scrolling distance of the target object from the current time to the last rendering update, thereby improving the accuracy of animation display control, avoiding high-frequency rendering updates, and reducing power consumption.
[0066] Figure 3 This is a flowchart of another animation display control method provided by an embodiment of the present disclosure. Building on the previously disclosed embodiments, this embodiment provides a detailed description of the control process when the visible state of a target animation changes. Explanations of terms that are identical or corresponding to those in the previously disclosed embodiments are omitted here.
[0067] like Figure 3 As shown, the animation display control method specifically includes the following steps:
[0068] S310 . In response to the display of the target animation, obtain the current scrolling progress of the target object, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner.
[0069] S320: Determine the current scrolling distance of the target object from the current scrolling distance at the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the last rendering update, and the length information of the target object.
[0070] S330: In response to the current scrolling distance being greater than or equal to the preset scrolling distance, the target object is rendered and updated so that the target object scrolls the current scrolling distance on the display interface.
[0071] S340 : In response to the target animation being switched from the visible state to the invisible state, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object.
[0072] The visible state refers to a state in which the user can view the target animation, and the invisible state refers to a state in which the user cannot view the target animation.
[0073] Specifically, during the display of the target animation, the visible state changes of the target animation can be detected in real time. For example, when it is detected that the displayed target animation switches from a visible state to an invisible state, it indicates that the user cannot currently view the target animation. At this time, the scrolling progress of the target object can be stopped from updating by pausing the playback of the ValueAnimator. In other words, the current scrolling progress of the target object no longer changes, and the rendering update of the target object will also be stopped, thereby pausing the playback of the target animation. By stopping the rendering update of the target object when the target animation switches from a visible state to an invisible state, the number of rendering updates can be further reduced, further reducing power consumption.
[0074] Exemplarily, step S340 may include at least one of the following:
[0075] In response to the display control of the target animation being switched from a display state to a hidden state, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object;
[0076] In response to switching from the target animation display page to another page, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object;
[0077] In response to the display of the target animation, the client enters a background state, stops updating the scrolling progress of the target object, and stops rendering and updating the target object.
[0078] The display control refers to a control used to display the target animation. The display page refers to the interface used to display the target animation. Other pages refer to pages other than the display page. The display client may refer to an application APP used to display the target animation. The background state may refer to the state in which the display client is running in the background, not in the foreground.
[0079] Specifically, when the display control of the target animation switches from a display state to a hidden state, when the display page of the target animation switches to other pages, or when the display client of the target animation enters a background state, the target animation will switch from a visible state to an invisible state. In these cases, the target object's scrolling progress and rendering drawing will be stopped, thereby further avoiding invalid rendering updates, reducing the number of rendering updates, and further reducing power consumption.
[0080] Exemplarily, in response to the target animation switching from the invisible state to the visible state, the scrolling progress of the target object continues to be updated, and rendering update of the target object is allowed.
[0081] Specifically, in the process of displaying the target animation, the changes in the visible state of the target animation can be detected in real time. For example, when it is detected that the displayed target animation switches from a non-visible state to a visible state, it indicates that the user can currently watch the target animation. At this time, the scrolling progress of the target object can be continued to be updated on the original basis by continuing to play the ValueAnimator, and when the rendering update trigger condition is met (such as the current scrolling distance is greater than or equal to the preset scrolling distance), the rendering update of the target object can also be allowed to continue playing the target animation. By continuing to update the scrolling progress of the target object when the target animation switches from a non-visible state to a visible state, and allowing the target object to be rendered and updated, the playback of the target animation is restored, thereby reducing the power consumption of animation rendering and improving resource utilization without affecting the animation viewing experience.
[0082] For example, in response to the display control of the target animation switching from a hidden state to a displayed state, the scrolling progress of the target object continues to be updated, and the target object is allowed to be rendered and updated; in response to switching from other pages to the display page of the target animation, the scrolling progress of the target object continues to be updated, and the target object is allowed to be rendered and updated; in response to the display client of the target animation entering the foreground state from the background state, the scrolling progress of the target object continues to be updated, and the target object is allowed to be rendered and updated.
[0083] The technical solution of the embodiment of the present disclosure stops updating the scrolling progress of the target object and stops rendering and updating the target object in response to the target animation switching from a visible state to an invisible state, thereby further avoiding invalid rendering updates, reducing the number of rendering updates, further reducing power consumption, and improving resource utilization.
[0084] Figure 4 This is a structural diagram of an animation display control device provided by an embodiment of the present disclosure, such as Figure 4As shown, the device specifically includes: a current scrolling progress acquisition module 410 , a current scrolling distance determination module 420 and a target object rendering update module 430 .
[0085] Among them, the current scrolling progress acquisition module 410 is used to obtain the current scrolling progress of the target object in response to the display of the target animation, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner; the current scrolling distance determination module 420 is used to determine the current scrolling distance of the target object from the current distance of the target object to the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update and the length information of the target object; the target object rendering update module 430 is used to render and update the target object in response to the current scrolling distance being greater than or equal to the preset scrolling distance, so that the target object scrolls the current scrolling distance on the display interface.
[0086] The technical solution provided by the embodiment of the present disclosure obtains the current scrolling progress of the target object in response to the display of the target animation, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner; based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update, and the length information of the target object, the current scrolling distance of the target object from the time of the last rendering update is determined; when the current scrolling distance is greater than or equal to the preset scrolling distance, the target object is rendered and updated, so that the target object scrolls the current scrolling distance on the display interface, thereby ensuring that the target object scrolls a larger distance on the display interface during two adjacent rendering updates, avoiding the situation of invalid rendering updates when the scrolling distance is small, thereby reducing the number of rendering updates of the animation, reducing power consumption, and improving resource utilization.
[0087] Based on the above technical solution, the current scroll distance determination module 420 includes:
[0088] a current progress change amount determining unit, configured to determine a current progress change amount from the current time to the last rendering update based on the current scrolling progress and the scrolling progress of the target object at the last rendering update;
[0089] The current scrolling distance determining unit is configured to determine a current scrolling distance of the target object from the last rendering update based on the current progress change and the length information of the target object.
[0090] Based on the above technical solutions, the current progress change determination unit is specifically used to:
[0091] The current scrolling progress is subtracted from the scrolling progress of the target object at the time of the last rendering update, and the difference obtained is used as the current progress change from the current distance to the time of the last rendering update; wherein, when the current scrolling distance is less than the preset scrolling distance and the current scrolling progress is the maximum scrolling progress, the scrolling progress of the target object at the time of the last rendering update is updated to the minimum scrolling progress.
[0092] Based on the above technical solutions, the current progress change determination unit is specifically used to:
[0093] In response to the current scrolling progress and the scrolling progress of the target object at the last rendering update being in the same cycle, the scrolling progress of the target object at the last rendering update is subtracted from the current scrolling progress, and the difference obtained is used as the current progress change from the last rendering update; in response to the current scrolling progress and the scrolling progress of the target object at the last rendering update being in different cycles, the remaining scrolling progress of the last cycle is determined based on the scrolling progress of the target object at the last rendering update and the maximum scrolling progress, and the current progress change from the last rendering update is determined based on the current scrolling progress and the remaining scrolling progress.
[0094] Based on the above technical solutions, the current scroll distance determination unit is specifically configured to:
[0095] Based on the length information of the target object and the gap distance between two adjacent target objects, the total length information of the target object is determined; based on the current progress change and the total length information, the current scrolling distance of the target object from the last rendering update is determined.
[0096] On the basis of the above technical solutions, the device also includes:
[0097] a return execution module, configured to return to the step of obtaining the current scrolling progress of the target object in response to the current scrolling distance being less than the preset scrolling distance;
[0098] The preset scrolling distance is determined based on the minimum distance that can be distinguished by the naked eye.
[0099] On the basis of the above technical solutions, the device also includes:
[0100] The update stopping module is configured to stop updating the scrolling progress of the target object and stop rendering and updating the target object in response to the target animation switching from the visible state to the invisible state.
[0101] Based on the above technical solutions, the update stop module is specifically used for at least one of the following:
[0102] In response to the display control of the target animation being switched from a display state to a hidden state, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object;
[0103] In response to switching from the display page of the target animation to another page, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object;
[0104] In response to the target animation display client entering a background state, the updating of the scrolling progress of the target object is stopped, and rendering and updating of the target object is stopped.
[0105] On the basis of the above technical solutions, the device also includes:
[0106] The update recovery module is used for continuing to update the scrolling progress of the target object in response to the target animation switching from the invisible state to the visible state, and allowing the target object to be rendered and updated.
[0107] The animation display control device provided in the embodiments of the present disclosure can execute the animation display control method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0108] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0109] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 5 , which shows an electronic device (eg Figure 5 The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0110] like Figure 5As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0111] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0112] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0113] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0114] The electronic device provided by the embodiment of the present disclosure and the animation display control method provided by the above embodiment belong to the same inventive concept. Technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0115] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the animation display control method provided in the above embodiment is implemented.
[0116] It should be noted that the computer-readable medium mentioned above in the present disclosure may 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 electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0117] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0118] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0119] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the current scrolling progress of the target object in response to the display of the target animation, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner; determines the current scrolling distance of the target object from the current scrolling distance at the time of the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update, and the length information of the target object; and renders and updates the target object in response to the current scrolling distance being greater than or equal to the preset scrolling distance, so that the target object scrolls the current scrolling distance on the display interface.
[0120] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0121] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the animation display control method provided in the above embodiment when executed by a processor.
[0122] The computer program product may be implemented by writing computer program code for performing the operations of the present invention in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0124] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0125] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and 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 chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0126] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0127] According to one or more embodiments of the present disclosure, [Example 1] provides an animation display control method, including:
[0128] In response to the display of the target animation, obtaining a current scrolling progress of the target object, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner;
[0129] Determine a current scrolling distance of the target object from the current scrolling distance at the time of the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update, and the length information of the target object;
[0130] In response to the current scrolling distance being greater than or equal to a preset scrolling distance, the target object is rendered and updated so that the target object scrolls the current scrolling distance on the display interface.
[0131] According to one or more embodiments of the present disclosure, [Example 2] provides an animation display control method, further comprising:
[0132] Optionally, determining the current scrolling distance of the target object from the time of the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update, and the length information of the target object includes:
[0133] Determine a change in the current progress from the last rendering update based on the current scrolling progress and the scrolling progress of the target object at the last rendering update;
[0134] A current scrolling distance of the target object from the last rendering update is determined based on the current progress change and the length information of the target object.
[0135] According to one or more embodiments of the present disclosure, [Example 3] provides an animation display control method, further comprising:
[0136] Optionally, determining a change in the current progress from the last rendering update based on the current scrolling progress and the scrolling progress of the target object at the last rendering update includes:
[0137] Subtract the scrolling progress of the target object at the time of the last rendering update from the current scrolling progress, and obtain the difference as the current progress change from the current time to the last rendering update;
[0138] Wherein, when the current scrolling distance is less than the preset scrolling distance and the current scrolling progress is the maximum scrolling progress, the scrolling progress of the target object at the time of the last rendering update is updated to the minimum scrolling progress.
[0139] According to one or more embodiments of the present disclosure, [Example 4] provides an animation display control method, further comprising:
[0140] Optionally, determining a change in the current progress from the last rendering update based on the current scrolling progress and the scrolling progress of the target object at the last rendering update includes:
[0141] In response to the current scrolling progress and the scrolling progress of the target object at the last rendering update being in the same cycle, subtracting the scrolling progress of the target object at the last rendering update from the current scrolling progress, and using the obtained difference as the current progress change from the last rendering update;
[0142] In response to the current scrolling progress and the scrolling progress of the target object at the last rendering update being in different cycles, the remaining scrolling progress of the last cycle is determined based on the scrolling progress of the target object at the last rendering update and the maximum scrolling progress, and the change in the current progress from the last rendering update is determined based on the current scrolling progress and the remaining scrolling progress.
[0143] According to one or more embodiments of the present disclosure, [Example 5] provides an animation display control method, further comprising:
[0144] Optionally, determining a current scroll distance of the target object from the last rendering update based on the current progress change and the length information of the target object includes:
[0145] Determining the total length information of the target objects based on the length information of the target objects and the gap distance between two adjacent target objects;
[0146] A current scrolling distance of the target object from the last rendering update is determined based on the current progress change and the total length information.
[0147] According to one or more embodiments of the present disclosure, [Example 6] provides an animation display control method, further comprising:
[0148] Optionally, the method further includes:
[0149] In response to the current scrolling distance being less than the preset scrolling distance, returning to the step of obtaining the current scrolling progress of the target object;
[0150] The preset scrolling distance is determined based on the minimum distance that can be distinguished by the naked eye.
[0151] According to one or more embodiments of the present disclosure, [Example 7] provides an animation display control method, further comprising:
[0152] Optionally, the method further includes:
[0153] In response to the target animation being switched from a visible state to a non-visible state, updating the scrolling progress of the target object is stopped, and rendering and updating of the target object is stopped.
[0154] According to one or more embodiments of the present disclosure, [Example 8] provides an animation display control method, further comprising:
[0155] Optionally, in response to the target animation switching from a visible state to a non-visible state, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object include at least one of the following:
[0156] In response to the display control of the target animation being switched from a display state to a hidden state, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object;
[0157] In response to switching from the display page of the target animation to another page, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object;
[0158] In response to the target animation display client entering a background state, the updating of the scrolling progress of the target object is stopped, and rendering and updating of the target object is stopped.
[0159] According to one or more embodiments of the present disclosure, [Example 9] provides an animation display control method, further comprising:
[0160] Optionally, the method further includes:
[0161] In response to the target animation being switched from the invisible state to the visible state, the scrolling progress of the target object continues to be updated, and rendering update of the target object is allowed.
[0162] According to one or more embodiments of the present disclosure, [Example 10] provides an animation display control device, including:
[0163] a current scrolling progress acquisition module, configured to acquire the current scrolling progress of a target object in response to display of a target animation, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner;
[0164] a current scrolling distance determining module, configured to determine a current scrolling distance of the target object from the current scrolling distance of the target object to the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the last rendering update, and the length information of the target object;
[0165] The target object rendering and updating module is configured to update the rendering of the target object in response to the current scrolling distance being greater than or equal to a preset scrolling distance, so that the target object scrolls the current scrolling distance on the display interface.
[0166] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0167] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0168] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should 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 merely example forms of implementing the claims.
Claims
1. An animation display control method, characterized in that: include: In response to the display of the target animation, obtaining a current scrolling progress of the target object, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner; Determine a current scrolling distance of the target object from the current scrolling distance at the time of the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the time of the last rendering update, and the length information of the target object; In response to the current scrolling distance being greater than or equal to a preset scrolling distance, the target object is rendered and updated so that the target object scrolls the current scrolling distance on the display interface.
2. The animation display control method according to claim 1, characterized in that: Determining a current scroll distance of the target object from the time of the last rendering update based on the current scroll progress, the scroll progress of the target object at the time of the last rendering update, and the length information of the target object includes: Determine a change in the current progress from the last rendering update based on the current scrolling progress and the scrolling progress of the target object at the last rendering update; A current scrolling distance of the target object from the last rendering update is determined based on the current progress change and the length information of the target object.
3. The animation display control method according to claim 2, characterized in that: Determining a change in the current progress from the last rendering update based on the current scrolling progress and the scrolling progress of the target object at the last rendering update includes: Subtract the scrolling progress of the target object at the time of the last rendering update from the current scrolling progress, and obtain the difference as the current progress change from the current time to the last rendering update; Wherein, when the current scrolling distance is less than the preset scrolling distance and the current scrolling progress is the maximum scrolling progress, the scrolling progress of the target object at the time of the last rendering update is updated to the minimum scrolling progress.
4. The animation display control method according to claim 2, characterized in that: Determining a change in the current progress from the last rendering update based on the current scrolling progress and the scrolling progress of the target object at the last rendering update includes: In response to the current scrolling progress and the scrolling progress of the target object at the last rendering update being in the same cycle, subtracting the scrolling progress of the target object at the last rendering update from the current scrolling progress, and using the obtained difference as the current progress change from the last rendering update; In response to the current scrolling progress and the scrolling progress of the target object at the last rendering update being in different cycles, the remaining scrolling progress of the last cycle is determined based on the scrolling progress of the target object at the last rendering update and the maximum scrolling progress, and the change in the current progress from the last rendering update is determined based on the current scrolling progress and the remaining scrolling progress.
5. The animation display control method according to claim 2, characterized in that: Determining a current scroll distance of the target object from the last rendering update based on the current progress change and the length information of the target object includes: Determining the total length information of the target objects based on the length information of the target objects and the gap distance between two adjacent target objects; A current scrolling distance of the target object from the last rendering update is determined based on the current progress change and the total length information.
6. The animation display control method according to claim 1, characterized in that: The method further comprises: In response to the current scrolling distance being less than the preset scrolling distance, returning to the step of obtaining the current scrolling progress of the target object; The preset scrolling distance is determined based on the minimum distance that can be distinguished by the naked eye.
7. The animation display control method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to the target animation being switched from a visible state to a non-visible state, updating the scrolling progress of the target object is stopped, and rendering and updating of the target object is stopped.
8. The animation display control method according to claim 7, characterized in that: In response to the target animation switching from a visible state to a non-visible state, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object include at least one of the following: In response to the display control of the target animation being switched from a display state to a hidden state, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object; In response to switching from the display page of the target animation to another page, stopping updating the scrolling progress of the target object and stopping rendering and updating the target object; In response to the target animation display client entering a background state, the updating of the scrolling progress of the target object is stopped, and rendering and updating of the target object is stopped.
9. The animation display control method according to claim 7, characterized in that: The method further comprises: In response to the target animation being switched from the invisible state to the visible state, the scrolling progress of the target object continues to be updated, and rendering update of the target object is allowed.
10. An animation display control device, characterized in that: include: a current scrolling progress acquisition module, configured to acquire the current scrolling progress of a target object in response to display of a target animation, wherein the target animation is formed by cyclically displaying the target object in a scrolling manner; a current scrolling distance determining module, configured to determine a current scrolling distance of the target object from the current scrolling distance of the target object to the last rendering update based on the current scrolling progress, the scrolling progress of the target object at the last rendering update, and the length information of the target object; The target object rendering and updating module is configured to update the rendering of the target object in response to the current scrolling distance being greater than or equal to a preset scrolling distance, so that the target object scrolls the current scrolling distance on the display interface.
11. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the animation display control method as described in any one of claims 1 to 9.
12. A storage medium containing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the animation display control method according to any one of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the animation display control method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Animation frame skipping method and related device
CN117689774A
Rolling animation drawing method and device, electronic equipment and storage medium
CN118585276A