Esempio n. 1
0
KNHeaderButton::KNHeaderButton(QWidget *parent) :
    QWidget(parent)
{
    //Set properties.
    setContentsMargins(0,0,0,0);

    //Set palette.
    configurePalette();

    //Inital widgets.
    initialIcon();
    initialText();
    initialTimeLine();
}
Esempio n. 2
0
KNHeaderButton::KNHeaderButton(QWidget *parent) :
    KNAnimeCheckedButton(parent)
{
    //Set properties.
    setContentsMargins(0,0,0,0);
    setMinimumWidth(182);

    //Connect signal.
    connect(this, &KNHeaderButton::clicked,
            this, &KNHeaderButton::requireShowCategorySwitcher);

    //Set palette.
    configurePalette();

    //Inital widgets.
    initialIcon();
    initialText();
    initialTimeLine();
}
Esempio n. 3
0
void World::buildScene()
{
	// Initialize the different layers
	for (std::size_t i = 0; i < LayerCount; ++i)
	{
		SceneNode::Ptr layer(new SceneNode());
		mSceneLayers[i] = layer.get();

		mSceneGraph.attachChild(std::move(layer));
	}

	// Prepare the tiled background
	sf::Texture& texture = mTextures.get(Textures::Background);
	sf::IntRect textureRect(mWorldBounds);
	texture.setRepeated(true);

	// Add the background sprite to the scene
	std::unique_ptr<SpriteNode> backgroundSprite(new SpriteNode(texture, textureRect));
	backgroundSprite->setPosition(mWorldBounds.left, mWorldBounds.top);
	mBackgroundSprite = backgroundSprite.get();
	mSceneLayers[Background]->attachChild(std::move(backgroundSprite));


	// Add player's spaceship
	std::unique_ptr<Spaceship> leader(new Spaceship(Spaceship::Rocket, mTextures));
	mPlayerSpaceship = leader.get();
	mPlayerSpaceship->setPosition(mSpawnPosition);
	mSceneLayers[Space]->attachChild(std::move(leader));

	mBattlifieldBounds.setSize(sf::Vector2f(getBattlefieldBounds().width, getBattlefieldBounds().height));
	mBattlifieldBounds.setPosition(getBattlefieldBounds().left, getBattlefieldBounds().top);
	mBattlifieldBounds.setFillColor(sf::Color::Transparent);
	mBattlifieldBounds.setOutlineThickness(2.f);
	mBattlifieldBounds.setOutlineColor(sf::Color::Green);

	initialText();
}