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

AS3 - Detecting if you clicked on an object without pressing the mouse button

Okay, in as3 when you click, the object on the highest layer will be clicked on. I want someone to press the space bar and have the objects on the screen to check to see if it is touching a point. So I first tried hittest... if…
JoeCool11
  • 41
  • 1
  • 2
4
votes
1 answer

UWP Is it Possible To Override Hit Testing?

I'm coming to UWP from years writing WPF UIs. With a WPF control it is possible to provide custom hit testing logic by overriding the control's HitTestCore method as follows: protected override HitTestResult HitTestCore(PointHitTestParameters…
NigelP
  • 219
  • 2
  • 6
4
votes
1 answer

Generate a WM_NCHITTEST message

I am trying to allow the user to move/resize a CEF borderless window (created with the WS_POPUP flag). The mouse position is caught in the CEF browser (using Javascript) and a C++ callback is called. Then, I send a message from the C++ callback to…
winapiwrapper
  • 125
  • 1
  • 12
4
votes
0 answers

hitTest doesn't get called in NSCell subclass

I'm working on a subclass of NSCell for my project. This subclass has, in some situation a NSButtonCell drawn on its view, with this : - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { ... if (self.mode ==…
PofMagicfingers
  • 215
  • 2
  • 14
4
votes
2 answers

Problem with VisualTreeHelper.HitTest in WPF

I'm trying to hit-test a bunch of UserControls on a Canvas. I don't want the HitTest() to walk the whole way through the visual tree, so I'm using the FilterCallback to make sure I only hit-test the UserControl. My problem is that the UserControl…
Chris Nicol
  • 10,256
  • 7
  • 39
  • 49
4
votes
4 answers

Swift: hitTest for UIView underneath another UIView

I have TransparentUIView on top of RedOrGreenUIView. TransparentUIView has a UILongPressGestureRecognizer attached to it. Once user begins a long touch on it, I check for .Changed status of this LongPressGesture, and execute below hitTest: var…
Kashif
  • 4,642
  • 7
  • 44
  • 97
4
votes
2 answers

hitTest to dismiss keyboard causing weird behaviour

I've googled on how to dismiss keyboard when touching a blank area in UITableView in iOS, and there're several ways to solve this. Like using delegate, UITapGestureRecognizer, - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event and -…
iBCode
  • 43
  • 5
4
votes
2 answers

Best way to implement parent child relationship

I am working on a CAD application, where I have block entity. Each block entity have a list of child entities. When these entities are rendered, every block entity knows about its child entity (as it can figure out the child entity in the list), and…
Ishan
  • 130
  • 6
4
votes
0 answers

GPUImage: Detecting average luminosity of multiple rectangular sub regions

I am using GPUImage to process incoming video, and each frame I would like to determine the average luminosity of many rectangular subregions of the incoming image for hit detection purposes in a game, but I am having trouble doing so in a way that…
KeithComito
  • 1,387
  • 1
  • 13
  • 24
3
votes
1 answer

how to move parent window without border from child using WM_NCHITTEST

so I have created this popup window with a custom move and sizing, pressing ctrl and click anywhere in the client to move and alt at the borders to size. The problem is, now i'm creating child windows for inside this window and here it goes "wrong".…
ColmanJ
  • 457
  • 2
  • 12
  • 28
3
votes
2 answers

Hittest polygon

I have a 2d polygon that consists of a list with points, i want to check wether a given point lies in that polygon, but i cant find a good way to check this. Can anyone point me in the right direction?
3
votes
2 answers

How to pass the hitTest through a control while performing a drag&drop operation

I have a tab control which allows me to drag the tab items out of my application. This dragging will open a new window which will follow the mouse until I release the left mouse button. Also it is possible to drag the tab item back into the source…
lukas
  • 53
  • 1
  • 5
3
votes
2 answers

How to tell if UITableView in custom UISearchBar is touched?

I am trying to create a custom UISearchBar that is placed as the titleView of a navigationController. Using the following code, the suggestionTableView of suggestions appears perfectly; however, It does not recognize any taps. In fact, it is like…
helloworld12345
  • 176
  • 1
  • 4
  • 22
3
votes
1 answer

Get touch type in hitTest() or pointInside()

I'm implementing a passThroughView by creating a transparent View on top and override hitTest(). passThroughView should consume touches from Apple Pencil and if touch type is not from pencil, it pass touches to the view underneath. The problems…
Brew Master
  • 457
  • 3
  • 13
3
votes
1 answer

RealityKit – Proper Hit-Testing in ARView

I have a code like this one: @objc func handleTap(_ sender: UITapGestureRecognizer) { let tapLocation = sender.location(in: arView) let hitResult0 = scnView?.hitTest(tapLocation) if let hitResult = arView?.entity(at:…
Sam
  • 145
  • 5