Exemple #1
0
Animation* GameObject::RemoveFromManagerAnimation(int32 track)
{
	Animation * animation = new Animation(this, 0.001f, Interpolation::LINEAR);
	animation->AddEvent(Animation::EVENT_ANIMATION_START, Message(this, &GameObject::RemoveFromManagerAnimation));
	animation->Start(track);
    return animation;
}
Animation * SoundInstance::VolumeAnimation(float32 newVolume, float32 time, int32 track /*= 0*/)
{
	animatedVolume = GetVolume();
	Animation * a = new LinearAnimation<float32>(this, &animatedVolume, newVolume, time, Interpolation::LINEAR);
	a->AddEvent(Animation::EVENT_ANIMATION_END, Message(this, &SoundInstance::OnVolumeAnimationEnded));
	Retain();
	a->Start(track);

	return a;
}
Exemple #3
0
Animation * GameObject::VisibleAnimation(bool visible, int32 track/* = 0*/)
{
    //TODO: change to bool animation - Dizz
    Animation * animation = new Animation(this, 0.01f, Interpolation::LINEAR);
    bool * params = new bool[1];
    params[0] = visible;
    animation->AddEvent(Animation::EVENT_ANIMATION_START, Message(this, &GameObject::VisibleAnimationCallback, (void*)params));
    animation->Start(track);
    return animation;
}
Exemple #4
0
void HintManager::ShowHint(const WideString &hintMessage, const DAVA::Rect &controlRectAbsolute)
{
    if(0 != hintMessage.length())
    {
        //Add control
        HintControl *hintControl = new HintControl();
        hintControl->SetText(hintMessage);
        
        Rect screenRect = UIScreenManager::Instance()->GetScreen()->GetRect(true);
        
        Vector2 requestedSize = hintControl->GetSize();
        if(requestedSize.dx < controlRectAbsolute.GetSize().dx)
        {
            Vector2 pos(controlRectAbsolute.x - screenRect.x, controlRectAbsolute.y - screenRect.y + controlRectAbsolute.dy);
            hintControl->SetPosition(pos);
        }
        else if(controlRectAbsolute.x - screenRect.x < requestedSize.dx)
        {
            Vector2 pos(controlRectAbsolute.x - screenRect.x, controlRectAbsolute.y - screenRect.y + controlRectAbsolute.dy);
            hintControl->SetPosition(pos);
        }
        else 
        {
            Vector2 pos(controlRectAbsolute.x - screenRect.x + controlRectAbsolute.dx - requestedSize.dx, controlRectAbsolute.y - screenRect.y + controlRectAbsolute.dy);
            hintControl->SetPosition(pos);
        }
        
        ControlsFactory::AddBorder(hintControl);
        UIScreenManager::Instance()->GetScreen()->AddControl(hintControl);
        
        Animation *hintAlphaAnimation = hintControl->ColorAnimation( Color::Transparent(), NOTIFICATION_TIME, 
                                                                     Interpolation::EASY_IN, 2);
        hintAlphaAnimation->AddEvent(Animation::EVENT_ANIMATION_END, 
                                    Message(this, &HintManager::OnAlphaAnimationDone, hintControl));
        hints.push_back(hintControl);
    }
}
void SceneEditorScreenMain::SetupAnimation()
{
    float32 minutes = EditorSettings::Instance()->GetAutosaveTime();
    Animation * anim = WaitAnimation(minutes * 60.f); 
    anim->AddEvent(Animation::EVENT_ANIMATION_END, Message(this, &SceneEditorScreenMain::AutoSaveLevel));
}