本文整理汇总了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);
}
示例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;
}
示例3: drawCircle
void HelloWorld::drawCircle(const Point& location)
{
DrawNode *circle = DrawNode::create();
circle->drawDot(location, 10, Color4F::BLACK);
this->addChild(circle);
}
示例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);
}
示例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);
}