//============================== // OvrSliderComponent::OnFrameUpdate eMsgStatus OvrSliderComponent::OnFrameUpdate( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr, VRMenuObject * self, VRMenuEvent const & event ) { if ( TouchDown ) { UpdateText( menuMgr, self, BubbleId ); UpdateText( menuMgr, self, TextId ); } if ( BubbleFadeOutTime > 0.0 ) { if ( ovr_GetTimeInSeconds() >= BubbleFadeOutTime ) { BubbleFadeOutTime = -1.0; BubbleFader.StartFadeOut(); } } VRMenuObject * bubble = menuMgr.ToObject( self->ChildHandleForId( menuMgr, BubbleId ) ); if ( bubble != NULL ) { float const fadeTime = 0.5f; float const fadeRate = 1.0 / fadeTime; BubbleFader.Update( fadeRate, vrFrame.DeltaSeconds ); Vector4f color = bubble->GetColor(); color.w = BubbleFader.GetFinalAlpha(); bubble->SetColor( color ); Vector4f textColor = bubble->GetTextColor(); textColor.w = color.w; bubble->SetTextColor( textColor ); } return MSG_STATUS_ALIVE; }
void UILabel::SetTextColor( Vector4f const & c ) { VRMenuObject * object = GetMenuObject(); assert( object ); object->SetTextColor( c ); }