コード例 #1
0
        LFXE_API bool DeviceLogitech::Initialize() {
            if (!this->IsInitialized()) {
                if (Device::Initialize()) {
                    // Just do an initial pass to set how many LEDs there are available
                    //TODO: Support more Logitech customization (e.g. Logitech G910 single-key colors)
                    this->SetNumberOfLights(1);
                    this->SetLightData(0, LightData());

                    this->Reset();
                } else {
                    return false;
                }
            }
            return true;
        }
コード例 #2
0
void LeapOfFaithSpell::load(const SpellData& bean, LevelMovableGameObject* mob, const sf::Vector2f& target) {
	m_mob = mob;
	Animation* spellAnimation = new Animation();
	spellAnimation->setSpriteSheet(g_resourceManager->getTexture(ResourceID::Texture_spell_leapoffaith));
	spellAnimation->addFrame(sf::IntRect(0, 0, 80, 120));

	addAnimation(GameObjectState::Idle, spellAnimation);

	m_isFacingRight = m_mob->isFacingRight();
	setCurrentAnimation(getAnimation(GameObjectState::Idle), !m_isFacingRight);
	playCurrentAnimation(false);
	
	Spell::load(bean, mob, target);
	m_mob->getMovingBehavior()->setGravityScale(m_gravityScale);
	loadParticleSystem();

	LightData lightData(LightData(
		sf::Vector2f(getBoundingBox()->width * 0.5f, getBoundingBox()->height * 0.5f), 
		sf::Vector2f(100.f, 100.f), 0.2f));
	addComponent(new LightComponent(lightData, this));
}
コード例 #3
0
        LFXE_API bool DeviceRazer::Initialize() {
            if (!this->IsInitialized()) {
                if (Device::Initialize()) {
                    // Load the library first
                    this->library = unique_ptr<RzChromaSDKProxy>(new RzChromaSDKProxy);
                    if (!this->library->Load()) {
                        LOG_ERROR(L"Failed to access the RzChromaSDK library");
                        this->SetInitialized(false);
                        return false;
                    }

                    // Just do an initial pass to set how many LEDs there are available
                    this->SetNumberOfLights(1);
                    this->SetLightData(0, LightData());

                    this->Reset();
                } else {
                    return false;
                }
            }
            return true;
        }
コード例 #4
0
AureolaSpell::AureolaSpell() : Spell() {
    m_lightObject = new LightObject(LightData(sf::Vector2f(), 80.f, 0.4f));
}
コード例 #5
0
ファイル: CookingTile.cpp プロジェクト: MORTAL2000/Cendric2
CookingTile::CookingTile(MapScreen* mapScreen) : MapDynamicTile(mapScreen) {
	addComponent(new LightComponent(LightData(
		sf::Vector2f(TILE_SIZE_F * 0.5f, TILE_SIZE_F * 0.5f),
		sf::Vector2f(100.f, 100.f)), this));
	addComponent(new TooltipComponent(g_textProvider->getText("Fireplace"), this));
}
コード例 #6
0
FireBallSpell::FireBallSpell() : Spell() {
	m_lightObject = new LightObject(LightData(sf::Vector2f(), 80.f, 0.8f));
}
コード例 #7
0
ModifierTile::ModifierTile(Level* level) : LevelDynamicTile(level) {
	m_lightObject = new LightObject(LightData(sf::Vector2f(), sf::Vector2f(200.f, 200.f), 0.5f));
}