Commit 66db3ece authored by Elias Leinenweber's avatar Elias Leinenweber
Browse files

Mis en place structure de Popup quand on clique sur un Actor

parent ddc24623
#include <string>
#include <SFML/Graphics.hpp>
#include "imgui/imgui-SFML.h"
#include "imgui/imgui.h"
#include "controller/Game.h"
#include "model/Actor.h"
Actor::Actor(const std::string &firstname, const std::string &surname,
......@@ -16,6 +19,20 @@ Actor::Actor(const std::string &firstname, const std::string &surname,
void
Actor::render() const
{
ImGui::ImageButton(
texture, ImVec2(texture.getSize().x / 2, texture.getSize().y / 2));
const char *str_id = std::to_string(Game::getComponentID()).c_str();
if (ImGui::ImageButton(
texture, ImVec2(texture.getSize().x / 2, texture.getSize().y / 2)))
ImGui::OpenPopup(str_id);
if (ImGui::BeginPopup(str_id)) {
if (ImGui::MenuItem("Afficher fiche information")) {
}
if (ImGui::MenuItem("Interroger")) {
}
if (ImGui::MenuItem("Lancer une craie")) {
}
if (ImGui::MenuItem("Envoyer au coin")) {
}
ImGui::EndPopup();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment