MCPcopy Create free account
hub / github.com/BobbyAnguelov/Esoterica / DrawControllerState

Method DrawControllerState

Code/Engine/Input/Debug/DebugView_Input.cpp:270–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268 drawPosition = Float2( upButtonTopLeft, SecondRowTopLeft.m_y + g_buttonWidth + g_buttonWidth );
269 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "Dn", controller.IsHeldDown( Input::InputID::Controller_DPadDown ) );
270
271 // Face Buttons
272 float const topFaceButtonTopLeft = SecondRowTopLeft.m_x + ( ( g_buttonWidth + g_analogStickRangeRadius ) - g_buttonWidth / 2 ) * 2 + 34 + ( g_buttonWidth * 2 );
273
274 drawPosition = Float2( topFaceButtonTopLeft, SecondRowTopLeft.m_y );
275 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "Y", controller.IsHeldDown( Input::InputID::Controller_FaceButtonUp ), 0xFF00FFFF );
276 drawPosition = Float2( topFaceButtonTopLeft - g_buttonWidth, SecondRowTopLeft.m_y + g_buttonWidth );
277 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "X", controller.IsHeldDown( Input::InputID::Controller_FaceButtonLeft ), 0xFFFF0000 );
278 drawPosition = Float2( topFaceButtonTopLeft + g_buttonWidth, SecondRowTopLeft.m_y + g_buttonWidth );
279 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "B", controller.IsHeldDown( Input::InputID::Controller_FaceButtonRight ), 0xFF0000FF );
280 drawPosition = Float2( topFaceButtonTopLeft, SecondRowTopLeft.m_y + g_buttonWidth + g_buttonWidth );
281 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "A", controller.IsHeldDown( Input::InputID::Controller_FaceButtonDown ), 0xFF00FF00 );
282
283 // System Buttons
284 drawPosition = Float2( SecondRowTopLeft.m_x + g_buttonWidth + g_analogStickRangeRadius * 2, SecondRowTopLeft.m_y + 10 );
285 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "S0", controller.IsHeldDown( Input::InputID::Controller_System0 ) );
286 drawPosition = Float2( drawPosition.m_x + g_buttonWidth + 4, drawPosition.m_y );
287 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "S1", controller.IsHeldDown( Input::InputID::Controller_System1 ) );
288
289 // Stick Buttons
290 drawPosition = Float2( SecondRowTopLeft.m_x + g_buttonWidth + g_analogStickRangeRadius * 2, drawPosition.m_y + g_buttonWidth + 4 );
291 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "LS", controller.IsHeldDown( Input::InputID::Controller_LeftStick ) );
292 drawPosition = Float2( drawPosition.m_x + g_buttonWidth + 4, drawPosition.m_y );
293 DrawButton( pDrawList, drawPosition, g_buttonDimensions, "RS", controller.IsHeldDown( Input::InputID::Controller_RightStick ) );
294
295 totalSize.m_x = ( drawPosition.m_x + g_buttonWidth ) - FirstRowTopLeft.m_x;
296 totalSize.m_y = triggerButtonDimensions.m_y + g_buttonWidth + 4;
297
298 //-------------------------------------------------------------------------
299 ImGui::Dummy( totalSize );
300 }
301}
302#endif

Callers

nothing calls this directly

Calls 5

DrawButtonFunction · 0.85
DrawTriggerButtonFunction · 0.85
DrawAnalogStickFunction · 0.85
IsHeldDownMethod · 0.80
Float2Function · 0.50

Tested by

no test coverage detected