add anim frames to sprite editor
This commit is contained in:
@@ -86,9 +86,7 @@ void SpriteEditor::DrawSpriteCanvas() {
|
|||||||
static bool flip_x = false;
|
static bool flip_x = false;
|
||||||
static bool flip_y = false;
|
static bool flip_y = false;
|
||||||
if (ImGui::BeginChild(gui::GetID("##SpriteCanvas"),
|
if (ImGui::BeginChild(gui::GetID("##SpriteCanvas"),
|
||||||
ImGui::GetContentRegionAvail(), true,
|
ImGui::GetContentRegionAvail(), true)) {
|
||||||
ImGuiWindowFlags_AlwaysVerticalScrollbar |
|
|
||||||
ImGuiWindowFlags_AlwaysHorizontalScrollbar)) {
|
|
||||||
sprite_canvas_.DrawBackground();
|
sprite_canvas_.DrawBackground();
|
||||||
sprite_canvas_.DrawContextMenu();
|
sprite_canvas_.DrawContextMenu();
|
||||||
// sprite_canvas_.DrawBitmap(oam_bitmap_, 2, 2);
|
// sprite_canvas_.DrawBitmap(oam_bitmap_, 2, 2);
|
||||||
@@ -137,6 +135,8 @@ void SpriteEditor::DrawSpriteCanvas() {
|
|||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DrawAnimationFrames();
|
||||||
|
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,6 +185,15 @@ void SpriteEditor::DrawSpritesList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpriteEditor::DrawAnimationFrames() {
|
||||||
|
if (ImGui::Button("Add Frame")) {
|
||||||
|
// Add a new frame
|
||||||
|
}
|
||||||
|
if (ImGui::Button("Remove Frame")) {
|
||||||
|
// Remove the current frame
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
} // namespace app
|
} // namespace app
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
@@ -9,8 +9,6 @@ namespace yaze {
|
|||||||
namespace app {
|
namespace app {
|
||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
constexpr ImGuiTabItemFlags kSpriteTabFlags =
|
constexpr ImGuiTabItemFlags kSpriteTabFlags =
|
||||||
ImGuiTabItemFlags_Trailing | ImGuiTabItemFlags_NoTooltip;
|
ImGuiTabItemFlags_Trailing | ImGuiTabItemFlags_NoTooltip;
|
||||||
|
|
||||||
@@ -56,6 +54,11 @@ class SpriteEditor : public SharedRom {
|
|||||||
*/
|
*/
|
||||||
void DrawCurrentSheets();
|
void DrawCurrentSheets();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Draws the animation frames manager.
|
||||||
|
*/
|
||||||
|
void DrawAnimationFrames();
|
||||||
|
|
||||||
ImVector<int> active_sprites_; /**< Active sprites. */
|
ImVector<int> active_sprites_; /**< Active sprites. */
|
||||||
|
|
||||||
int current_sprite_id_; /**< Current sprite ID. */
|
int current_sprite_id_; /**< Current sprite ID. */
|
||||||
|
|||||||
Reference in New Issue
Block a user