Code Monkey home page Code Monkey logo

imgui-tricks's Introduction

ImTricks

ImTricks is a collection of useful functions for expanding / improving the functionality of the ImGui.

At the moment it has in itself:

  • Functions to speed up the creation of animations.
  • Functions for creating and displaying notifications.
  • Widgets that are missing in the standard ImGui.
  • A customized ImColor structure with an additional constructor from the HEX HTML color code and a method for obtaining HEX HTML from an already existing color.

Notifies Usage

void RenderMyGUI() {

   ...
   if (ImGui::Button("Create Notify", { 120, 25 }))
   	ImTricks::NotifyManager::AddNotify("The notification was displayed successfully.", ImTrickNotify_Success);
   ...
   
   ImTricks::NotifyManager::HandleNotifies(ImGui::GetOverlayDrawList());
}

Animations Usage

void RenderMyGUI() {
   ...
   ImGui::Checkbox("Enable Animation", &enable_animation);
   float trickFloat = ImTricks::Animations::FastFloatLerp("header", enable_animation, 0.f, 1.f, 0.05f);
   ImVec2 pos1 = ImTricks::Animations::FastImVec2Lerp("pos1", enable_animation, ImVec2(0, 50), ImVec2(100, 50), 5);
   ImVec2 pos2 = ImTricks::Animations::FastImVec2Lerp("pos2", enable_animation, ImVec2(413, 80), ImVec2(513, 80), 5);
   draw->AddRectFilled(p + pos1, p + pos2, ImTricks::Animations::FastColorLerp(ImColor(255, 0, 0), ImColor(0, 255, 0), trickFloat));
   ...
}
grMVvxMRqo.mp4

Widgets Usage

void RenderMyGUI() {
   ...
   static ImColor col = ImColor(23, 23, 23);
   ImTricks::Widgets::ColorEdit4("test", col, NULL);
   static ImTrickyColor col2 = ImColor(23, 23, 23);
   ImTricks::Widgets::ColorEdit4("test2", col2, NULL);
   ...
}

ImTrickyColor

void RenderMyGUI() {
   ...
   ImTrickyColor color = ImTrickyColor("#eb4034ff");
   ImGui::Text(color.HTML().c_str());
   ...
}

imgui-tricks's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.