Questions tagged [hittest]

Hit-testing (hit detection, picking, or pick correlation) is the process of determining whether a given object intersects another given object shape, line, or curve drawn on the screen.

Hit-testing (hit detection, picking, or pick correlation) is the process of determining whether a given object intersects another given object shape, line, or curve drawn on the screen.

Most commonly, hit-testing is used by GUI environments to respond to user actions. In addition, hit-testing is used in small-scale games, which do not require much computing power, and are thus able to perform all of their collision detection tests in one frame of the game loop.

In Web programming languages such as SVG and CSS, this is associated with the concept of pointer-events (e.g. user-initiated cursor movement or object selection).

543 questions
12
votes
3 answers

Identifying the Type of Touch Gestures from UIEvent Object

Is there a way to gain the type of touch gestures that triggered a UIEvent? So, let's say I intercept a gesture with hitTest:withEvent:. How do I identify what kind of touch (pinch, tap, swipe, etc.) happened that triggered this method? I can gain…
user1799795
  • 279
  • 1
  • 4
  • 11
12
votes
3 answers

How can you set IsHitTestVisible to True on a child of something where it's set to false?

I have a message which is within a border and is displayed in front of a MDI client area. Because it's just a message, I set it's IsHitTestVisible to false. For convenience, I've also included a button within it so the user can simply click the…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
11
votes
3 answers

'hitTest()' was Depecrated in iOS 14.0

I'm new to this and currently building an AR-related application, on the old version I stated this let results = self.hitTest(screenPosition, types: [.featurePoint]) and now I have a problem where the hitTest is deprecated in iOS…
Zaky Putra
  • 111
  • 1
  • 4
10
votes
1 answer

Tap / Select Node in SceneKit (Swift)

I'm new to SceneKit and 3D spaces in iOS. I'm currently working on a simple game that shows a cube of 28 segments ("mini cubes" if you want). I want to move the mini cubes by tapping them, but I can't get my head around how to select specific nodes…
Sebastian
  • 417
  • 7
  • 8
9
votes
4 answers

How can I select Widgets by dragging over them but also clicking them individually in flutter?

I want to create an Interface in which it is possible to drag your finger over several Areas. This changes the state of the areas to a selected state (See images). What is the best way to approach this? Start Position: Start Dragging: Select First…
Philipp Redeker
  • 3,848
  • 4
  • 26
  • 34
9
votes
3 answers

Bug: hit-testing with sibling nodes and the userInteractionEnabled property in Sprite Kit

Bug — hit-testing doesn't work as intended when siblings overlap: There are 2 overlapping nodes in a scene which have the same parent (ie. siblings) The topmost node has userInteractionEnabled = NO whilst the other node has userInteractionEnabled =…
Shuri2060
  • 729
  • 6
  • 21
8
votes
1 answer

Default WPF HitTest behaviour with Hidden/Collapsed elements

in WPF when using VisualTreeHelper.HitTest even hidden Elements are found. To skip this elements and only return a result for visible ones, i created a HitTestFilter like the following : ///This Filter should cut all invisible or not HitTest Enabled…
sebhaub
  • 714
  • 6
  • 16
7
votes
4 answers

hitTest fires when UIKeyboard is tapped

I'm trying to fix a bug that involves UIView hitTest:withEvent: being called on my view when the touches are on the UIKeyboard, but only after the app has been in the background. It was occurring in my app with a complex view hierarchy so I…
brianpartridge
  • 763
  • 8
  • 19
7
votes
2 answers

SVG text hit-test

I'm trying to implement collision detection for SVG text elements using client side JavaScript. The hit-test should check if any glyph of a text overlaps any glyph of another text element. Since getBBox and getExtentOfChar are anything than accurate…
Jay
  • 2,141
  • 6
  • 26
  • 37
7
votes
1 answer

HitTest across Windows?

Ok, so my previous question did not produce any useful answers, so I'll try to come from a different direction. My application has, potentially, several windows. Given a point in screen coordinates, I need to find which window it "falls" onto - i.e.…
Fyodor Soikin
  • 78,590
  • 9
  • 125
  • 172
7
votes
3 answers

Touches on transparent UIControl are ignored - not handled by added action functions

I have a custom UIControl that contains a few other controls. In between those controls there is empty space and background of my UIControl needs to be transparent. I need to catch all touch events that happen on my custom UIControl even if they…
Rasto
  • 17,204
  • 47
  • 154
  • 245
7
votes
2 answers

What is the Silverlight's FindElementsInHostCoordinates equivalent in WPF?

I would like to perform a rectangual hit test on WPF Canvas component in order to get Controls that are overlapped by a Rectangle framework element. I found a Silverlight's VisualTreeHelper.FindElementsInHostCoordinates method, but apparently it's…
Darius
  • 524
  • 1
  • 5
  • 11
7
votes
2 answers

Hit Testing in WPF

I have an Ellipse on a Canvas and I'm doing Hit Testing on it. Every time I click the stroke of the Ellipse, the test passes. If I click in the middle of the Ellipse, the test fails. This is good! After I fill the ellipse like this: myEllipse.Fill =…
user242408
6
votes
1 answer

TextBlock over a listview: how to ignore clicks in the TextBlock and let the listview handle them

I have a listview which displays a lot of info, but when it's empty I want to overlay a textblock over it which says "No Info to Display" or "Do bla-bla-bla to add info". The listview is set up to respond to mouse clicks, but now if I click on the…
Warpin
  • 6,971
  • 12
  • 51
  • 77
6
votes
1 answer

In which cases ARSCNView.raycastQuery returns nil?

In my renderer delegate I create a raycast query from the center of the view to track estimated plane and display a 3D pointer that follows the raycast result. It is done via view.raycastQuery(from:allowing:alignment:) but is returns nil. My…
ryancrunchi
  • 465
  • 2
  • 16
1
2
3
36 37