Interface display control method and computer readable storage medium
By generating text animations and using the main animation controller to uniformly manage the sub-animation controllers, the problem of static text effects on the interface was solved, enabling rich animation displays and optimized resource management, improving user experience and the smoothness of multimedia files.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, the text displayed on the interface is static, resulting in a poor user experience. Furthermore, the animation control is complex, consumes a lot of memory, and affects the smoothness of multimedia file playback.
By acquiring text information, selecting animation effects, generating text animations, and creating a main animation controller and sub-animation controllers, the main animation controller can be used to uniformly control multiple sub-animation controllers, thereby achieving rich display of animation effects and resource management.
It achieves rich animation effects, simplifies the animation control process, improves the user experience, optimizes memory usage, and ensures smooth playback of multimedia files.
Smart Images

Figure CN118939148B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of display control technology, and in particular to an interface display control method and a computer-readable storage medium. Background Technology
[0002] When playing multimedia files, the interface often displays corresponding text. For example, when playing a song, the interface displays lyrics; when playing a movie, it displays dialogue. Currently, the text displayed on the interface is generally static, resulting in a poor user experience. To improve the visual effect of the text display, animations are being created to dynamically display the text in conjunction with audio and video. For example, when playing a song, animated lyrics can be used. However, lyric animation requires each line of lyrics to support multiple complex animation effects, and these animations need to be accurately controlled to achieve effects such as playback, pause, appearance, and disappearance of lyrics, making the control process quite complex. In conventional animation control methods, each animation requires the creation and management of a controller, which is complex when controlling and combining multiple animations. Furthermore, animation resources consume a significant amount of memory, potentially affecting the smoothness of multimedia file playback. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide an interface display control method and a computer-readable storage medium that can conveniently control complex animation effects.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: an interface display control method, comprising:
[0005] Obtain the text information of the text to be displayed, wherein the text information includes the text content and duration;
[0006] Based on the text information, select at least one animation effect, and generate a text animation based on the selected animation effect;
[0007] Create a main animation controller and at least one sub-animation controller. The main animation controller corresponds to the text animation, and the sub-animation controller corresponds to an animation segment in the text animation. The animation segment includes one or more animation effects with the same start time and the same end time. The start time of each sub-animation controller is determined according to the start time of the corresponding animation segment.
[0008] Run the main animation controller. When the main animation controller reaches the start time of a sub-animation controller, play the animation segment corresponding to that sub-animation controller.
[0009] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0010] The beneficial effects of this invention are as follows: by selecting multiple animation effects to generate text animations and binding animation segments with sub-animation controllers, each sentence of text can have different and rich animation effects; by triggering the corresponding animation segments of the sub-animation controllers when the main animation controller runs to the corresponding time point, one main animation controller can control multiple sub-animation controllers, thereby realizing the control of a series of animations by one controller. When it is necessary to perform operations such as play, pause, fast forward, and rewind, only one operation needs to be performed on the main animation controller to realize that all animation effects can follow and respond, and the calling and release of animation resources can be better managed. Attached Figure Description
[0011] Figure 1 This is a flowchart of an interface display control method according to the present invention;
[0012] Figure 2 This is a flowchart of the method according to Embodiment 1 of the present invention;
[0013] Figure 3 This is a schematic diagram illustrating the division of animation segments according to Embodiment 1 of the present invention. Detailed Implementation
[0014] To explain the technical content, objectives, and effects of the present invention in detail, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0015] Please see Figure 1 A method for controlling interface display, comprising:
[0016] Obtain the text information of the text to be displayed, wherein the text information includes the text content and duration;
[0017] Based on the text information, select at least one animation effect, and generate a text animation based on the selected animation effect;
[0018] Create a main animation controller and at least one sub-animation controller. The main animation controller corresponds to the text animation, and the sub-animation controller corresponds to an animation segment in the text animation. The animation segment includes one or more animation effects with the same start time and the same end time. The start time of each sub-animation controller is determined according to the start time of the corresponding animation segment.
[0019] Run the main animation controller. When the main animation controller reaches the start time of a sub-animation controller, play the animation segment corresponding to that sub-animation controller.
[0020] As can be seen from the above description, the beneficial effects of the present invention are: it can achieve rich animation effects and can better manage the calling and release of animation resources.
[0021] Furthermore, the duration of the overall animation controller is the same as the duration of the text to be displayed.
[0022] As can be seen from the above description, overall control of text animation can be achieved.
[0023] Furthermore, the number of sub-animation controllers is the same as the number of animation segments in the text animation and they correspond one-to-one. The sub-animation controller controls all animation effects in the corresponding animation segment.
[0024] As can be seen from the above description, independent control of animation clips can be achieved.
[0025] Furthermore, the step of selecting at least one animation effect based on the text information includes:
[0026] If a preset keyword exists in the text content, then the animation effect corresponding to the keyword is selected.
[0027] As described above, by selecting animation effects based on the text content, the compatibility between the text content and the animation effects can be improved.
[0028] Furthermore, the types of animation effects include text start animation, text display animation, and text end animation;
[0029] The step of selecting at least one animation effect based on the text information includes:
[0030] Select a text start animation and a text end animation, and the total duration of the text start animation and the text end animation is less than or equal to the duration of the text to be displayed.
[0031] As described above, by selecting animation effects based on the duration of the text, the animation effects can be played in their entirety, thus improving the visual experience.
[0032] Furthermore, after selecting at least one animation effect based on the text information and generating a text animation based on the selected animation effect, the process further includes:
[0033] Set the start time and playback duration for each selected animation effect, and determine the end time for each animation effect based on its start time and playback duration.
[0034] Based on the start and end times of each animation effect, the text animation is divided into animation segments. Within the same animation segment, the animation effects have the same start and end times. The start and end times of the same animation segment are respectively the start and end times of the animation effects within it.
[0035] As described above, it is possible to ensure that different animation effects within the same time period can be controlled uniformly.
[0036] Furthermore, if the playback duration of an animation effect is longer than its full playback time, then the animation effect will loop during the period between its start and end times.
[0037] As can be seen from the above description, it can be designed as a periodic animation that can be played in a loop.
[0038] Furthermore, when the main animation controller performs a control operation, the sub-animation controller also performs a corresponding control operation, which includes one or more of the following: running, pausing, rewinding, and releasing.
[0039] As can be seen from the above description, a unified control scheme can better manage the calling and release of animation resources.
[0040] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0041] Example 1
[0042] Please refer to Figure 2-3 The first embodiment of the present invention is: an interface display control method that can be applied to lyrics animation control, aiming to solve the problem of synchronization and combination of multiple animations.
[0043] In this embodiment, three types of animations are defined: lyrics start animation, lyrics display animation, and lyrics end animation. Various animation effects are then set according to the usage scenario of each type of animation, such as fade-in, fade-out, multi-directional movement, scaling, swaying, and rotation. Specifically, fade-in is suitable for the lyrics start animation, fade-out for the lyrics end animation, and scaling for all types of animations.
[0044] like Figure 2 As shown, the method in this embodiment includes the following steps:
[0045] S1: Get the text information of the text to be displayed, including the text content and duration.
[0046] In this embodiment, the lyrics information is obtained, including the lyrics content and the duration of the lyrics. In practical applications, a lyrics input interface can be created to accept externally input lyrics information that needs to be displayed. Each input lyric can be one or more lines.
[0047] S2: Based on the text information, select at least one animation effect, and generate a text animation based on the selected animation effect.
[0048] In this step, you can select as many animation effects as you like for the text to be displayed.
[0049] In practical applications, animation effects can be selected based on the characteristics of the text content. For example, corresponding animation effects can be selected based on keywords in the text. For instance, if the lyrics are "Let's rock together," and "rock" is a preset keyword, then the animation effect corresponding to "rock" can be selected. As another example, if the lyrics are "Lights and fireworks shine brighter than my dream," and "shines" is a preset keyword, then the animation effect corresponding to "shines" can be selected.
[0050] The animation effect can also be selected based on the duration of the text to be displayed. For example, when the duration of the text to be displayed is short, an animation effect with a shorter total playback time can be selected. In this embodiment, a lyrics start animation and a lyrics end animation with a short total playback time can be selected to avoid the animation not playing completely within the lyrics display time, which would affect the visual effect. That is, the total playback time of the selected lyrics start animation and the total playback time of the selected lyrics end animation do not exceed the duration of the lyrics to be displayed. For example, taking a multi-directional movement animation as an example, the lyrics start animation is left-entry (i.e., the lyrics appear from the left side of the screen and move to the middle of the screen), and the total playback time of this animation effect is 600 milliseconds; the lyrics end animation is right-exit (i.e., the lyrics move from the middle of the screen to the right and exit the screen), and the total playback time of this animation effect is also 600 milliseconds; then the duration of the lyrics to play these two animation effects completely needs to be greater than 1200 milliseconds. If the duration of the lyrics is less than 1200 milliseconds, then these two animation effects are not suitable to be selected, and animation effects with shorter total playback times should be considered, such as fade-in and fade-out, or direct appearance and direct disappearance.
[0051] S3: Set the start time and playback duration for each selected animation effect, and determine the end time for each animation effect based on its start time and playback duration.
[0052] The playback duration set for each animation effect should be greater than or equal to its full playback time to ensure that each animation effect can play completely. When the playback time of an animation effect is longer than its full playback time, it can be designed as a loopable periodic animation, that is, the animation effect will loop within the time period between its start and end times.
[0053] S4: Divide the text animation into animation segments according to the start and end times of each animation effect. The animation effects in the same animation segment have the same start and end times. The start and end times of the same animation segment are the start and end times of the animation effects within it.
[0054] like Figure 3 As shown, Figure 3 The dotted lines in the text indicate the start and end times of the animation clip in the main animation controller. Each animation clip can be bound to more than one animation effect with the same start and end times.
[0055] S5: Create a master animation controller and at least one sub-animation controller, and determine the start time of each sub-animation controller according to the start time of the corresponding animation segment.
[0056] The main animation controller corresponds to the text animation, and its duration is the same as the duration of the text to be displayed. The sub-animation controllers correspond one-to-one with the number of animation segments in the text animation, and are used to control all animation effects in the corresponding animation segment.
[0057] In practical applications, you can create a main animation controller and one or more child animation controllers using Flutter, such as `AnimationController(duration: text duration)` used to control animation playback. The Flutter code for the child animation controllers can be shown below:
[0058] Child animation controller = CurvedAnimation(
[0059] parent: The main animation controller.
[0060] curve:Interval(start time of animation effect, end time of animation effect),
[0061] S6: Run the main animation controller. When the main animation controller reaches the start time of a sub-animation controller, play the animation segment corresponding to the sub-animation controller.
[0062] When the text to be displayed begins to appear, calling the start method of the main animation controller will start the main animation controller from running. When the main animation controller reaches the start time of a child animation controller, the animation effect bound to that child animation controller will begin to play.
[0063] When the main animation controller performs a control operation, the sub-animation controllers also perform corresponding control operations. These control operations include one or more of the following: run, pause, rewind, and release. That is, when operations such as pause or fast forward are needed, only one operation needs to be performed on the main animation controller to achieve a corresponding response from all animation effects.
[0064] This embodiment allows binding any number of animation effects to any segment within the duration of the lyrics. By randomly combining various animation effects, each line of lyrics can have a different and rich animation effect. The unified controller solution can also better manage the calling and releasing of animation resources.
[0065] Example 2
[0066] This embodiment is a computer-readable storage medium corresponding to the above embodiments, on which a computer program is stored. When the program is executed by a processor, it implements the various steps of the interface display control method in the above embodiments and can achieve the same technical effect, which will not be repeated here.
[0067] In summary, the interface display control method and computer-readable storage medium provided by this invention generate text animations by selecting multiple animation effects and binding animation segments with sub-animation controllers, allowing each sentence of text to have different and rich animation effects. By triggering the corresponding animation segments of the sub-animation controllers when the main animation controller reaches the corresponding time point, one main animation controller can control multiple sub-animation controllers, thereby realizing the control of a series of animations by one controller. When it is necessary to perform operations such as play, pause, fast forward, and rewind, only one operation needs to be performed on the main animation controller to realize that all animation effects can respond accordingly, and the calling and release of animation resources can be better managed.
[0068] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. An interface display control method characterized by comprising: The method comprises: obtaining text information of a text to be displayed, the text information comprising text content and a duration; selecting at least one animation effect according to the text information, and generating a text animation according to the selected animation effect; creating a total animation controller corresponding to the text animation and at least one sub-animation controller corresponding to an animation segment in the text animation, the animation segment comprising one or more animation effects with the same start time and the same end time, and determining the start time of each sub-animation controller according to the start time of the corresponding animation segment; running the total animation controller, and playing the animation segment corresponding to a sub-animation controller when the total animation controller plays to the start time of the sub-animation controller.
2. The interface display control method according to claim 1, characterized by, The duration of the total animation controller is the same as the duration of the text to be displayed.
3. The interface display control method according to claim 1, wherein The number of sub-animation controllers is the same as the number of animation segments in the text animation, and each sub-animation controller corresponds to one animation segment.
4. The interface display control method according to claim 1, characterized by, The method of selecting at least one animation effect according to the text information comprises: selecting an animation effect corresponding to a preset keyword in the text content.
5. The interface display control method according to claim 1, wherein The types of animation effects include a text start animation, a text display animation, and a text end animation. The method of selecting at least one animation effect according to the text information comprises: selecting a text start animation and a text end animation, and the total duration of the text start animation and the text end animation is less than or equal to the duration of the text to be displayed.
6. The interface display control method according to claim 1, wherein After the method of selecting at least one animation effect according to the text information and generating a text animation according to the selected animation effect, the method further comprises: setting the start time and the playing duration of each selected animation effect, and determining the end time of each animation effect according to the start time and the playing duration of each animation effect; dividing the text animation into animation segments according to the start time and the end time of each animation effect, wherein the start time and the end time of the same animation segment are the same, and the start time and the end time of the same animation segment are the start time and the end time of the animation effect in the same animation segment.
7. The interface display control method according to claim 6, wherein If the playing duration of an animation effect is greater than its complete playing time, the animation effect is played in a loop between its start time and end time.
8. The interface display control method according to claim 1, wherein When the total animation controller performs a control operation, the sub-animation controller also performs a corresponding control operation, and the control operation comprises one or more of the following: running, pausing, backtracking, and releasing.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by a processor to implement the method of any one of claims 1-8.
Citation Information
Patent Citations
Animation playing method, device and equipment and storage medium
CN110750743A
Lyric editing and displaying method and device and storage medium
CN112184861A