当前位置: 首页>>代码示例>>C++>>正文


C++ DrawNode::drawDot方法代码示例

本文整理汇总了C++中DrawNode::drawDot方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawNode::drawDot方法的具体用法?C++ DrawNode::drawDot怎么用?C++ DrawNode::drawDot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DrawNode的用法示例。


在下文中一共展示了DrawNode::drawDot方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: color

	TouchPoint(const Vec2 &touchPoint, const Color3B &touchColor)
	{
		m_point = touchPoint;
		DrawNode* drawNode = DrawNode::create();
		auto s = Director::getInstance()->getWinSize();
		Color4F color(touchColor.r / 255.0f, touchColor.g / 255.0f, touchColor.b / 255.0f, 1.0f);
		drawNode->drawLine(Vec2(0, touchPoint.y), Vec2(s.width, touchPoint.y), color);
		drawNode->drawLine(Vec2(touchPoint.x, 0), Vec2(touchPoint.x, s.height), color);
		drawNode->drawDot(touchPoint, 3, color);
		addChild(drawNode);
	}
开发者ID:HScarb,项目名称:tapthezergling,代码行数:11,代码来源:DoubleTapScene.cpp

示例2:

BallSprite *BallSprite::createParticleSprite(Node *parent ,b2World *world, b2ParticleSystem *particleSystem, b2ParticleGroup *particleGroup,const std::string& filename) {
    
    BallSprite* pInstance = (BallSprite *)Sprite::create();
    //BallSprite* pInstance = BallSprite::createBallSprite(parent,world,filename);
    pInstance->setTexture(filename);
    parent->addChild(pInstance);
    
    // 描画用ノードの作成
    DrawNode* draw = DrawNode::create();
    draw->setPosition(Vec2(0, 0));
    pInstance->addChild(draw);
    
    /* 円の描画 */
    draw->drawDot(Vec2(pInstance->getBallRadius()/2, pInstance->getBallRadius()/2), // 中心
                  pInstance->getBallRadius(),                        // 半径
                  Color4F(1, 0.5f, 0, 200)                  // 色
                  );
    
    
    particleSystem->SetRadius(getBallRadius()*1.2/PTM_RATIO);
    
    b2ParticleDef particleDef;
    
    //パーティクルの寿命
    //particleDef.lifetime = 2.0f;
    
    //particleDef.flags = b2_dynamicBody;
    particleDef.flags = b2_waterParticle;
    particleDef.flags |= b2_destructionListenerParticle;
    particleDef.color = b2ParticleColor(100,150,255,255);
    //particleDef.velocity.y = -100;
    
    //グループへのポインタを渡しておく事でそのグループ内で管理する事ができる。
    particleDef.group = particleGroup;
    particleDef.flags = b2_waterParticle;
    
   
    //void** userdata = particleSystem->GetUserDataBuffer();
    particleDef.userData = pInstance;
    particleSystem->CreateParticle(particleDef);
    
    return pInstance;

}
开发者ID:tigerwoods1206,项目名称:LiquidFunClassOnly,代码行数:44,代码来源:BallSprite.cpp

示例3: drawCircle

void HelloWorld::drawCircle(const Point& location)
{
	DrawNode *circle = DrawNode::create();
	circle->drawDot(location, 10, Color4F::BLACK);
	this->addChild(circle);
}
开发者ID:wt0317,项目名称:TraceEm,代码行数:6,代码来源:HelloWorldScene.cpp

示例4: drawDot

void GeographicUtility::drawDot(cocos2d::Layer* layer, Vec2 position) {
    DrawNode* node = DrawNode::create();
    node->drawDot(Vec2(0, 0), 10, Color4F(1.0f, 0.0f, 0.0f, 0.5f));
    node->setPosition(position);
    layer->addChild(node, GeographicUtility::DRAW_DOT_DEPTH);
}
开发者ID:ucreates,项目名称:clone_cofc,代码行数:6,代码来源:GeographicUtility.cpp

示例5: DrawDot

static void DrawDot(cpFloat size, cpVect pos, cpSpaceDebugColor color, cpDataPointer data)
{
    const Color4F dotColor(color.r, color.g, color.b, color.a);
    DrawNode* drawNode = static_cast<DrawNode*>(data);
    drawNode->drawDot(PhysicsHelper::cpv2point(pos), 2, dotColor);
}
开发者ID:114393824,项目名称:Cocos2dxShader,代码行数:6,代码来源:CCPhysicsWorld.cpp


注:本文中的DrawNode::drawDot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。