MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / OnTouchEvent

Method OnTouchEvent

Sources/Jazz2/UI/Menu/UserProfileOptionsSection.cpp:90–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89
90 void UserProfileOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize)
91 {
92 if (event.type == TouchEventType::Down) {
93 std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex);
94 if (pointerIndex != -1) {
95 float x = event.pointers[pointerIndex].x;
96 float y = event.pointers[pointerIndex].y * (float)viewSize.Y;
97
98 if (x < 0.2f && y < 80.0f && _waitForInput && theApplication().CanShowScreenKeyboard()) {
99 _root->PlaySfx("MenuSelect"_s, 0.5f);
100 theApplication().ShowScreenKeyboard();
101 RecalcLayoutForScreenKeyboard();
102 return;
103 }
104 }
105 }
106
107 ScrollableMenuSection::OnTouchEvent(event, viewSize);
108 }
109
110 void UserProfileOptionsSection::OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos)
111 {

Callers

nothing calls this directly

Calls 4

findPointerIndexMethod · 0.80
CanShowScreenKeyboardMethod · 0.45
PlaySfxMethod · 0.45
ShowScreenKeyboardMethod · 0.45

Tested by

no test coverage detected