3 #include "../../debug_ui.h"
8 #include <Strings/components/utils/converters/converters.h>
25 bool draw_rect =
true;
26 bool rect_limit_to_window =
true;
27 float shift_limits[2] = { -5, 5 };
28 float rect[4] = { 50, 500, 50, 250 };
29 float rect_color[3] = { 255, 255, 255 };
30 float r_thickness = 5;
33 bool draw_text =
true;
34 std::wstring f_text = L
"Test message";
35 std::wstring font_name = L
"Ubuntu";
36 char text[512] =
"Test message";
37 char font[512] =
"Ubuntu";
38 float font_rect[4] = { 575, 700, 150, 600 };
39 float font_color[3] = { 255, 255, 255 };
43 bool draw_text_zone =
true;
44 float zone_thickness = 2;
46 float zone_color[3] = { 255, 0, 0 };
66 ImGui::Begin(
"Direct2D Testing", &
show);
68 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0, 128, 255, 1));
70 ImGui::PopStyleColor();
72 ImGui::Checkbox(
"show rectangle", &draw_rect);
74 ImGui::ColorEdit3(
"rect color", rect_color, ImGuiColorEditFlags_RGB);
75 ImGui::DragFloat4(
"rect", rect);
76 ImGui::DragFloat(
"thickness", &r_thickness);
82 float rect_shift[2] = { 0, 0 };
83 ImGui::SliderFloat2(
"shift", rect_shift, shift_limits[0], shift_limits[1]);
85 ImGui::InputFloat2(
"shift bounds", shift_limits);
91 if ((rect[0] > 0 || rect_shift[0] > 0) && (rect[1] < target_size.height || rect_shift[0] < 0))
93 rect[0] = rect[0] + rect_shift[0];
94 rect[1] = rect[1] + rect_shift[0];
97 if ((rect[2] > 0 || rect_shift[1] > 0) && (rect[3] < target_size.width || rect_shift[1] < 0))
99 rect[2] = rect[2] + rect_shift[1];
100 rect[3] = rect[3] + rect_shift[1];
105 rect[0] = rect[0] + rect_shift[0];
106 rect[1] = rect[1] + rect_shift[0];
107 rect[2] = rect[2] + rect_shift[1];
108 rect[3] = rect[3] + rect_shift[1];
114 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0, 128, 255, 1));
116 ImGui::PopStyleColor();
118 ImGui::Checkbox(
"show text", &draw_text);
119 ImGui::Checkbox(
"show text zone", &draw_text_zone);
121 ImGui::InputText(
"text", text, 512);
122 f_text = BlamStrings::Converters::ConvertStringToWstring(text);
124 ImGui::InputText(
"font", font, 512);
125 font_name = BlamStrings::Converters::ConvertStringToWstring(font);
127 ImGui::DragFloat(
"size", &font_size);
128 ImGui::ColorEdit3(
"text color", font_color, ImGuiColorEditFlags_RGB);
129 ImGui::DragFloat4(
"text rect", font_rect);
137 D2D1_RECT_F rect_f = D2D1::RectF(rect[2], rect[0], rect[3], rect[1]);
148 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(zone_color[0], zone_color[1], zone_color[2], 1));
150 ImGui::PopStyleColor();
155 ImGui::ColorEdit3(
"zone color", zone_color, ImGuiColorEditFlags_RGB);
157 ImGui::DragFloat(
"zone thickness", &zone_thickness);
160 D2D1_RECT_F text_border = D2D1::RectF(font_rect[2], font_rect[0], font_rect[3], font_rect[1]);