Cocos2dx BASICS (22) -- Scaling action ccgridaction

Source: Internet
Author: User

[Nagging]

In addition to the basic actions described in the previous section, ccactioninterval has many other extended actions.Ccgridaction. As the name suggests, the displayed content is divided into small grids, and then some graphics are transformed Based on the grids.


[Thank you]

Http://gl.paea.cn/contents/77054db9872b09b1.html

"Cocos2D-X game development technical explanation" Liu jianzhuo (don't misunderstand, I am not to sell the book 650) This. width = 650; "src =" http://img.baidu.com/hi/face/ I _f19.gif "alt =" I _f19.gif "/>)



Ccgridaction]

Ccgridaction has two subclasses: ccgrid3daction and cctiledgrid3daction. We are concerned with some lattice actions derived from these two subclasses.

(1)Ccgrid3daction:Is a grid-based action.

(2)Cctiledgrid3daction:Is a grid-based action.

Extended knowledge:The difference between a grid and a grid is that the display content of a ccnode object is divided in different ways. A grid represents a smaller and more number of grids. You don't need to know more about this. You just need to use it.


1. ccgrid3daction

Ccgrid3daction: a grid-based action.

Common actions are as follows:

/// *** Special shaking effect ** // 3D shaking (time, grid size, shaking range, and whether the Z axis is shaken); ccshaky3d: Create (float duration, const ccsize & gridsize, int range, bool shakez);/*** special liquid fluctuation effect * // fluctuation (time, grid size, fluctuation speed, amplitude, whether or not horizontal fluctuation, vertical fluctuations); ccwaves: Create (float duration, const ccsize & gridsize, unsigned int waves, float amplical, bool horizontal, bool vertical); // 3D fluctuations (time, grid size, fluctuation speed, amplitude); ccwaves3d: Create (float duration, const ccsize & gridsize, unsigned int waves, float amplitude); // liquid flow (time, grid size, speed, amplitude); ccliquid: Create (float duration, const ccsize & gridsize, unsigned int waves, float amplaves); // 3D water wave (time, grid size, coordinates, radius, speed, amplitude); ccripple3d: Create (float duration, const ccsize & gridsize, const ccpoint & position, float radius, unsigned int waves, float amplaves ); /*** flip effect * // flip the left and right sides of the X axis (time); ccflipx3d: Create (float duration); // flip the Y axis up and down (time); ccflipy3d :: create (float duration);/*** convex lens effect ** // convex lens (time, grid size, Center Coordinate, circle radius); cclens3d: Create (float duration, const ccsize & gridsize, const ccpoint & position, float radius);/*** special distortion effect * // twist (time, grid size, coordinates, number of distortions, amplitude ); cctwirl: Create (float duration, const ccsize & gridsize, ccpoint position, unsigned int twirls, float amplls);/*** special book flip effect * // page flip disappears (time, grid size); ccpageturn3d: Create (float duration, const ccsize & gridsize );//


Usage:

/// Ccshaky3d: Create (10, ccsizemake (), 10, true); // ccwaves: Create (10, ccsizemake ), 100, 10, true, true); ccwaves3d: Create (10, ccsizemake (100), 10); ccliquid: Create (10, ccsizemake (10, 10), 10, 10); ccripple3d: Create (10, ccsizemake (100,100), CCP (200,200), 50, 50, 50); // flip effect ccflipx3d: Create (1 ); ccflipy3d: Create (1); // special convex lens effect cclens3d: Create (10, ccsizemake (100,100), CCP (100,100), 150); // twist special effect cctwirl :: create (10, ccsizemake (200,200), CCP (), 5, 10); // book flip disappears ccpageturn3d: Create (10, ccsizemake (20, 20 ));//


2. cctiledgrid3daction

Cctiledgrid3daction: a grid-based action.

Common actions are as follows:

/// *** Special shaking effect ** // 3D grid shaking (time, grid size, shaking range, and whether the Z axis is shaken); ccshakytiles3d * Create (float duration, const ccsize & gridsize, int nrange, bool bshakez);/***** special fluctuation effect * // 3D tile fluctuation effect (time, grid size, fluctuation speed, amplitude ); ccwavestiles3d * Create (float duration, const ccsize & gridsize, unsigned int waves, float amplaves);/*** beat effect * // grid beat (time, grid size, times, amplitude); ccjumptiles3d * Create (float duration, const ccsize & gridsize, unsigned int numberofjumps, float amplps);/*** broken effect * // grid broken (time, grid size, shaking range, and whether to shake the Z axis); ccshatteredtiles3d * Create (float duration, const ccsize & gridsize, int nrange, bool bshatterz ); /*** shuffling effect * // random shuffling of the grid (time, grid size, random number); ccshuffletiles * Create (float duration, const ccsize & gridsize, unsigned int seed ); /*** special effect of disappearance * // top right to bottom left, peel off the grid (time, grid size); ccfadeoutbltiles * Create (float duration, const ccsize & gridsize ); // The bottom left to the upper right corner of the grid (time, grid size); ccfadeouttrtiles * Create (float duration, const ccsize & gridsize); // the top to the bottom row flags the grid (time, grid size); ccfadeoutdowntiles * Create (float duration, const ccsize & gridsize); // bottom-to-top, one row peeled off the grid (time, grid size); ccfadeoutuptiles * Create (float duration, const ccsize & gridsize); // The grid disappears randomly (time, grid size, random number); ccturnofftiles * Create (float duration, const ccsize & gridsize, unsigned int seed = 0 ); // disappear multiple rows (horizontal) (time, number of rows); ccsplitrows * Create (float duration, unsigned int nrows); // disappear multiple rows (vertical) (time, number of columns ); ccsplitcols * Create (float duration, unsigned int ncols );//


Usage:

/// Shake ccshakytiles3d: Create (10, ccsizemake (), 10, true); // fluctuating ccwavestiles3d: Create (10, ccsizemake (), 10, 10); // beating ccjumptiles3d: Create (10, ccsizemake (100), 5, 10); // broken ccshatteredtiles3d: Create (10, ccsizemake, true); // shuffling ccshuffletiles: Create (10, ccsizemake (10, 10), 100); // disappears ccfadeoutbltiles: Create (10, ccsizemake (10, 10); ccfadeouttrtiles :: create (10, ccsizemake (20, 20); ccfadeoutdowntiles: Create (10, ccsizemake (20, 20); values: Create (10, ccsizemake (20, 20); ccturnofftiles :: create (10, ccsizemake (20, 20), 100); ccsplitrows: Create (10, 10); ccsplitcols: Create (10, 10 );//


3. grid size

It is found that the above actions are created with the "grid size" parameter. What does this parameter mean?

The grid size is a ccsize class that specifies the width and height. The meaning here is not the width and height. It refers to the number of screens divided by width and height.

For example, the grid size is ccsizemake (5, 10 ). So the width is 5 and the height is 10.

As shown in:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/47/D5/wKiom1QAS6rhZu3JAABvYQ32Sk0085.jpg "Title =" 222.jpg" alt = "wkiom1qas6rhzu3jaabvyq32sk0085.jpg"/>


4. Grid and grid

The difference between a grid and a grid is as follows:

(1) Special shaking effects:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/47/D6/wKioL1QASzSSfCnNABDyLvq3-oU409.gif "style =" float: none; "Title =" 1.gif" alt = "wKioL1QASzSSfCnNABDyLvq3-oU409.gif"/>


650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/47/D6/wKioL1QASzbj5ZtgABJG9AAtb-Q149.gif "Title =" 11.gif" style = "white-space: normal; float: none;" alt = "wKioL1QASzbj5ZtgABJG9AAtb-Q149.gif"/>

(2) Special fluctuation effects

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/47/D4/wKiom1QASh7Sx5P_ABGtYB4nJCQ300.gif "style =" float: none; "Title =" 2.gif" alt = "wkiom1qash7sx5p_abgtyb4njcq300.gif"/>


650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/47/D6/wKioL1QASzfRnt0zABAPP3_EMf0150.gif "style =" float: none; "Title =" 22.gif" alt = "wkiol1qaszfrnt0zabapp3_emf0150.gif"/>




[Code practice]

Refer to the official testcpp project.



This article is from the "summer wind" blog, please be sure to keep this source http://shahdza.blog.51cto.com/2410787/1546641

Cocos2dx BASICS (22) -- Scaling action ccgridaction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.