MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _process_click

Method _process_click

editor/scene/3d/node_3d_editor_plugin.cpp:180–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180void ViewportNavigationControl::_process_click(int p_index, Vector2 p_position, bool p_pressed) {
181 hovered = false;
182 queue_redraw();
183
184 if (focused_index != -1 && focused_index != p_index) {
185 return;
186 }
187 if (p_pressed) {
188 if (p_position.distance_to(get_size() / 2.0) < get_size().x / 2.0) {
189 focused_pos = p_position;
190 focused_index = p_index;
191 queue_redraw();
192 }
193 } else {
194 focused_index = -1;
195 if (Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) {
196 Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
197 Input::get_singleton()->warp_mouse(focused_mouse_start);
198 }
199 }
200}
201
202void ViewportNavigationControl::_process_drag(int p_index, Vector2 p_position, Vector2 p_relative_position) {
203 if (focused_index == p_index) {

Callers

nothing calls this directly

Calls 6

get_sizeFunction · 0.85
get_mouse_modeMethod · 0.80
set_mouse_modeMethod · 0.80
distance_toMethod · 0.45
warp_mouseMethod · 0.45
_menu_optionMethod · 0.45

Tested by

no test coverage detected