This interface defines how to draw this component to property panel.
colume_0 width.
drag float width, 3 * drag float + 6 * buttom + colume_0 = ImGui::GetContentRegionAvail().
colume_0 width.
drag float width, 3 * drag float + 6 * buttom + colume_0 = ImGui::GetContentRegionAvail().
54 {
56
57 ImGui::Spacing();
58
59 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2{ 0, 3.0f });
60
65
70
71 {
73
74 ImGui::PushID("TransformComponent Translate");
75
76 ImGui::Columns(2, 0, false);
77 ImGui::SetColumnWidth(0, columeWidth);
78
79 {
81
82 static bool selected = false;
83 if (ImGui::Selectable("Translate", selected)) selected = !selected;
84 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(4.0f, 4.0f));
85 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 6.0f));
86 if (ImGui::BeginPopupContextItem())
87 {
88 ImGui::MenuItem("Copy");
89 ImGui::MenuItem("Paste");
90 ImGui::MenuItem("Copy Property Path");
91 ImGui::Separator();
92 ImGui::MenuItem("Disable");
93 ImGui::MenuItem("Delete");
94 ImGui::Separator();
95 ImGui::MenuItem("Set Key");
96 ImGui::MenuItem("Remove Key");
97 ImGui::MenuItem("Copy Key");
98 ImGui::MenuItem("Paste Key");
99 ImGui::Separator();
100 ImGui::MenuItem("Copy Animation");
101 ImGui::MenuItem("Paste Animation");
102 ImGui::MenuItem("Remove Animation");
103 ImGui::Separator();
104 if (ImGui::BeginMenu("Locks"))
105 {
106 ImGui::MenuItem("Lock");
107 ImGui::MenuItem("UnLock");
108
109 ImGui::EndMenu();
110 }
111
112 ImGui::EndPopup();
113 }
114 ImGui::SetItemTooltip("xformOp:translate(float3)\nRight click it to disable or delete it.");
115 ImGui::PopStyleVar(2);
116 }
117
118 ImGui::NextColumn();
119
120 {
122 ImGui::PushID("TransformComponent Translate X");
123
124 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.8f, 0.1f, 0.15f, 1.0f });
125 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.9f, 0.2f, 0.2f, 1.0f });
126 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.8f, 0.1f, 0.15f, 1.0f });
128 ImGui::PopStyleColor(3);
129 ImGui::SameLine();
130 ImGui::PushItemWidth(itemWidth);
132 {
135 }
136 ImGui::PopItemWidth();
137 ImGui::SameLine();
139 {
143 }
144 ImGui::SameLine();
145 ImGui::PopID();
146 }
147
148 {
150 ImGui::PushID("TransformComponent Translate Y");
151
152 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.2f, 0.7f, 0.2f, 1.0f });
153 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.3f, 0.8f, 0.3f, 1.0f });
154 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.2f, 0.7f, 0.2f, 1.0f });
156 ImGui::PopStyleColor(3);
157 ImGui::SameLine();
158 ImGui::PushItemWidth(itemWidth);
160 {
163 }
164 ImGui::PopItemWidth();
165 ImGui::SameLine();
167 {
171 }
172 ImGui::SameLine();
173 ImGui::PopID();
174 }
175
176 {
178 ImGui::PushID("TransformComponent Translate Z");
179
180 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.1f, 0.25f, 0.8f, 1.0f });
181 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.2f, 0.35f, 0.9f, 1.0f });
182 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.1f, 0.25f, 0.8f, 1.0f });
184 ImGui::PopStyleColor(3);
185 ImGui::SameLine();
186 ImGui::PushItemWidth(itemWidth);
188 {
191 }
192 ImGui::PopItemWidth();
193 ImGui::SameLine();
195 {
199 }
200 ImGui::PopID();
201 }
202
203 ImGui::Columns(1);
204 ImGui::PopID();
205 }
206
207 {
209
210 ImGui::PushID("TransformComponent Rotate");
211
212 ImGui::Columns(2, 0, false);
213 ImGui::SetColumnWidth(0, columeWidth);
214
215
216
217
218
219
220
221
222
223
224
225
226 {
228
229 static bool selected = false;
230 if (ImGui::Selectable("Rotate", selected)) selected = !selected;
231 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(4.0f, 4.0f));
232 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 6.0f));
233 if (ImGui::BeginPopupContextItem())
234 {
235 ImGui::MenuItem("Copy");
236 ImGui::MenuItem("Paste");
237 ImGui::MenuItem("Copy Property Path");
238 ImGui::Separator();
239 ImGui::MenuItem("Disable");
240 ImGui::MenuItem("Delete");
241 ImGui::Separator();
242 ImGui::MenuItem("Set Key");
243 ImGui::MenuItem("Remove Key");
244 ImGui::MenuItem("Copy Key");
245 ImGui::MenuItem("Paste Key");
246 ImGui::Separator();
247 ImGui::MenuItem("Copy Animation");
248 ImGui::MenuItem("Paste Animation");
249 ImGui::MenuItem("Remove Animation");
250 ImGui::Separator();
251 if (ImGui::BeginMenu("Locks"))
252 {
253 ImGui::MenuItem("Lock");
254 ImGui::MenuItem("UnLock");
255
256 ImGui::EndMenu();
257 }
258
259 ImGui::EndPopup();
260 }
261 ImGui::SetItemTooltip("xformOp:rotateXYZ(float3)\nRight click it to disable or delete it.\nLeft click it to change the rotate order, default is XYZ.");
262 ImGui::PopStyleVar(2);
263 }
264
265 ImGui::NextColumn();
266
267 {
269 ImGui::PushID("TransformComponent Rotate X");
270
271 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.8f, 0.1f, 0.15f, 1.0f });
272 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.9f, 0.2f, 0.2f, 1.0f });
273 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.8f, 0.1f, 0.15f, 1.0f });
275 ImGui::PopStyleColor(3);
276 ImGui::SameLine();
277 ImGui::PushItemWidth(itemWidth);
279 {
282 }
283 ImGui::PopItemWidth();
284 ImGui::SameLine();
286 {
290 }
291 ImGui::SameLine();
292 ImGui::PopID();
293 }
294
295 {
297 ImGui::PushID("TransformComponent Rotate Y");
298
299 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.2f, 0.7f, 0.2f, 1.0f });
300 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.3f, 0.8f, 0.3f, 1.0f });
301 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.2f, 0.7f, 0.2f, 1.0f });
303 ImGui::PopStyleColor(3);
304 ImGui::SameLine();
305 ImGui::PushItemWidth(itemWidth);
307 {
310 }
311 ImGui::PopItemWidth();
312 ImGui::SameLine();
314 {
318 }
319 ImGui::SameLine();
320 ImGui::PopID();
321 }
322
323 {
325 ImGui::PushID("TransformComponent Rotate Z");
326
327 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.1f, 0.25f, 0.8f, 1.0f });
328 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.2f, 0.35f, 0.9f, 1.0f });
329 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.1f, 0.25f, 0.8f, 1.0f });
331 ImGui::PopStyleColor(3);
332 ImGui::SameLine();
333 ImGui::PushItemWidth(itemWidth);
335 {
338 }
339 ImGui::PopItemWidth();
340 ImGui::SameLine();
342 {
346 }
347 ImGui::PopID();
348 }
349
350 ImGui::Columns(1);
351 ImGui::PopID();
352 }
353
354 {
356
357 ImGui::PushID("TransformComponent Scale");
358
359 ImGui::Columns(2, 0, false);
360 ImGui::SetColumnWidth(0, columeWidth);
361
362 {
364
365 static bool selected = false;
366 if (ImGui::Selectable("Scale", selected)) selected = !selected;
367 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(4.0f, 4.0f));
368 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 6.0f));
369 if (ImGui::BeginPopupContextItem())
370 {
371 ImGui::MenuItem("Copy");
372 ImGui::MenuItem("Paste");
373 ImGui::MenuItem("Copy Property Path");
374 ImGui::Separator();
375 ImGui::MenuItem("Disable");
376 ImGui::MenuItem("Delete");
377 ImGui::Separator();
378 ImGui::MenuItem("Set Key");
379 ImGui::MenuItem("Remove Key");
380 ImGui::MenuItem("Copy Key");
381 ImGui::MenuItem("Paste Key");
382 ImGui::Separator();
383 ImGui::MenuItem("Copy Animation");
384 ImGui::MenuItem("Paste Animation");
385 ImGui::MenuItem("Remove Animation");
386 ImGui::Separator();
387 if (ImGui::BeginMenu("Locks"))
388 {
389 ImGui::MenuItem("Lock");
390 ImGui::MenuItem("UnLock");
391
392 ImGui::EndMenu();
393 }
394
395 ImGui::EndPopup();
396 }
397 ImGui::SetItemTooltip("xformOp:scale(float3)\nRight click it for more options.");
398 ImGui::PopStyleVar(2);
399
400 ImGui::SameLine();
402 }
403
404 ImGui::NextColumn();
405
406 {
408 ImGui::PushID("TransformComponent Scale X");
409
410 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.8f, 0.1f, 0.15f, 1.0f });
411 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.9f, 0.2f, 0.2f, 1.0f });
412 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.8f, 0.1f, 0.15f, 1.0f });
414 ImGui::PopStyleColor(3);
415 ImGui::SameLine();
416 ImGui::PushItemWidth(itemWidth);
418 {
421 }
422 ImGui::PopItemWidth();
423 ImGui::SameLine();
425 {
429 }
430 ImGui::SameLine();
431 ImGui::PopID();
432 }
433
434 {
436 ImGui::PushID("TransformComponent Scale Y");
437
438 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.2f, 0.7f, 0.2f, 1.0f });
439 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.3f, 0.8f, 0.3f, 1.0f });
440 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.2f, 0.7f, 0.2f, 1.0f });
442 ImGui::PopStyleColor(3);
443 ImGui::SameLine();
444 ImGui::PushItemWidth(itemWidth);
446 {
449 }
450 ImGui::PopItemWidth();
451 ImGui::SameLine();
453 {
457 }
458 ImGui::SameLine();
459 ImGui::PopID();
460 }
461
462 {
464 ImGui::PushID("TransformComponent Scale Z");
465
466 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.1f, 0.25f, 0.8f, 1.0f });
467 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.2f, 0.35f, 0.9f, 1.0f });
468 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.1f, 0.25f, 0.8f, 1.0f });
470 ImGui::PopStyleColor(3);
471 ImGui::SameLine();
472 ImGui::PushItemWidth(itemWidth);
474 {
477 }
478 ImGui::PopItemWidth();
479 ImGui::SameLine();
481 {
485 }
486 ImGui::PopID();
487 }
488
489 ImGui::Columns(1);
490 ImGui::PopID();
491 }
492
493 ImGui::PopStyleVar();
494 ImGui::Spacing();
495 }
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static FrameInfo & Get()
Get FrameInfo.
std::shared_ptr< World > m_World
The shared pointer of specific world.
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
static bool DrawResetIcon(const bool &isMove)
Draw Reset Icon.