[SOLVED] Making anim_texture begin at the first frame

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
hinashah
Gnoblar
Posts: 14
Joined: Fri Jul 18, 2014 9:31 pm

[SOLVED] Making anim_texture begin at the first frame

Post by hinashah »

Hello,

For my application I have an animated splash screen that is supposed to show up when the application does not have any events happening. The splash screen is supposed to stay on for 10 seconds to play the whole animation. I am implementing it with an overlay and using anim_texture in the material for the overlay.

The animation works fine, but it does not always start on the first frame. Is there a way to handle this?

Also, I am syncing it up to show for 10 seconds using this code:

Code: Select all

if(mSplashEnabled && mSplashTimeElapsed > 0.0)
			{
				//Show the splash screen
				mSplashTimeElapsed -= evt.timeSinceLastFrame;
				m_pSplashOverlay->hide(); //Disable the standby splash screen
				m_pCountDownOverlay->show(); //enable the countdown splash screen
			} 

Does that have any effect?

Thanks!
Last edited by hinashah on Fri Aug 08, 2014 4:38 pm, edited 1 time in total.
hinashah
Gnoblar
Posts: 14
Joined: Fri Jul 18, 2014 9:31 pm

Re: Making anim_texture begin at the first frame

Post by hinashah »

Got it!
Solved it by setting the time for anim_texture to 0, and using setCurrentFrame of the TextureUnitState manually in the program.
This also handles the issue of playing animation only once.
Post Reply