1#ifndef YAZE_GUI_CANVAS_H
2#define YAZE_GUI_CANVAS_H
9#include "imgui/imgui.h"
74 const std::function<
void()> &event,
int tile_size,
77 void UpdateInfoGrid(ImVec2 bg_size,
int tile_size,
float scale = 1.0f,
78 float grid_size = 64.0f,
int label_id = 0);
110 float scale = 1.0f,
int alpha = 255);
114 std::array<gfx::Bitmap, 4096>& tile16_individual_,
115 int tile_size,
float scale = 1.0f);
121 void DrawRect(
int x,
int y,
int w,
int h, ImVec4 color);
123 void DrawText(std::string text,
int x,
int y);
125 void DrawGrid(
float grid_step = 64.0f,
int tile_id_offset = 8);
128 void DrawInfoGrid(
float grid_step = 64.0f,
int tile_id_offset = 8,
140 if (tile_id >= num_columns * num_rows) {
172 labels_.push_back(ImVector<std::string>());
180 labels_.push_back(ImVector<std::string>());
183 labels_.push_back(ImVector<std::string>());
242 int num_sheets_to_load,
int canvas_id,
246 int width,
int height,
int tile_size,
bool is_loaded,
247 bool scrollbar,
int canvas_id);
Represents a bitmap image.
Represents a canvas for drawing and manipulating graphics.
auto selected_tile_pos() const
ImVector< ImVec2 > points_
auto set_current_labels(int i)
ImVec2 selected_tile_pos_
auto global_scale() const
void DrawOutlineWithColor(int x, int y, int w, int h, ImVec4 color)
uint64_t edit_palette_group_name_index_
auto selected_tiles() const
auto set_draggable(bool value)
Canvas(const std::string &id, ImVec2 canvas_size)
auto hover_mouse_pos() const
auto push_back(ImVec2 pos)
ImVec2 mouse_pos_in_canvas_
int GetTileIdFromMousePos()
auto drawn_tile_position() const
Canvas(const std::string &id, ImVec2 canvas_size, CanvasGridSize grid_size, float global_scale)
bool DrawSolidTilePainter(const ImVec4 &color, int size)
bool enable_context_menu_
auto set_selected_tile_pos(ImVec2 pos)
void DrawLayeredElements()
void DrawBitmap(const Bitmap &bitmap, int border_offset=0, bool ready=true)
bool enable_custom_labels_
void UpdateColorPainter(gfx::Bitmap &bitmap, const ImVec4 &color, const std::function< void()> &event, int tile_size, float scale=1.0f)
void DrawGridLines(float grid_step)
uint64_t edit_palette_sub_index_
void DrawRect(int x, int y, int w, int h, ImVec4 color)
bool DrawTilePainter(const Bitmap &bitmap, int size, float scale=1.0f)
auto custom_labels_enabled()
ImVector< ImVec2 > selected_points_
void SetCanvasSize(ImVec2 canvas_size)
void DrawTileOnBitmap(int tile_size, gfx::Bitmap *bitmap, ImVec4 color)
void DrawCustomHighlight(float grid_step)
auto mutable_selected_tiles()
auto mutable_labels(int i)
void SetCanvasGridSize(CanvasGridSize grid_size)
uint16_t edit_palette_index_
ImVector< ImVector< std::string > > labels_
void DrawText(std::string text, int x, int y)
void set_global_scale(float scale)
bool select_rect_active() const
Canvas(const std::string &id)
void DrawSelectRect(int current_map, int tile_size=0x10, float scale=1.0f)
void DrawBackground(ImVec2 canvas_size=ImVec2(0, 0), bool drag=false)
bool IsMouseHovering() const
void UpdateInfoGrid(ImVec2 bg_size, int tile_size, float scale=1.0f, float grid_size=64.0f, int label_id=0)
void DrawOutline(int x, int y, int w, int h)
Canvas(const std::string &id, ImVec2 canvas_size, CanvasGridSize grid_size)
void DrawInfoGrid(float grid_step=64.0f, int tile_id_offset=8, int label_id=0)
bool enable_hex_tile_labels_
void DrawBitmapGroup(std::vector< int > &group, std::array< gfx::Bitmap, 4096 > &tile16_individual_, int tile_size, float scale=1.0f)
void DrawContextMenu(gfx::Bitmap *bitmap=nullptr)
void DrawBitmapTable(const BitmapTable &gfx_bin)
bool DrawTileSelector(int size)
void DrawGrid(float grid_step=64.0f, int tile_id_offset=8)
auto selected_points() const
std::vector< ImVec2 > selected_tiles_
auto set_highlight_tile_id(int i)
std::unordered_map< int, gfx::Bitmap > BitmapTable
Graphical User Interface (GUI) components for the application.
void BitmapCanvasPipeline(gui::Canvas &canvas, const gfx::Bitmap &bitmap, int width, int height, int tile_size, bool is_loaded, bool scrollbar, int canvas_id)
void GraphicsBinCanvasPipeline(int width, int height, int tile_size, int num_sheets_to_load, int canvas_id, bool is_loaded, gfx::BitmapTable &graphics_bin)
Main namespace for the application.