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
2
votes
2 answers

CAShapeLayer tap detection in Swift 3

I have a CAShapeLayer for which I have marked the fill color as clear. When I tap on the line it does not always detect if the CAShapeLayer cgpath contains the tap point. My code is as follows: override func touchesBegan(_ touches: Set,…
Rahul
  • 300
  • 2
  • 12
2
votes
1 answer

Why can I clickthrough my form?

I am experimenting and trying to figure out DWM and Windows Aero. So far, I think I pretty much have it, all except for some strange reason, when I click the thicker part of my form, my click goes right through it, and I can't figure out how to stop…
Sean
  • 8,401
  • 15
  • 40
  • 48
2
votes
3 answers

Bring a subview to the top on mouseDown: AND keep receiving events (for dragging)

Ok, basically I have a view with a series of slightly overlapping subviews. When a subview is clicked, it moves to the top (among other things), by a really simple two-liner: -(void)mouseDown:(NSEvent *)theEvent { if (_selected) { // Don't do…
d11wtq
  • 34,788
  • 19
  • 120
  • 195
2
votes
1 answer

WPF - Hit Test Filter Callback

I have a canvas and it has child DrawingVisuals in its VisualCollection. I want to hit test against some type of child but not for others. To do that I wrote HitTestFilterCallback function: public HitTestFilterBehavior…
Alp
  • 553
  • 11
  • 30
2
votes
1 answer

SceneKit NSNode split parts

My SceneKit project uses an imported .OBJ file, which contains only one node with a huge image. Image comprises different objects or parts. I need to tap on a foot, or image specific part, and have it highlighted. This is code to import .obj File …
2
votes
1 answer

What is the best way to have only non-transparent pixel hit testable in images in Silverlight?

According to msdn in Silverlight images are hit testable over their image/media display areas, basically their Height and Width. Transparent / full alpha pixels in the image file are still hit testable. My question is now, what is the best way to…
cfroehlich
  • 23
  • 2
2
votes
0 answers

SceneKit: improve performance of SceneView's hitTest function?

Our scene only has about 20 nodes. The code below lets the user pan, conducting a hit test on each pan -- the goal is to highlight blocks as the user pans around the screen. However, it is noticeably sluggish on a iPhone 5S. It's not deterministic…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
2
votes
1 answer

How can I get the Hit point on hit test between two dynamically added objects in AS3?

I want to know the actual hit point when the dash line is hitting to the triangle object. I am using the following codes for hit between two object : target.hitTestObject(border); where target is the triangle object and border is a group where I…
Babu
  • 440
  • 5
  • 23
2
votes
2 answers

Improving hit-testing in Winforms; any alternative to GraphicsPath.IsVisible?

On a custom control I've a series of LED objects that should be turned on according to a given GraphicsPath (e.g., see image below). Currently I'm using graphicsPath.IsVisible(ledPoint), however since I have many LEDs, the iteration through all of…
Mauro Ganswer
  • 1,379
  • 1
  • 19
  • 33
2
votes
2 answers

I made a rectangle how do I check if the mouse clicked on it?

How do I check if a mouse clicked a rectangle? Graphics gfx; Rectangle hitbox; hitbox = new hitbox(50,50,10,10); //TIMER AT THE BOTTOM gfx.Draw(System.Drawing.Pens.Black,hitbox);
Kill4lyfe
  • 21
  • 1
  • 2
2
votes
1 answer

How to hit test individual characters in a Silverlight TextBlock

This is a slightly abstract question, for which I apologize. I am not necessarily looking for a specific tested solution, but rather some suggestions that I can experiment with to find the one that works the best. All suggestions are welcome - the…
Tim Coulter
  • 8,705
  • 11
  • 64
  • 95
2
votes
0 answers

swift: subview not tappable outside parent view

I have a DKDropMenu implemented on ios project. Everything works just fine except it is not tappable outside parent views bounds. I tried to use HitTest method but its not working. Can someone guide me how to solve this issue?
Narendra Ojha
  • 673
  • 8
  • 18
2
votes
1 answer

How can I tell which Silverlight Popup (or ChildWindow) is topmost?

I am trying to hit test in Silverlight applications to find the elements under the mouse cursor. Normally VisualTreeHelper.FindElementsInHostCoordinates works for this. If there is a Popup open I need to pass in the popup to the hit testing method.…
Greg
  • 10,360
  • 6
  • 44
  • 67
2
votes
0 answers

UWP - Multiple InkCanvases stacked with IsHitTestVisible = false still capturing inking

I have two InkCanvases stacked and I'd like to get the top to pass inking to the bottom. I set the top to ishittestvisible=false but it still receives the inking. Then as a test I set both to false and the top still gets inking...what am I…
2
votes
0 answers

Hit detection, windows universal apps on Windows10

I have a Canvas with many LineGeometry objects in it and want to let the user select a specific LineGeometry and interact with it. Keying off a Tapped callback, I'm using the visualTreeHelper, but it appears I'm getting an empty collection back. …
nmishr
  • 287
  • 3
  • 6