Skip to content

Latest commit

 

History

History
52 lines (44 loc) · 1.08 KB

README.md

File metadata and controls

52 lines (44 loc) · 1.08 KB

ImAnimation

A Simple Animation Extension for ImGui may soon evolve into something significant.

  • Created by faelcanalha

Fade's Animation

#include <imgui/imgui_animation.h>

int main(int, char**) {
  ...
  while (!done) {
     ...
      ImAnimation::Fade([]() {
        ImGui::Text("Hello!");
        // Others Widgets
      });

      ImAnimation::FadeDown([]() { /* Same thing for FadeUp, FadeRight and FadeLeft */
        ImGui::Text("Hello!");
        // Others Widgets
      }, 50.f);

      static bool isEnabled = true; // True appears and False disappears
      ImAnimation::FadeInOut([]() {
        ImGui::Text("Hello!");
        // Others Widgets
      }, isEnabled);
  }
}

Chaning Fade In Out

#include <imgui/imgui_animation.h>

int main(int, char**) {
  ...
  while (!done) {
     ...
      static bool isEnabled = true; // True appears and False disappears
      ImAnimation::FadeInOut([]() {
        ImGui::Text("Hello!");
        // Others Widgets
      }, isEnabled);

      if (ImGui::Button("Show Or Hide")) {
          isEnabled = !isEnabled;
      }
  }
}