MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / DrawEditorLabel

Method DrawEditorLabel

Source/Objects/placeholderobject.cpp:339–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void PlaceholderObject::DrawEditorLabel() {
340 PROFILER_ZONE(g_profiler_ctx, "DrawEditorLabel");
341 if (prev_editor_label != editor_label || editor_label_scale != editor_label_scale_prev) {
342 ClearEditorLabel();
343 }
344
345 if (title_debug_string_id == -1 && editor_label.empty() == false) {
346 title_debug_string_id = DebugDraw::Instance()->AddText(vec3(0.0f), editor_label, editor_label_scale, _persistent, _DD_NO_FLAG);
347 prev_editor_label = editor_label;
348 editor_label_scale_prev = editor_label_scale;
349 label_position_update = true;
350 }
351
352 if ((label_position_update || editor_label_offset != editor_label_offset_prev) && title_debug_string_id != -1) {
353 DebugDraw::Instance()->SetPosition(title_debug_string_id, GetTranslation() + editor_label_offset * GetScale()[1]);
354 editor_label_offset_prev = editor_label_offset;
355 label_position_update = false;
356 }
357}
358
359void PlaceholderObject::ClearEditorLabel() {
360 if (title_debug_string_id != -1) {

Callers

nothing calls this directly

Calls 6

GetTranslationFunction · 0.85
GetScaleFunction · 0.85
vec3Class · 0.50
emptyMethod · 0.45
AddTextMethod · 0.45
SetPositionMethod · 0.45

Tested by

no test coverage detected