这篇教程C++ CGPointMake函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CGPointMake函数的典型用法代码示例。如果您正苦于以下问题:C++ CGPointMake函数的具体用法?C++ CGPointMake怎么用?C++ CGPointMake使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CGPointMake函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: CGPointMakevoid SpriteEaseBounceInOut::onEnter(){ EaseSpriteDemo::onEnter(); CCActionInterval* move = CCMoveBy::actionWithDuration(3, CGPointMake(350,0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease = CCEaseBounceInOut::actionWithAction((CCActionInterval*)(move->copy()->autorelease()) ); CCActionInterval* move_ease_back = move_ease->reverse(); CCFiniteTimeAction* seq1 = CCSequence::actions( move, move_back, NULL); CCFiniteTimeAction* seq2 = CCSequence::actions( move_ease, move_ease_back, NULL); this->positionForTwo(); m_grossini->runAction( CCRepeatForever::actionWithAction((CCActionInterval*)seq1)); m_tamara->runAction( CCRepeatForever::actionWithAction((CCActionInterval*)seq2));}
开发者ID:valentinvit,项目名称:cocos2d-x,代码行数:18,
示例2: mac_warp_mousevoidmac_warp_mouse(){#ifndef ACTIVEGS Rect port_rect; Point win_origin_pt; CGPoint cgpoint; CGDisplayErr cg_err; GetPortBounds(GetWindowPort(g_main_window), &port_rect); SetPt(&win_origin_pt, port_rect.left, port_rect.top); LocalToGlobal(&win_origin_pt); cgpoint = CGPointMake( (float)(win_origin_pt.h + X_A2_WINDOW_WIDTH/2), (float)(win_origin_pt.v + X_A2_WINDOW_HEIGHT/2)); cg_err = CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);#endif}
开发者ID:chinnytp,项目名称:kegs,代码行数:18,
示例3: alignSpritesLeft//------------------------------------------------------------------//// ActionRepeat////------------------------------------------------------------------void ActionRepeat::onEnter(){ ActionsDemo::onEnter(); alignSpritesLeft(2); CCActionInterval* a1 = CCMoveBy::actionWithDuration(1, CGPointMake(150,0)); CCActionInterval* action1 = CCRepeat::actionWithAction( CCSequence::actions( CCPlace::actionWithPosition(CGPointMake(60,60)), a1, NULL) , 3); CCAction* action2 = CCRepeatForever::actionWithAction( (CCActionInterval*)(CCSequence::actions((CCActionInterval*)(a1->copy()->autorelease()), a1->reverse(), NULL)) ); m_kathia->runAction(action1); m_tamara->runAction(action2);}
开发者ID:shootan,项目名称:Terraria,代码行数:23,
示例4: centerSprites//------------------------------------------------------------------//// ActionBezier////------------------------------------------------------------------void ActionBezier::onEnter(){ ActionsDemo::onEnter(); CGSize s = CCDirector::sharedDirector()->getWinSize(); // // startPosition can be any coordinate, but since the movement // is relative to the Bezier curve, make it (0,0) // centerSprites(3); // sprite 1 ccBezierConfig bezier; bezier.controlPoint_1 = CGPointMake(0, s.height/2); bezier.controlPoint_2 = CGPointMake(300, -s.height/2); bezier.endPosition = CGPointMake(300,100); CCActionInterval* bezierForward = CCBezierBy::actionWithDuration(3, bezier); CCActionInterval* bezierBack = bezierForward->reverse(); CCAction* rep = CCRepeatForever::actionWithAction((CCActionInterval*)CCSequence::actions( bezierForward, bezierBack, NULL)); // sprite 2 m_tamara->setPosition(CGPointMake(80,160)); ccBezierConfig bezier2; bezier2.controlPoint_1 = CGPointMake(100, s.height/2); bezier2.controlPoint_2 = CGPointMake(200, -s.height/2); bezier2.endPosition = CGPointMake(240,160); CCActionInterval* bezierTo1 = CCBezierTo::actionWithDuration(2, bezier2); // sprite 3 m_kathia->setPosition(CGPointMake(400,160)); CCActionInterval* bezierTo2 = CCBezierTo::actionWithDuration(2, bezier2); m_grossini->runAction( rep); m_tamara->runAction(bezierTo1); m_kathia->runAction(bezierTo2);}
开发者ID:shootan,项目名称:Terraria,代码行数:47,
示例5: CGRectMakevoid GraphicsLayerCACF::updateLayerSize(){ CGRect rect = CGRectMake(0, 0, m_size.width(), m_size.height()); if (m_transformLayer) { m_transformLayer->setBounds(rect); // The anchor of the contents layer is always at 0.5, 0.5, so the position is center-relative. CGPoint centerPoint = CGPointMake(m_size.width() / 2.0f, m_size.height() / 2.0f); m_layer->setPosition(centerPoint); } m_layer->setBounds(rect); // Note that we don't resize m_contentsLayer. It's up the caller to do that. // if we've changed the bounds, we need to recalculate the position // of the layer, taking anchor point into account. updateLayerPosition();}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:18,
示例6: TIPGradientFindEndpointsForRotation// angle in degreesvoid TIPGradientFindEndpointsForRotation( CGRect rect, float angle, CGPoint *startPoint, CGPoint *endPoint){ if(angle == 0) { *startPoint = CGPointMake(rect.origin.x, rect.origin.y); //right of rect *endPoint = CGPointMake(rect.origin.x + rect.size.width, rect.origin.y); //left of rect } else if(angle == 90) { *startPoint = CGPointMake(rect.origin.x, rect.origin.y); //bottom of rect *endPoint = CGPointMake(rect.origin.x, rect.origin.y + rect.size.height); //top of rect } else { float x,y; float sina, cosa, tana; float length; float deltax, deltay; float rangle = angle * pi/180; //convert the angle to radians if(fabsf(tanf(rangle))<=1) //for range [-45,45], [135,225] { x = rect.size.width; y = rect.size.height; sina = sin(rangle); cosa = cos(rangle); tana = tan(rangle); length = x/fabsf(cosa)+(y-x*fabsf(tana))*fabsf(sina); deltax = length*cosa/2; deltay = length*sina/2; } else //for range [45,135], [225,315] { x = rect.size.height; y = rect.size.width; sina = sin(rangle - 90*pi/180); cosa = cos(rangle - 90*pi/180); tana = tan(rangle - 90*pi/180); length = x/fabsf(cosa)+(y-x*fabsf(tana))*fabsf(sina); deltax =-length*sina/2; deltay = length*cosa/2; } *startPoint = CGPointMake( (rect.origin.x+rect.size.width/2.0f)-deltax, (rect.origin.y+rect.size.height/2.0f)-deltay); *endPoint = CGPointMake( (rect.origin.x+rect.size.width/2.0f)+deltax, (rect.origin.y+rect.size.height/2.0f)+deltay); }}
开发者ID:samiamwork,项目名称:Questionable,代码行数:52,
示例7: SendMouseMovestatic inline void SendMouseMove(int X, int Y) { CGPoint point = GetMouseLoc(); CGRect ssize = CGDisplayBounds(CGMainDisplayID()); int newX = point.x + X, newY = point.y + Y; newX = newX < 0 ? 0 : newX; newY = newY < 0 ? 0 : newY; newX = newX > ssize.size.width - 1 ? ssize.size.width - 1 : newX; newY = newY > ssize.size.height - 2 ? ssize.size.height - 1 : newY; CGEventRef move = CGEventCreateMouseEvent( NULL, kCGEventMouseMoved, CGPointMake(newX, newY), kCGMouseButtonLeft // ignored ); CGEventPost(kCGHIDEventTap, move); CFRelease(move);}
开发者ID:shengyu7697,项目名称:SimpleComputerRemote,代码行数:19,
示例8: TilePDFWithCGLayervoid TilePDFWithCGLayer(CGContextRef context, CFURLRef url){ // Again this should really be computed based on // the area intended to be tiled. float fillwidth = 612., fillheight = 792.; CGSize s; float tileX, tileY, tileOffsetX, tileOffsetY; float w, h; CGLayerRef layer = createLayerWithImageForContext(context, url); if(layer == NULL){ fprintf(stderr, "Couldn't create the layer!/n"); return; } // Compute the tile size and offset. s = CGLayerGetSize(layer); tileX = s.width; tileY = s.height;#if DOSCALING // Space the tiles by the tile width and height // plus an extra 2 units in each dimension. tileOffsetX = 2. + tileX; tileOffsetY = 2. + tileY;#else // Add 6 units to the offset in each direction // if there is no scaling of the source PDF document. tileOffsetX = 6. + tileX; tileOffsetY = 6. + tileY;#endif // Now draw the contents of the layer to the context. // The layer is drawn at its true size (the size of // the tile) with its origin located at the corner // of each tile. for(h = 0; h < fillheight ; h += tileOffsetY) for(w = 0; w < fillwidth ; w += tileOffsetX){ CGContextDrawLayerAtPoint(context, CGPointMake(w, h), layer); } // Release the layer when done drawing with it. CGLayerRelease(layer);}
开发者ID:yarshure,项目名称:ProgrammingWithQuartz-Code,代码行数:43,
示例9: GiveFocusToScreenvoid GiveFocusToScreen(int ScreenIndex){ screen_info *Screen = GetDisplayFromScreenID(ScreenIndex); if(Screen) { CGPoint CursorPos = CGPointMake(Screen->X + (Screen->Width / 2), Screen->Y + (Screen->Height / 2)); CGEventRef MoveEvent = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, CursorPos, kCGMouseButtonLeft); CGEventSetFlags(MoveEvent, 0); CGEventPost(kCGHIDEventTap, MoveEvent); CFRelease(MoveEvent); DEBUG("GiveFocusToScreen() " << ScreenIndex) UpdateActiveWindowList(Screen); tree_node *NewFocusNode = GetFirstLeafNode(Screen->Space[Screen->ActiveSpace].RootNode); SetWindowFocusByNode(NewFocusNode); }}
开发者ID:sukee,项目名称:kwm,代码行数:19,
示例10: CGPointMake//------------------------------------------------------------------//// TestLayer////------------------------------------------------------------------void TestLayer::onEnter(){ CCLayer::onEnter(); float x,y; CGSize size = CCDirector::sharedDirector()->getWinSize(); x = size.width; y = size.height; //NSArray *array = [UIFont familyNames]; //for( NSString *s in array ) // NSLog( s ); CCLabel* label = CCLabel::labelWithString("cocos2d", "Tahoma", 64); label->setPosition( CGPointMake(x/2,y/2) ); addChild(label);}
开发者ID:charlesa101,项目名称:cocos2d-x,代码行数:24,
示例11: selectAreaMacbool GTMouseDriver::moveTo(const QPoint& p){ int x = p.x(); int y = p.y(); if (bp.testFlag(Qt::LeftButton)) { return selectAreaMac(x, y); } DRIVER_CHECK(isPointInsideScreen(x, y), "Invalid coordinates"); CGEventRef event = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, CGPointMake(x, y), 0 /*ignored*/); DRIVER_CHECK(event != NULL, "Can't create event"); CGEventPost(kCGSessionEventTap, event); CFRelease(event); GTGlobals::sleep(100); return true;}
开发者ID:ugeneunipro,项目名称:QSpec,代码行数:19,
示例12: CGEventCreateMouseEventvoid XInputSimulatorImplMacOs::mouseMoveTo(int x, int y){ //TODO screen check see moveRelative CGEventRef mouseEv = CGEventCreateMouseEvent( NULL, kCGEventMouseMoved, CGPointMake(x, y), kCGMouseButtonLeft); std::cout << "mv: " << mouseEv << std::endl; CGEventPost(kCGHIDEventTap, mouseEv); CFRelease(mouseEv); this->currentX = x; this->currentY = y;}
开发者ID:thisispoker,项目名称:alphapoker,代码行数:19,
示例13: ActivateScreenvoid ActivateScreen(screen_info *Screen){ CGPoint CursorPos = GetCursorPos(); CGPoint ClickPos = CGPointMake(Screen->X, Screen->Y); CGEventRef MoveEvent = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, ClickPos, kCGMouseButtonLeft); CGEventSetFlags(MoveEvent, 0); CGEventPost(kCGHIDEventTap, MoveEvent); CFRelease(MoveEvent); MoveEvent = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseUp, ClickPos, kCGMouseButtonLeft); CGEventSetFlags(MoveEvent, 0); CGEventPost(kCGHIDEventTap, MoveEvent); CFRelease(MoveEvent); MoveEvent = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, CursorPos, kCGMouseButtonLeft); CGEventSetFlags(MoveEvent, 0); CGEventPost(kCGHIDEventTap, MoveEvent); CFRelease(MoveEvent);}
开发者ID:sukee,项目名称:kwm,代码行数:20,
示例14: CGPointMakevoid MacOSMouseOStream::doubleClick(pair<uint32_t, uint32_t> mouse, int clickCount) {#if __APPLE__ CGPoint point = CGPointMake(mouse.first, mouse.second); CGEventRef theEvent = CGEventCreateMouseEvent( NULL, kCGEventLeftMouseDown, point, kCGMouseButtonLeft); ProcessSerialNumber psn = { 0, kNoProcess }; GetFrontProcess( &psn ); CGEventSetIntegerValueField(theEvent, kCGMouseEventClickState, clickCount); CGEventPostToPSN(&psn, theEvent); CGEventSetType(theEvent, kCGEventLeftMouseUp); CGEventPostToPSN(&psn, theEvent); CGEventSetType(theEvent, kCGEventLeftMouseDown); CGEventPostToPSN(&psn, theEvent); CGEventSetType(theEvent, kCGEventLeftMouseUp); CGEventPostToPSN(&psn, theEvent); CFRelease(theEvent);#endif}
开发者ID:damellis,项目名称:ESP,代码行数:20,
示例15: setCursorPosFREObject setCursorPos(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]){ int tx = 0; int ty = 0; FREGetObjectAsInt32(argv[0], &tx); FREGetObjectAsInt32(argv[1], &ty); //as3Print("Set cursor pos /n");//,tx,ty); CGPoint point; point.x = tx; point.y = ty; CGAssociateMouseAndMouseCursorPosition(true); //CGWarpMouseCursorPosition(point); // printf("Error : %i/n",error); CGDisplayMoveCursorToPoint(CGMainDisplayID(),point); CGAssociateMouseAndMouseCursorPosition(true); CGEventRef mouse = CGEventCreateMouseEvent (NULL, kCGEventMouseMoved, CGPointMake(tx, ty),0); CGEventPost(kCGHIDEventTap, mouse); CFRelease(mouse); CGEventRef event = CGEventCreate(NULL); CGPoint cursorGet = CGEventGetLocation(event); CFRelease(event); char msg[256]; sprintf(msg,"After set, check pos %f %f/n",cursorGet.x, cursorGet.y); //as3Print(msg); FREObject result; FRENewObjectFromBool(1, &result); //FRENewObjectFromBool(true,&result); return result;}
开发者ID:benkuper,项目名称:AIR-NativeExtensions,代码行数:40,
示例16: quartzgen_textparavoid quartzgen_textpara(GVJ_t *job, pointf p, textpara_t *para){ CGContextRef context = (CGContextRef)job->context; /* adjust text position */ switch (para->just) { case 'r': p.x -= para->width; break; case 'l': p.x -= 0.0; break; case 'n': default: p.x -= para->width / 2.0; break; } p.y += para->yoffset_centerline; void* layout; if (para->free_layout == &quartz_free_layout) layout = para->layout; else layout = quartz_new_layout(para->fontname, para->fontsize, para->str); #if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000 CGContextSaveGState(context); CGContextScaleCTM(context, 1.0, -1.0); p.y = -p.y - para->yoffset_layout;#endif CGContextSetRGBFillColor(context, job->obj->pencolor.u.RGBA[0], job->obj->pencolor.u.RGBA[1], job->obj->pencolor.u.RGBA[2], job->obj->pencolor.u.RGBA[3]); quartz_draw_layout(layout, context, CGPointMake(p.x, p.y)); #if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000 CGContextRestoreGState(context);#endif if (para->free_layout != &quartz_free_layout) quartz_free_layout(layout);}
开发者ID:nyue,项目名称:graphviz-cmake,代码行数:40,
示例17: CGPointMake//------------------------------------------------------------------//// PongLayer////------------------------------------------------------------------PongLayer::PongLayer(){ m_ballStartingVelocity = CGPointMake(20.0f, -100.0f); m_ball = Ball::ballWithTexture( CCTextureCache::sharedTextureCache()->addImage(s_Ball) ); m_ball->setPosition( CGPointMake(160.0f, 240.0f) ); m_ball->setVelocity( m_ballStartingVelocity ); addChild( m_ball ); m_ball->retain(); CCTexture2D* paddleTexture = CCTextureCache::sharedTextureCache()->addImage(s_Paddle); NSMutableArray<NSObject *> *paddlesM = new NSMutableArray<NSObject *>(4); Paddle* paddle = Paddle::paddleWithTexture(paddleTexture); paddle->setPosition( CGPointMake(160, 15) ); paddlesM->addObject( paddle ); paddle = Paddle::paddleWithTexture( paddleTexture ); paddle->setPosition( CGPointMake(160, 480 - kStatusBarHeight - 15) ); paddlesM->addObject( paddle ); paddle = Paddle::paddleWithTexture( paddleTexture ); paddle->setPosition( CGPointMake(160, 100) ); paddlesM->addObject( paddle ); paddle = Paddle::paddleWithTexture( paddleTexture ); paddle->setPosition( CGPointMake(160, 480 - kStatusBarHeight - 100) ); paddlesM->addObject( paddle ); m_paddles = paddlesM->copy(); NSMutableArray<NSObject *>::NSMutableArrayIterator it; for(it = m_paddles->begin(); it != m_paddles->end(); it++) { paddle = (Paddle*)(*it); if(!paddle) break; addChild(paddle); } paddlesM->release(); schedule( schedule_selector(PongLayer::doStep) );}
开发者ID:charlesa101,项目名称:cocos2d-x,代码行数:52,
示例18: mainint main(int argc, char *argv[]) { if (argc > 2) { int x = atoi(argv[1]); int y = atoi(argv[2]); // click settings CGEventRef click = CGEventCreateMouseEvent( NULL, kCGEventLeftMouseDown, CGPointMake(x,y), kCGMouseButtonLeft ); // perform click CGEventPost(kCGHIDEventTap, click); CFRelease(click); } return 0;}
开发者ID:summea,项目名称:click-here,代码行数:23,
示例19: NALineIntersectionCGPoint NALineIntersection(const CGPoint start1, const CGPoint end1, const CGPoint start2, const CGPoint end2) { /* Setup the system of equations. */ CGFloat a = end1.x - start1.x; CGFloat b = -end2.x + start2.x; CGFloat c = end1.y - start1.y; CGFloat d = -end2.y + start2.y; CGFloat det = a * d - b * c; /* Check if the system is singular. */ if (IS_EPSILON(det)) { return CGPOINT_INVALID; } /* Otherwise, find the intersection point. */ CGFloat aInv = d / det; CGFloat bInv = -b / det; CGFloat cInv = -c / det; CGFloat dInv = a / det; CGFloat x = aInv * (start2.x - start1.x) + bInv * (start2.y - start1.y); CGFloat y = cInv * (start2.x - start1.x) + dInv * (start2.y - start1.y); /* If the intersection point does not lie within the line segments, also return CGPOINT_INVALID. */ if ((x < 0.0) || (x > 1.0) || (y < 0.0) || (y > 1.0)) { return CGPOINT_INVALID; } /* Otherwise return the result. */ return CGPointMake(start1.x + x * (end1.x - start1.x), start1.y + x * (end1.y - start1.y));}
开发者ID:LambertPark,项目名称:LPWebSocket,代码行数:37,
示例20: assertbool CCFollow::initWithTarget(CCNode *pFollowedNode, CGRect rect){ assert(pFollowedNode != NULL); pFollowedNode->retain(); m_pobFollowedNode = pFollowedNode; m_bBoundarySet = true; m_bBoundaryFullyCovered = false; CGSize winSize = CCDirector::sharedDirector()->getWinSize(); m_obFullScreenSize = CGPointMake(winSize.width, winSize.height); m_obHalfScreenSize = ccpMult(m_obFullScreenSize, 0.5f); m_fLeftBoundary = -((rect.origin.x+rect.size.width) - m_obFullScreenSize.x); m_fRightBoundary = -rect.origin.x ; m_fTopBoundary = -rect.origin.y; m_fBottomBoundary = -((rect.origin.y+rect.size.height) - m_obFullScreenSize.y); if(m_fRightBoundary < m_fLeftBoundary) { // screen width is larger than world's boundary width //set both in the middle of the world m_fRightBoundary = m_fLeftBoundary = (m_fLeftBoundary + m_fRightBoundary) / 2; } if(m_fTopBoundary < m_fBottomBoundary) { // screen width is larger than world's boundary width //set both in the middle of the world m_fTopBoundary = m_fBottomBoundary = (m_fTopBoundary + m_fBottomBoundary) / 2; } if( (m_fTopBoundary == m_fBottomBoundary) && (m_fLeftBoundary == m_fRightBoundary) ) { m_bBoundaryFullyCovered = true; } return true;}
开发者ID:valentinvit,项目名称:cocos2d-x,代码行数:36,
示例21: CGPointMakeTestLayer2::TestLayer2(){ float x,y; CGSize size = CCDirector::sharedDirector()->getWinSize(); x = size.width; y = size.height; CCSprite* bg1 = CCSprite::spriteWithFile(s_back2); bg1->setPosition( CGPointMake(size.width/2, size.height/2) ); addChild(bg1, -1); CCLabelTTF* title = CCLabelTTF::labelWithString((transitions[s_nSceneIdx]).c_str(), "Thonburi", 32 ); addChild(title); title->setColor( ccc3(255,32,32) ); title->setPosition( CGPointMake(x/2, y-100) ); CCLabelTTF* label = CCLabelTTF::labelWithString("SCENE 2", "Marker Felt", 38); label->setColor( ccc3(16,16,255)); label->setPosition( CGPointMake(x/2,y/2)); addChild( label); // menu CCMenuItemImage *item1 = CCMenuItemImage::itemFromNormalImage(s_pPathB1, s_pPathB2, this, menu_selector(TestLayer2::backCallback) ); CCMenuItemImage *item2 = CCMenuItemImage::itemFromNormalImage(s_pPathR1, s_pPathR2, this, menu_selector(TestLayer2::restartCallback) ); CCMenuItemImage *item3 = CCMenuItemImage::itemFromNormalImage(s_pPathF1, s_pPathF2, this, menu_selector(TestLayer2::nextCallback) ); CCMenu *menu = CCMenu::menuWithItems(item1, item2, item3, NULL); menu->setPosition( CGPointZero ); item1->setPosition( CGPointMake( x/2 - 100,30) ); item2->setPosition( CGPointMake( x/2, 30) ); item3->setPosition( CGPointMake( x/2 + 100,30) ); addChild(menu, 1); schedule(schedule_selector(TestLayer2::step), 1.0f);}
开发者ID:valentinvit,项目名称:cocos2d-x,代码行数:38,
示例22: ifvoid ActionsDemo::alignSpritesLeft(unsigned int numberOfSprites){ CGSize s = CCDirector::sharedDirector()->getWinSize(); if( numberOfSprites == 1 ) { m_tamara->setIsVisible(false); m_kathia->setIsVisible(false); m_grossini->setPosition(CGPointMake(60, s.height/2)); } else if( numberOfSprites == 2 ) { m_kathia->setPosition( CGPointMake(60, s.height/3)); m_tamara->setPosition( CGPointMake(60, 2*s.height/3)); m_grossini->setIsVisible( false ); } else if( numberOfSprites == 3 ) { m_grossini->setPosition( CGPointMake(60, s.height/2)); m_tamara->setPosition( CGPointMake(60, 2*s.height/3)); m_kathia->setPosition( CGPointMake(60, s.height/3)); }}
开发者ID:shootan,项目名称:Terraria,代码行数:23,
示例23: CGPointIntPoint::operator CGPoint() const{ return CGPointMake(m_x, m_y);}
开发者ID:3163504123,项目名称:phantomjs,代码行数:4,
示例24: CCParticleSystemPoint//------------------------------------------------------------------//// DemoModernArt////------------------------------------------------------------------void DemoModernArt::onEnter(){ ParticleDemo::onEnter(); m_emitter = new CCParticleSystemPoint(); m_emitter->initWithTotalParticles(1000); //m_emitter->autorelease(); m_background->addChild(m_emitter, 10); ////m_emitter->release(); CGSize s = CCDirector::sharedDirector()->getWinSize(); // duration m_emitter->setDuration(-1); // gravity m_emitter->setGravity(CGPointMake(0,0)); // angle m_emitter->setAngle(0); m_emitter->setAngleVar(360); // radial m_emitter->setRadialAccel(70); m_emitter->setRadialAccelVar(10); // tagential m_emitter->setTangentialAccel(80); m_emitter->setTangentialAccelVar(0); // speed of particles m_emitter->setSpeed(50); m_emitter->setSpeedVar(10); // emitter position m_emitter->setPosition( CGPointMake( s.width/2, s.height/2) ); m_emitter->setPosVar(CGPointZero); // life of particles m_emitter->setLife(2.0f); m_emitter->setLifeVar(0.3f); // emits per frame m_emitter->setEmissionRate(m_emitter->getTotalParticles()/m_emitter->getLife()); // color of particles ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; m_emitter->setStartColor(startColor); ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; m_emitter->setStartColorVar(startColorVar); ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; m_emitter->setEndColor(endColor); ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; m_emitter->setEndColorVar(endColorVar); // size, in pixels m_emitter->setStartSize(1.0f); m_emitter->setStartSizeVar(1.0f); m_emitter->setEndSize(32.0f); m_emitter->setEndSizeVar(8.0f); // texture m_emitter->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_fire) ); // additive m_emitter->setIsBlendAdditive(false); setEmitterPosition();}
开发者ID:geniikw,项目名称:myFirst2DGame,代码行数:78,
示例25: CCParticleSystemQuad//------------------------------------------------------------------//// DemoRotFlower////------------------------------------------------------------------void DemoRotFlower::onEnter(){ ParticleDemo::onEnter(); m_emitter = new CCParticleSystemQuad(); m_emitter->initWithTotalParticles(300); //m_emitter->autorelease(); m_background->addChild(m_emitter, 10); ////m_emitter->release(); // win32 : Remove this line m_emitter->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_stars2) ); // duration m_emitter->setDuration(-1); // gravity m_emitter->setGravity(CGPointZero); // angle m_emitter->setAngle(90); m_emitter->setAngleVar(360); // speed of particles m_emitter->setSpeed(160); m_emitter->setSpeedVar(20); // radial m_emitter->setRadialAccel(-120); m_emitter->setRadialAccelVar(0); // tagential m_emitter->setTangentialAccel(30); m_emitter->setTangentialAccelVar(0); // emitter position m_emitter->setPosition( CGPointMake(160,240) ); m_emitter->setPosVar(CGPointZero); // life of particles m_emitter->setLife(3); m_emitter->setLifeVar(1); // spin of particles m_emitter->setStartSpin(0); m_emitter->setStartSpinVar(0); m_emitter->setEndSpin(0); m_emitter->setEndSpinVar(2000); // color of particles ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f}; m_emitter->setStartColor(startColor); ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f}; m_emitter->setStartColorVar(startColorVar); ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f}; m_emitter->setEndColor(endColor); ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f}; m_emitter->setEndColorVar(endColorVar); // size, in pixels m_emitter->setStartSize(30.0f); m_emitter->setStartSizeVar(00.0f); m_emitter->setEndSize(kParticleStartSizeEqualToEndSize); // emits per second m_emitter->setEmissionRate(m_emitter->getTotalParticles()/m_emitter->getLife()); // additive m_emitter->setIsBlendAdditive(false); setEmitterPosition();}
开发者ID:geniikw,项目名称:myFirst2DGame,代码行数:79,
注:本文中的CGPointMake函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CG_AdjustFrom640函数代码示例 C++ CGMainDisplayID函数代码示例 |