本文整理汇总了C++中setFillColor函数的典型用法代码示例。如果您正苦于以下问题:C++ setFillColor函数的具体用法?C++ setFillColor怎么用?C++ setFillColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFillColor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MapItem
Zone::Zone(QGraphicsItem *parent) :
MapItem(parent)
{
// Set parameters
width = 501;
height = 512;
setLineColor(QColor(Qt::white));
setFillColor(QColor(Qt::white));
}
示例2: initPaddle
/**
* Instantiates paddle in bottom-middle of window.
*/
GRect initPaddle(GWindow window)
{
GRect paddle = newGRect(((WIDTH/2)-35), 550, P_WIDTH, P_HEIGHT);
setColor(paddle, "BLACK");
setFillColor(paddle, "BLACK");
setFilled(paddle, true);
add(window, paddle);
return paddle;
}
示例3: setRadius
Prey::Prey()
{
setRadius(8);
setFillColor(Color::Green);
vX = .8;
vY = .8;
setPosition(5, 50);
}
示例4: ASSERT
void GraphicsContext::setFillPattern(PassRefPtr<Pattern> pattern)
{
ASSERT(pattern);
if (!pattern) {
setFillColor(Color::black, ColorSpaceDeviceRGB);
return;
}
m_state.fillGradient.clear();
m_state.fillPattern = pattern;
}
示例5: setFillColor
//example implementation
void Button::animation_upadate()
{
if(!m_isEnabled)
{
setFillColor(m_color_disabled);
return;
}
Color c = m_color_mouseOver;
double ratio1 = sqrt((double)m_animation) / sqrt((double)m_animationLength);
double ratio2 = 1 - ratio1;
setFillColor(Color( (Uint8)(c.r * ratio1 + m_color.r * ratio2),
(Uint8)(c.g * ratio1 + m_color.g * ratio2),
(Uint8)(c.b * ratio1 + m_color.b * ratio2),
(Uint8)(c.a * ratio1 + m_color.a * ratio2)));
updateVisuals();
}
示例6: _label
TextButton::TextButton(const std::string &text, sf::Font& font, Widget *parent)
:Button(parent), _label(text, font, nullptr){
_label = Label (text, font, this);
setFillColor(sf::Color(153,204,255));
setOutlineThickness(2);
setOutlineColor(sf::Color(0,153,153));
}
示例7: ASSERT
void GraphicsContext::setFillGradient(PassRefPtr<Gradient> gradient)
{
ASSERT(gradient);
if (!gradient) {
setFillColor(Color::black);
return;
}
m_common->state.fillColorSpace = GradientColorSpace;
m_common->state.fillGradient = gradient;
}
示例8: save
void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& ellipseColor, const Color& shadowColor)
{
if (paintingDisabled())
return;
save();
setStrokeColor(shadowColor);
setFillColor(shadowColor);
drawEllipse(FloatRect(rect.x(), rect.y() + 1, rect.width(), rect.height()));
setStrokeColor(ellipseColor);
setFillColor(ellipseColor);
drawEllipse(rect);
restore();
}
示例9: initBricks
/**
* Initializes window with a grid of bricks.
*/
void initBricks(GWindow window)
{
int b_y = 40;
for (int i = 0; i < 5; i++)
{
int b_x = 2;
for (int j = 0; j < 10; j++)
{
GRect bricks = newGRect(b_x, b_y, 35, 10);
add(window, bricks);
if (i == 0)
{
setFillColor(bricks, "BLUE");
}
else if (i == 1)
{
setFillColor(bricks, "BLACK");
}
else if (i == 2)
{
setFillColor(bricks, "RED");
}
else if (i == 3)
{
setFillColor(bricks, "YELLOW");
}
else if (i == 4)
{
setFillColor(bricks, "GREEN");
}
setFilled(bricks, true);
b_x = b_x + 40;
}
b_y = b_y + 20;
}
}
示例10: draw
void draw(void *userData)
{
/* Draw rectangle */
setPenColor(POLO_TRANSPARENT);
setFillColor(POLO_MIDNIGHT);
drawRect(0, 0, 120, 44);
/* Draw hello world */
setPenColor(POLO_WHITE);
drawText(10, 10, "Hello world");
}
示例11: setFrameColor
//-----------------------------------------------------------------------------
void CDrawContext::init ()
{
// set the default values
setFrameColor (kWhiteCColor);
setLineStyle (kLineSolid);
setLineWidth (1);
setFillColor (kBlackCColor);
setFontColor (kWhiteCColor);
setFont (kSystemFont);
setDrawMode (kAliasing);
setClipRect (surfaceRect);
}
示例12: color
//-----------------------------------------------------------------------------
void D2DDrawContext::setGlobalAlpha (float newAlpha)
{
if (currentState.globalAlpha == newAlpha)
return;
COffscreenContext::setGlobalAlpha (newAlpha);
CColor color (currentState.frameColor);
currentState.frameColor = kTransparentCColor;
setFrameColor (color);
color = currentState.fillColor;
currentState.fillColor = kTransparentCColor;
setFillColor (color);
color = currentState.fontColor;
currentState.fontColor = kTransparentCColor;
setFontColor (color);
}
示例13: setIsDrag
bool CircleObject::init()
{
setIsDrag(false);
setObjectType(ObjectType::CIRCLE_OBJECT);
setTypeName("CircleObject");
m_drawnode = CCDrawNode::create();
addChild(m_drawnode);
registerWithTouchDispatcher();
setBorderColor(ccc4f(1, 0, 0, 1));
setFillColor(ccc4f(0.5, 0.5, 0.5, 0.5));
m_radius = 10;
return true;
}
示例14: fillRule
void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color)
{
if (paintingDisabled())
return;
Path path;
path.addRect(rect);
if (!roundedHoleRect.radii().isZero())
path.addRoundedRect(roundedHoleRect);
else
path.addRect(roundedHoleRect.rect());
WindRule oldFillRule = fillRule();
Color oldFillColor = fillColor();
setFillRule(RULE_EVENODD);
setFillColor(color);
fillPath(path);
setFillRule(oldFillRule);
setFillColor(oldFillColor);
}
示例15: DrawSolidCircle
void MyDebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color)
{
auto circle = sf::CircleShape(radius);
circle.setPosition(center.x - radius, center.y - radius);
circle.setFillColor(B2SFColor(color));
this->m_window->draw(circle);
// line of the circle wich shows the angle
b2Vec2 p = center + (radius * axis);
sf::VertexArray lines(sf::Lines, 2);
lines[0].color = sf::Color(0,0,0);
lines[0].position = sf::Vector2f(center.x, center.y);
lines[1].position = sf::Vector2f(p.x, p.y);
this->m_window->draw(lines);
}