Interface display control method and computer readable storage medium
By obtaining text information in the interface display control method, selecting animation effects and generating animations, using total animation and sub-animation controllers to achieve unified control of cartoon clips, solving the complexity and resource usage of interface display text animations, and improving playback fluency and resource management efficiency.
Patent Information
- Application Number
- CN202410978886.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-22
AI Technical Summary
When playing multimedia files in the prior art, the text animation effect displayed on the interface is complex and the resource occupies a large amount, which affects the playback fluency and is complex and difficult to manage.
By obtaining the information of the text to be displayed, selecting multiple animation effects and generating text animations, creating a total animation controller and a sub-animation controller, the sub-animation controller binds a cartoon clip, and the total animation controller triggers the playback of a sub-animation clip at a specific time point , realize unified control and resource management of animations.
It realizes rich text animation effects, simplifies animation control process, reduces resource usage, and improves the fluency of multimedia file playback and the management efficiency of animation resources.
Smart Images

Figure CN118939148A_ABST
Abstract
Description
Technical Field
[0001] The present 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 Art
[0002] When playing multimedia files, the interface often displays corresponding text. For example, when playing songs, the interface will display the corresponding lyrics; when playing movies, the interface will display the corresponding lines, etc. At present, the text displayed on the interface is generally static, and the user experience is poor. In order to make the text display on the interface present a better effect, these texts are currently animated and dynamically displayed with audio and video. For example, when playing a song, the lyrics are displayed with animation effects. However, since the lyrics animation requires each line of lyrics to support a variety of complex animation effects, and these animations need to be accurately controlled to achieve the effects of playing, pausing, appearing, disappearing, etc., the control process is relatively complicated. In the conventional animation control method, each animation needs to create and manage a controller, which is more complicated when controlling and combining multiple animations. At the same time, animation resources occupy more memory, which may affect 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, which can conveniently control complex animation effects.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: an interface display control method, comprising:
[0005] Acquire text information of text to be displayed, the text information including text content and duration;
[0006] Selecting at least one animation effect according to the text information, and generating a text animation according to the selected animation effect;
[0007] Creating a master animation controller and at least one sub-animation controller, wherein the master animation controller corresponds to the text animation, and the sub-animation controller corresponds to an animation clip in the text animation, wherein the animation clip includes more than one animation effect 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 clip;
[0008] The main animation controller is run, and when the main animation controller plays to the start time of a sub-animation controller, the animation clip corresponding to the sub-animation controller is played.
[0009] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.
[0010] The beneficial effects of the present invention are as follows: by selecting multiple animation effects, generating text animation, and binding animation clips with sub-animation controllers, each sentence of text can have different rich animation effects; by triggering the animation clips corresponding to the corresponding 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 that a series of animations are controlled by one controller, and when operations such as play, pause, fast forward, and rewind are required, only one operation is required on the main animation controller to achieve follow-up response of all animation effects, and the calling and releasing of animation resources can be better managed. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flowchart of an interface display control method of the present invention;
[0012] Figure 2 This is a flow chart of a method according to Embodiment 1 of the present invention;
[0013] Figure 3 This is a schematic diagram of dividing animation clips according to the first embodiment of the present invention. DETAILED DESCRIPTION
[0014] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is a detailed description in conjunction with the implementation methods and the accompanying drawings.
[0015] See also Figure 1 , an interface display control method, comprising:
[0016] Acquire text information of text to be displayed, the text information including text content and duration;
[0017] Selecting at least one animation effect according to the text information, and generating a text animation according to the selected animation effect;
[0018] Creating a master animation controller and at least one sub-animation controller, wherein the master animation controller corresponds to the text animation, and the sub-animation controller corresponds to an animation clip in the text animation, wherein the animation clip includes more than one animation effect 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 clip;
[0019] The main animation controller is run, and when the main animation controller plays to the start time of a sub-animation controller, the animation clip corresponding to the sub-animation controller is played.
[0020] It can be seen from the above description that the beneficial effects of the present invention are: rich animation effects can be achieved, and the calling and releasing of animation resources can be better managed.
[0021] Furthermore, the duration of the total animation controller is the same as the duration of the text to be displayed.
[0022] It can be seen from the above description that the overall control of text animation can be achieved.
[0023] Furthermore, the number of the sub-animation controllers is the same as that of the animation segments in the text animation and they correspond one to one, and the sub-animation controllers control all animation effects in the corresponding animation segments.
[0024] It can be seen from the above description that independent control of animation clips can be achieved.
[0025] Furthermore, the selecting at least one animation effect according to the text information includes:
[0026] If a preset keyword exists in the text content, an animation effect corresponding to the keyword is selected.
[0027] It can be seen from the above description that by selecting animation effects according to text content, the compatibility between text content and animation effects is improved.
[0028] Furthermore, the types of animation effects include text start animation, text display animation and text end animation;
[0029] The selecting at least one animation effect according to the text information includes:
[0030] A text start animation and a text end animation are selected, 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] From the above description, it can be seen that by selecting the animation effect according to the duration of the text, it is ensured that the animation effect can be played completely, thereby improving the visual effect.
[0032] Furthermore, after 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 includes:
[0033] Set the start time and play duration for each selected animation effect respectively, and determine the end time of each animation effect according to the start time and play duration of each animation effect respectively;
[0034] According to the start time and end time of each animation effect, the animation segments are divided in the text animation, wherein the animation effects in the same animation segment have the same start time and the same end time, and the start time and end time of the same animation segment are respectively the start time and end time of the animation effect therein.
[0035] From the above description, it can be seen that different animation effects within the same time period can be uniformly controlled.
[0036] Furthermore, if the playing time of an animation effect is longer than its complete playing time, the animation effect is played in a loop during the period between its starting time and ending time.
[0037] From the above description, it can be known that a periodic animation can be designed to be played in a loop.
[0038] Furthermore, when the overall animation controller performs a control operation, the sub-animation controller also performs a corresponding control operation, and the control operation includes one or more of the following: run, pause, backtrack and release.
[0039] From the above description, it can be seen that the calling and releasing of animation resources can be better managed through a unified control solution.
[0040] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.
[0041] Embodiment 1
[0042] Please refer to Figure 2-3 , Embodiment 1 of the present invention is: an interface display control method, which can be applied to lyrics animation control, and aims to solve the problem of synchronization and combination of multiple animations.
[0043] In this embodiment, three types of animations are set, namely, lyrics start animation, lyrics display animation and lyrics end animation. According to the usage scenario of each type of animation, multiple animation effects are set, such as fade-in, fade-out, multi-directional movement, zoom, swing, rotation, etc. Among them, fade-in is applicable to lyrics start animation, fade-out is applicable to lyrics end animation, and zoom is applicable to all types of animations.
[0044] like Figure 2 As shown, the method of this embodiment includes the following steps:
[0045] S1: Obtain text information of text to be displayed, where the text information includes text content and duration.
[0046] In this embodiment, the lyrics information is obtained, including the lyrics content and the lyrics duration. In the actual application scenario, a lyrics input interface can be created to receive lyrics information that needs to be displayed from the outside, and each incoming lyrics can be one sentence or multiple sentences.
[0047] S2: selecting at least one animation effect according to the text information, and generating a text animation according to the selected animation effect.
[0048] In this step, any number of animation effects can be selected for the text to be displayed.
[0049] In actual application scenarios, animation effects can be selected according to the characteristics of the text content. For example, corresponding animation effects can be selected according to keywords in the text content. For example, assuming the lyrics are "Let's swing together", where "swing" is a preset keyword, the animation effect corresponding to "swing" can be selected. For another example, assuming the lyrics are "Lights and fireworks shine together but are not as bright as my dreams", where "shine" is a preset keyword, the animation effect corresponding to "shine" can be selected.
[0050] An animation effect can also be selected according to 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 complete play time can be selected. In this embodiment, lyrics start animation and lyrics end animation with a shorter complete play time can be selected to avoid the animation being unable to be fully played within the lyrics display time, which affects the visual effect, that is, the complete play time of the selected lyrics start animation and the complete play time of the lyrics end animation do not exceed the duration of the lyrics to be displayed. For example, taking multi-directional moving animation as an example, the lyrics start animation is left entry (that is, the lyrics appear from the left side of the screen and move to the middle of the screen), and the complete play time of the animation effect is 600 milliseconds; the lyrics end animation is right out (that is, the lyrics move out of the screen from the middle of the screen to the right), and the complete play time of the animation effect is also 600 milliseconds; then the lyrics duration that can fully play these two animation effects needs to be greater than 1200 milliseconds. If the duration of the lyrics is less than 1200 milliseconds, it is not suitable to select these two animation effects, and it should be considered to select animation effects with shorter complete play time, such as fade in and fade out, or direct appearance and direct disappearance.
[0051] S3: respectively setting a start time and a play duration for each selected animation effect, and determining an end time for each animation effect according to the start time and the play duration of each animation effect.
[0052] The playback duration set for the animation effect should be greater than or equal to its full playback time to ensure that each animation effect can be fully played. When the playback time of an animation effect is greater than its full playback time, it can be designed as a cyclic animation that can be played in a loop, that is, the animation effect is played in a loop between its start time and end time.
[0053] S4: Divide the text animation into animation segments according to the start time and end time of each animation effect, wherein the animation effects in the same animation segment have the same start time and the same end time, and the start time and end time of the same animation segment are respectively the start time and end time of the animation effect therein.
[0054] like Figure 3 As shown, Figure 3 The dotted lines in the figure represent the corresponding start and end times of the animation clip in the overall animation controller. Each animation clip can be bound to more than one animation effect with the same start and end time.
[0055] S5: creating a main animation controller and at least one sub-animation controller, and determining the start time of each sub-animation controller according to the start time of the corresponding animation clip.
[0056] Among them, the main animation controller corresponds to the text animation, and the duration of the main animation controller is the same as the duration of the text to be displayed; the number of sub-animation controllers is the same as that of animation clips in the text animation and corresponds one to one, and the sub-animation controller is used to control all animation effects in the corresponding animation clip.
[0057] In actual application scenarios, you can use Flutter to create a main animation controller and one or more sub-animation controllers, such as AnimationController(duration: text duration) used to control animation playback in Flutter. The Flutter code of the sub-animation controller can be as follows:
[0058] SubAnimationController = CurvedAnimation(
[0059] parent: the overall animation controller,
[0060] curve:Interval (start time of animation effect, end time of animation effect),
[0062] S6: running the main animation controller, and when the main animation controller plays to the start time of a sub-animation controller, playing the animation clip corresponding to the sub-animation controller.
[0063] When the text to be displayed starts to be displayed, call the start method of the main animation controller to start running the main animation controller. When the main animation controller plays to the start time of a sub-animation controller, it starts to play the animation effect bound to the sub-animation controller.
[0064] 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: run, pause, rewind and release. That is, when you need to pause, fast forward, etc., you only need to operate the main animation controller once, and all animation effects can follow and respond.
[0065] This embodiment can bind any number of animation effects to any paragraph within the duration of the lyrics, and by randomly combining multiple animation effects, each line of lyrics can have different and rich animation effects. The unified controller solution can also better manage the calling and releasing of animation resources.
[0066] Embodiment 2
[0067] This embodiment is a computer-readable storage medium corresponding to the above embodiment, on which a computer program is stored. When the program is executed by the processor, it implements the various steps of an interface display control method in the above embodiment and can achieve the same technical effect, which will not be repeated here.
[0068] In summary, the present invention provides an interface display control method and a computer-readable storage medium, which can generate text animation by selecting multiple animation effects and bind animation clips with sub-animation controllers, so that each sentence of text can have different rich animation effects; by triggering the animation clips corresponding to the corresponding sub-animation controllers when the main animation controller runs to the corresponding time point, a main animation controller can control multiple sub-animation controllers, thereby realizing that a series of animations are controlled by one controller. When operations such as play, pause, fast forward, and rewind are required, only one operation is required on the main animation controller to achieve follow-up response of all animation effects, and the calling and releasing of animation resources can be better managed.
[0069] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An interface display control method, characterized in that: include: Acquire text information of text to be displayed, the text information including text content and 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 master animation controller and at least one sub-animation controller, wherein the master animation controller corresponds to the text animation, and the sub-animation controller corresponds to an animation clip in the text animation, wherein the animation clip includes more than one animation effect 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 clip; The main animation controller is run, and when the main animation controller plays to the start time of a sub-animation controller, the animation clip corresponding to the sub-animation controller is played.
2. The interface display control method according to claim 1, characterized in that: 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, characterized in that: The number of the sub-animation controllers is the same as that of the animation segments in the text animation and they correspond one to one. The sub-animation controllers control all animation effects in the corresponding animation segments.
4. The interface display control method according to claim 1, characterized in that: The selecting at least one animation effect according to the text information includes: If a preset keyword exists in the text content, an animation effect corresponding to the keyword is selected.
5. The interface display control method according to claim 1, characterized in that: The types of animation effects include text start animation, text display animation and text end animation; The selecting at least one animation effect according to the text information includes: A text start animation and a text end animation are selected, 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, characterized in that: After 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 includes: Set the start time and play duration for each selected animation effect respectively, and determine the end time of each animation effect according to the start time and play duration of each animation effect respectively; According to the start time and end time of each animation effect, the animation segments are divided in the text animation, wherein the animation effects in the same animation segment have the same start time and the same end time, and the start time and end time of the same animation segment are respectively the start time and end time of the animation effect therein.
7. The interface display control method according to claim 6, characterized in that: If the playing time of an animation effect is longer than its complete playing time, the animation effect is played in a loop during the period between its starting time and ending time.
8. The interface display control method according to claim 1, characterized in that: When the overall animation controller performs a control operation, the sub-animation controller also performs a corresponding control operation, and the control operation includes one or more of the following: run, pause, backtrack and release.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
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
Playing control method and device, electronic equipment and readable storage medium
CN113099294A
Method, device and storage medium for generating animation
US20200349753A1
Animation playback method and apparatus
WO2024120529A1
