.
Rateaction. The default value of the additional parameter is 1.0.
Sinein
Sineinout
Sineout
This function can complete the speed effect in motion, as well as cccallfunc, ccdelaytime and other functions. If you append them together, you don't need to write tedious function nesting and ccsequence. Liao Dazhen wrote it to my heart. Like this,
transition.execute(sprite, CCMoveTo:create(1.5, CCPoint(display.cx, display.cy)), { delay = 1.0, easing = "backout", onComplete = function()
coocs2dx-lua and define a class in the class.
Snsprite. h
//// SNSprite.h// LuaDemo//// Created by LiuYanghui on 13-4-8.////#ifndef __LuaDemo__SNSprite__#define __LuaDemo__SNSprite__#include "cocos2d.h"USING_NS_CC;class SNSprite : public CCSprite{public: static SNSprite* create(const char* name); private: void initData();};#endif /* defined(__LuaDemo__SNSprite__) */
Snsprite. cpp
//// SNSprite.cpp// LuaDemo//// Created by LiuYanghui on 13-4-8.////#include "SNSprite.h"SNSprit
Understanding of cocos2d-x ios game development (5) CCsprite genie
This time I will write several types created by the genie:
1. Create a file:
Add the following code on the original basis:
// 1. Create an genie through a file
CCSprite * bg = CCSprite: create ("map.png ");
CCSize winSize = CCDirector: sharedDirector ()-> getWinSize (); // obtain the screen size.
Bg-> setPosition (ccp (winSize. width/2, winSize. height/2 ));
This-> addChild (bg );
Ret
smallest units for reuse. The architect should put reusable classes in the package. 3.1.2 principle of joint closure the common closure principle (CCP) 2 Put the changed classes together. Classes that change together, belong together. A large development project is usually divided into many mesh packages. Managing, testing, and releasing these packages is not trivial. In any released version, the larger the number of changed packages, the more rec
Like cctextfieldttf, The cceditbox control is also a control for displaying text.
Let's take an example to see how the cceditbox control displays text.
First, add a nine-bitmap to the resource folder under the project directory.
Program code:
#include "TCCEditBox.h"CCScene* TCCEditBox::scene(){ CCScene* scene = CCScene::create(); TCCEditBox* layer = TCCEditBox::create(); scene->addChild(layer); return scene;}bool TCCEditBox::init(){ //初始化父类层 CCLayer::init();
::sharedSpriteFrameCache();this->_directionCache->addSpriteFramesWithFile("dhkey/direction.plist");this->_directionCache->retain();this->_directionBatchNode =CCSpriteBatchNode::create("dhkey/direction.pvr.ccz");this->_directionBatchNode->retain();this->addChild(this->_directionBatchNode);}DirectionLayer::~DirectionLayer(void){this->_directionBatchNode->release();this->_directionCache->release();}bool DirectionLayer::init(){if(!CCLayer::init()){return false;}this->initDirectionSprite();return tru
-oriented_design) Common Closure Principle (CCP) – Common closure principleAll classes in a package should be closed for changes of the same type. A change affects a package, which affects all classes in the package. A shorter argument is that classes that are modified together should be grouped together (in the same package). If you have to modify the code in the application, we want all of the changes to occur in one package (modify close) instead
principleHigh-level modules should not rely on the implementation of low-level modules, but rather on high-layer abstractions.For example, the wall switch should not rely on the switch implementation of the lamp, but should rely on an abstract switch standard interface, so that when we extend the program, our switch can also control other different lights, and even different electrical appliances. That is, electric lights and other electrical appliances inherit and implement our standard switch
("Shuijiemian.png"); AddChild (sprite); AddChild (sprite1); Sprite->setposition (CCP (WINSIZE.WIDTH/2, Winsize.height)); Sprite1->setposition (CCP (WINSIZE.WIDTH/2, Winsize.height)); Hide result sprite->setvisible (false); Sprite1->setvisible (false); Indicates that the game result is not displayed visible = false;Create a member function Howresult (ccsprite* Sprite, Ccsize w
)))-------------------------------------Examples: Local screen = cc. Director:getinstance (): Getrunningscene () Local action1 = cc. Scaleto:create (0.5, 1)--magnification parameter: time and scale size local action2 = cc. Moveto:create (0.5, CCP (300,330))--Move to a location local Action3 = CC. Scaleto:create (0.2, 0.6)--Zoom Out parameter: Time and scale size local action4 = cc. Fadeout:create (2)--fade out local action5 = cc. Moveto:create (2,
Jlink api sdk c # offline data acquisition calibration,
How does jlink leave the keil and IAR monitoring variables?Currently, jlink APIs can be implemented. You can use C # As a host computer to monitor the variables in RAM. You do not need to enable keil debugging. Flash can also be used for product mass production. SEGGER's jlink sdk is not free of charge. Many problems may occur during API debugging, such as the type of input and output data of function variables. The solution is based on sp
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.