CN106447749A - Implementation method for music frequency spectrum beating animation based on iOS system - Google Patents
Implementation method for music frequency spectrum beating animation based on iOS system Download PDFInfo
- Publication number
- CN106447749A CN106447749A CN201610846337.3A CN201610846337A CN106447749A CN 106447749 A CN106447749 A CN 106447749A CN 201610846337 A CN201610846337 A CN 201610846337A CN 106447749 A CN106447749 A CN 106447749A
- Authority
- CN
- China
- Prior art keywords
- animation
- careplicatorlayer
- attribute
- layer
- calayer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention relates to the field of mobile application development, and provides an implementation method for music frequency spectrum beating animation based on an iOS system. The method comprises the step that at least one CAReplicatorLayer object is created; the attributes of the CAReplicatorLayer object of determining the way of layer replication are set; a CALayer object is created to act as a basic layer; a Core Animation object capable of implementing the upward and downward movement animation effect is created; and the CALayer object is added to a CAReplicatorLayer container, replication is performed according to the configured replication parameters and the implemented animation effect is displayed. According to the technical scheme, the originally provided technology of the system is fully used so that the flow of implementing the animation can be simplified.
Description
Technical field
The invention belongs to Mobile solution development field, beated animation based on the music frequency spectrum of iOS system particularly to a kind of
Implementation method.
Background technology
With the fast development of mobile Internet, Mobile solution more focuses on hommization experience, and the exploitation in Mobile solution
During animation effect more and more used, a have hommization experience animation App natural energy keep more users here,
On certain picture and text page of App, describe a product or scene by animated show and more allow App show than word description
Must there is vitality.Therefore, based on iOS system develop a application program when, can commonly used to animation effect, in iOS system
Carry out software development, if desired realize animation effect, can be made by all kinds of method attributes that Core Animation storehouse provides
Go out various animation effects, these animation effects need to be added to above a CALayer object and show, just can show out
The animation sent out is although the storehouse such as Core Animation is supplied to a lot of base animation of developer, but it can not directly carry
The Complex Animation that we want for some, so need us to run jointly using these base animation storehouse deallocations that iOS provides send out in fact
Existing self-defining animation.
When needing to develop a animation beated similar to audible spectrum, such as apply when playing audio frequency, in order to
There is the state play of sign, one is imitated the animation that audible spectrum persistently beats and user naturally can be allowed to know currently
Audio frequency is play, and this can instead of stiff word description, provides the user with more superior experience.Although can be by adding
Add a CALayer to realize, but the method can make system code become very complicated, and iOS behaviour cannot be made full use of
Make the existing technology of system offer it is impossible to provide good animation performance.
Content of the invention
【Technical problem to be solved】
It is an object of the invention to provide a kind of implementation method of animation of being beated based on the music frequency spectrum of iOS system, to solve
One of above technical problem.
【Technical scheme】
The present invention is achieved by the following technical solutions.
The present invention relates to a kind of implementation method of animation of being beated based on the music frequency spectrum of iOS system, the method includes following
Step:
A, create at least one CAReplicatorLayer object, the size position of setting CAReplicatorLayer object
Put and background color, described CAReplicatorLayer object is as the container of duplicate layer;
B, setting CAReplicatorLayer object determine how to carry out the attribute of duplicate layer;
Figure layer based on C, one CALayer object of establishment, arranges its attribute with respect to container, described attribute is at least
Including position, size, color parameter;
D, one Core Animation animation object being capable of moving up and down animation effect of establishment;
E, CALayer object is added to CAReplicatorLayer container, is entered according to the duplication parameter of step A configuration
Row replicates, and the animation effect realized in step D is shown.
As one kind preferred embodiment, the CAReplicatorLayer object's position size of described establishment is passed through to join
Put the setting of frame, bounds, position attribute, the background color of the CAReplicatorLayer object of described establishment passes through
BackgroundColor attribute is arranged.
As another preferred embodiment, described step B comprises the following steps:
Arranged by instanceCount and replicate how many figure layers;
The distance between figure layer copy being replicated by the setting of instanceTransform attribute and rotation;
Delay between figure layer copy is arranged by instanceDelay attribute;
The subgraph layer that cutting exceeds figure layer container is arranged by masksToBounds.
As another preferred embodiment, the CALayer object of described establishment is with respect to CAReplicatorLayer
The position of container and size are passed through frame, bounds, position attribute and are arranged, the color of the CALayer object of described establishment
Arranged by backgroundColor attribute, the radius of corner of the CALayer object of described establishment is belonged to by cornerRadius
Property setting.
【Beneficial effect】
Technical scheme proposed by the present invention has the advantages that:
The present invention is realized analogue audio frequency frequency spectrum and beats animation based on the CAReplicatorLayer in iOS system, passes through
The technology of the primary offer of system is fully provided, simplifies the flow process realizing such animation, improve the flexible of code later maintenance
Property, also enhance animation performance stability simultaneously, Consumer's Experience can be greatly promoted.
Brief description
The implementation method of the animation of being beated based on the music frequency spectrum of iOS system that Fig. 1 provides for embodiments of the invention one
Flow chart.
Specific embodiment
For making the object, technical solutions and advantages of the present invention clearer, below by the specific embodiment to the present invention
Carry out clear, complete description.
Embodiment one
Fig. 1 for the embodiment of the present invention one provide based on the music frequency spectrum of iOS system beat animation implementation method stream
Cheng Tu.As shown in figure 1, this step includes step S1 to step S5, separately below each step is described in detail.
Step S1:Create a CAReplicatorLayer object as figure layer container, arrange
The size position of CAReplicatorLayer object and background color.
In the present embodiment, CAReplicatorLayer object is as the container of duplicate layer.Specifically, establishment
CAReplicatorLayer object's position size is arranged by configuring frame, bounds, position attribute, establishment
The background color of CAReplicatorLayer object is arranged by backgroundColor attribute.
Step S2:Setting CAReplicatorLayer object determines how to carry out the attribute of duplicate layer.
Specifically, in the present embodiment, setting CAReplicatorLayer object determines how to carry out the attribute of duplicate layer
Including:
Arranged by instanceCount and replicate how many figure layers;
The distance between figure layer copy being replicated by the setting of instanceTransform attribute and rotation;
Delay between figure layer copy is arranged by instanceDelay attribute;
The subgraph layer that cutting exceeds figure layer container is arranged by masksToBounds.
Step S3:Create figure layer based on a CALayer object, its attribute with respect to container is set.
Wherein, attribute includes position, size, color parameter, specifically, in the present embodiment, the CALayer object phase of establishment
Position for CAReplicatorLayer container and size are passed through frame, bounds, position attribute and are arranged, establishment
The color of CALayer object is arranged by backgroundColor attribute, and the radius of corner of the CALayer object of establishment is passed through
CornerRadius attribute is arranged.
Step S4:Create a Core Animation animation object being capable of moving up and down animation effect.
In the present embodiment can be by creating CABasicAnimation object, setting KeyPath is position.y,
Realize moving up and down animation by the value changing keyPath;CALayer object can be made after being added on CALayer object to have
There is the animation effect moving up and down, animation can be also carried out replicating when CAReplicatorLayer container replicates.
Step S5:CALayer object is added to CAReplicatorLayer container, realizes the display of animation effect.
Specifically, CALayer object is added to CAReplicatorLayer container, according to the duplication of step S1 configuration
Parameter is replicated, and the animation effect realized in step S4 is shown.After screen display, can be achieved with analogue audio frequency
Frequency spectrum is beated animation effect.
It is to be appreciated that on the basis of embodiment one, it is also possible to different according to developer in specific development process
Demand creates multiple CAReplicatorLayer containers, multiple CALayer object, adds multiple animation effects, to realize more
Complicated animation effect.
As can be seen from the above embodiments, the embodiment of the present invention creates a CAReplicatorLayer object first and makees
Container for Layer, then create a CALayer object and by Core Animation add self-defining constantly on
The animation effect of lower movement, the sub- Layer due to adding to the container can replicate several pieces, so the Layer of establishment is added
After being added in this container, set sub- Layer number of copies and replicate the distance between Layer copy, transparency, color, rotation
Turn, after the status attribute such as position, you can realize one and imitate the animation effect that audible spectrum is beated, and can guarantee that animation effect
Better performances, internal memory is using very low.
The embodiment of the present invention realized based on the CAReplicatorLayer in iOS system analogue audio frequency frequency spectrum beat dynamic
Draw, by fully using the technology of the primary offer of system, simplify the flow process realizing such animation, improve code later maintenance
Motility, also enhance animation performance stability simultaneously, Consumer's Experience can be greatly promoted.
It is to be appreciated that the embodiment of foregoing description is a part of embodiment of the present invention, rather than whole embodiments, also not
It is limitation of the present invention.Based on embodiments of the invention, those of ordinary skill in the art are not paying creative work premise
Lower obtained every other embodiment, broadly falls into protection scope of the present invention.
Claims (4)
1. a kind of based on the music frequency spectrum of iOS system beat animation implementation method it is characterised in that comprising the following steps:
A, create at least one CAReplicatorLayer object, the size position of setting CAReplicatorLayer object and
Background color, described CAReplicatorLayer object is as the container of duplicate layer;
B, setting CAReplicatorLayer object determine how to carry out the attribute of duplicate layer;
Figure layer based on C, one CALayer object of establishment, arranges its attribute with respect to container, described attribute at least includes
Position, size, color parameter;
D, one Core Animation animation object being capable of moving up and down animation effect of establishment;
E, CALayer object is added to CAReplicatorLayer container, is carried out according to the duplication parameter of step A configuration multiple
System, the animation effect realized in step D is shown.
2. according to claim 1 based on the music frequency spectrum of iOS system beat animation implementation method it is characterised in that institute
The position size stating the CAReplicatorLayer object of establishment is arranged by configuring frame, bounds, position attribute,
The background color of the CAReplicatorLayer object of described establishment is arranged by backgroundColor attribute.
3. according to claim 1 based on the music frequency spectrum of iOS system beat animation implementation method it is characterised in that institute
State step B to comprise the following steps:
Arranged by instanceCount and replicate how many figure layers;
The distance between figure layer copy being replicated by the setting of instanceTransform attribute and rotation;
Delay between figure layer copy is arranged by instanceDelay attribute;
The subgraph layer that cutting exceeds figure layer container is arranged by masksToBounds.
4. according to claim 1 based on the music frequency spectrum of iOS system beat animation implementation method it is characterised in that institute
State the CALayer object of establishment with respect to the position of CAReplicatorLayer container and size pass through frame, bounds,
Position attribute is arranged, and the color of the CALayer object of described establishment is arranged by backgroundColor attribute, described
The radius of corner of the CALayer object creating is arranged by cornerRadius attribute.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610846337.3A CN106447749A (en) | 2016-09-23 | 2016-09-23 | Implementation method for music frequency spectrum beating animation based on iOS system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610846337.3A CN106447749A (en) | 2016-09-23 | 2016-09-23 | Implementation method for music frequency spectrum beating animation based on iOS system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106447749A true CN106447749A (en) | 2017-02-22 |
Family
ID=58167261
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610846337.3A Pending CN106447749A (en) | 2016-09-23 | 2016-09-23 | Implementation method for music frequency spectrum beating animation based on iOS system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106447749A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106971413A (en) * | 2017-03-13 | 2017-07-21 | 武汉斗鱼网络科技有限公司 | Animation information methods of exhibiting and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100302254A1 (en) * | 2009-05-28 | 2010-12-02 | Samsung Electronics Co., Ltd. | Animation system and methods for generating animation based on text-based data and user information |
CN102938158A (en) * | 2011-10-18 | 2013-02-20 | 微软公司 | Constructing animation timeline through direct operation |
CN104123742A (en) * | 2014-07-21 | 2014-10-29 | 徐才 | Method and player for translating static cartoon picture into two dimensional animation |
-
2016
- 2016-09-23 CN CN201610846337.3A patent/CN106447749A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100302254A1 (en) * | 2009-05-28 | 2010-12-02 | Samsung Electronics Co., Ltd. | Animation system and methods for generating animation based on text-based data and user information |
CN102938158A (en) * | 2011-10-18 | 2013-02-20 | 微软公司 | Constructing animation timeline through direct operation |
CN104123742A (en) * | 2014-07-21 | 2014-10-29 | 徐才 | Method and player for translating static cartoon picture into two dimensional animation |
Non-Patent Citations (1)
Title |
---|
付宇轩: "CALayer动画实践(二):CAReplicatorLayer的用法", 《URL:HTTPS://WWW.CSDN.NET/ARTICLE/2015-09-09/2825659/1》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106971413A (en) * | 2017-03-13 | 2017-07-21 | 武汉斗鱼网络科技有限公司 | Animation information methods of exhibiting and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10880595B2 (en) | Method and apparatus for adjusting virtual reality scene, and storage medium | |
CN104007967B (en) | A kind of user interface creating method and device based on extensible markup language | |
CN108933895A (en) | Three dimensional particles special efficacy generation method, device and electronic equipment | |
WO2013173949A1 (en) | Method and device for loading and unloading object hierarchically in three-dimensional virtual reality scene | |
CN106126733A (en) | A kind of method and system changing CSS style | |
CN103744999A (en) | Spatial vector data online interactive mapping method based on hierarchical-divided storage structure | |
CN107077746A (en) | System, method and computer program product for network transmission and the Automatic Optimal of the 3D texture models of real-time rendering | |
CN107230244A (en) | The generation method and rendering system of a kind of animation file | |
CN106447749A (en) | Implementation method for music frequency spectrum beating animation based on iOS system | |
CN104407893B (en) | Show the method and device of animation | |
Li | [Retracted] Visualization Display System of Gannan Hakka Paper‐Cut Works Based on Computer Graphics Algorithm | |
CN111145318A (en) | Rendering method and device based on NGUI | |
CN107277633B (en) | A kind of method and device showing direct broadcasting room present effect | |
CN106257414A (en) | A kind of hand-set digit animation authoring system | |
CN106372200A (en) | Method and device for displaying picture resources | |
CN102724425B (en) | A kind of method that teletext template is broadcasted | |
KR20150085869A (en) | App-book builder system using hierarchical structure and timeline | |
CN103544263A (en) | Rendering method and rendering device for mobile terminal | |
TWI273459B (en) | Graphics rendering system and method thereof | |
Wong et al. | Flow‐Based Automatic Generation of Hybrid Picture Mazes | |
CN104361011A (en) | Dynamic color display implementation method and device | |
Fregonese et al. | The French Cultural Strategy and the Japanese Paradigm: How to Seduce in International Relations in the 21st Century? | |
Wang | Research on the development path of local opera communication in the age of convergence media | |
CN108510563A (en) | A kind of pattern rapid generation for imitating Art Deco Style Art-Deco and carrying out | |
CN113206910B (en) | Hierarchical visual interaction system, method, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170222 |