Skip to content

A simple ImGui animation driver . You will soon be able to run your animations with less than ten lines of code and no dependencies required.

License

Notifications You must be signed in to change notification settings

Half-People/HImGuiAnimation

next update: (Estimated update time : 2024/5/1-10)

  • Default animation

Display of results :

bandicam.2024-04-14.03-00-08-617.mp4

Easy to use (To learn more, please visit the wiki):

  
  void Sequencer(int32_t Frame/*current Frame*/, HAnimationSystem::HValue value) //Define callback function (The straight part is convertible)
  {
	  const std::vector<int> keys = { 0 , 30 , 64 }; // define key
	  const std::vector<float> values = { 80,200,80 }; //define key value

	  HAnimationSystem::PlayerCallBack::HInterpolationInfo info = HAnimationSystem::PlayerCallBack::GetInterpolationInfoFromKeys(keys, Frame); //Get interpolation information
	  HAnimationSystem::HValue_Get<float>(value) = HAnimationSystem::PlayerCallBack::LinearInterpolation(values[info.PreviousKey], values[info.LastOneKey], info.alpha); //Interpolation and return value
  }

  ...
  while (...)
  {
	  ...
          static float value;
	  if (ImGui::Button("play"))
		  HAnimationSystem::Play(Sequencer, 64, &value, &curr, speed, fps, loop); //Play animation (You don’t need to fill in so much data to use it)
	  ImGui::SliderFloat("Test", &value, 80, 200) //apply testing
	  ...
	  HAnimationSystem::updata(ImGui::GetIO().DeltaTime); // updata animation manager
  }

About

A simple ImGui animation driver . You will soon be able to run your animations with less than ten lines of code and no dependencies required.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages