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
1
vote
1 answer

Get hit test event type

Is there a way to know if the hitTest:withEvent: method is being thrown because of a touchesBegan, touchesMoved or touchesEnded event? by now I only do: if([event type]==UIEventTypeTouches) { } but this is not exclusive enough
Daniel
  • 20,420
  • 10
  • 92
  • 149
1
vote
3 answers

Custom shape touchable area

I have a shape like below and I want set it as background to my UIButton but touchable area is a rectangle, any suggestion to change touchable area to shape boarders?
1
vote
0 answers

In WPF, how can I see if a point falls within a closed geometry?

Using custom rendering of a UIElement in WPF based on two, non-touching closed geometries. I'm trying to determine which of the two the user has clicked on. Is there any API which you can ask if a point falls within the specified closed geometry?
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
1
vote
1 answer

SKNode nodeAtPoint: / containsPoint: not the same behaviour for SKSpriteNode and SKShapeNode

The nodeAtPoint: gives not the same result if using SKShapeNode and SKSpriteNode. If i am correct nodeAtPoint: will use containsPoint: to check which nodes are at the given point. The docu states that containsPoint: will use its bounding box. I set…
NieLernend
  • 190
  • 9
1
vote
0 answers

Why my UserControl using a Path as ControlTemplate is not properly clickable?

I created a class derived from UserControl, directly on code (without XAML), and defined a ControlTemplate in a ResourceDictionary. This control template is a pair of ellipses, as follows:
heltonbiker
  • 26,657
  • 28
  • 137
  • 252
1
vote
1 answer

How can hitTestObject work for many objects?

I have a game where player moves forward over (semi)random tiles. I want a hittest for when the player hits a certain tile. However when the char hits one of the spawned in floor2's nothing happens. I think this is because there are multiple…
Woolff
  • 43
  • 1
  • 1
  • 6
1
vote
1 answer

Firefox 3.6 hit testing overlapping SVG shapes

I am drawing 2 SVG paths much like Google Maps does with directions. The problem I have is that the section of the first path that is overlapped by the bounding box of the second path won't fire the mouseover, mouseout or click events. Even though…
Alex
  • 34,776
  • 10
  • 53
  • 68
1
vote
1 answer

AS3: Removed Child Still Passes HitTest

I am making a game similar to doodle jump and I have a powerup MovieClip that appears every time the character bounces up. When the character collides with the powerup, I want it to add to the live score, and then disappear. But I want it to…
Ceejay1705
  • 35
  • 7
1
vote
0 answers

Javascript Hittest Rotation

Hi stackoverflow community, I am trying to get the hittest working while having a rotating object, but I am having a hard time making the collisions detect correctly. Example of my current work:…
1
vote
2 answers

SceneKit hit test error while moving camera

I declare my camera like this at init: defaultCameraNode.camera = SCNCamera() defaultCameraNode.position = SCNVector3Make(0, 200, 500) defaultCameraNode.camera?.zFar = 1000.0 defaultCameraNode.camera?.zNear = 10.0 defaultCameraNode.camera?.xFov =…
Bence Pattogato
  • 3,752
  • 22
  • 30
1
vote
1 answer

Incorrect listview hittesting

INTRODUCTION: I am trying to determine if user clicked on item or above/below listview. Listview is in report mode, with extended styles full row select and grid lines. PROBLEM: I am not able to get correct results, based on the docs for…
AlwaysLearningNewStuff
  • 2,939
  • 3
  • 31
  • 84
1
vote
2 answers

How can I solve this error in Flash game?

I have a problem in Flash puzzle game. If I create the game in the first frame of my timeline it's working, but if the game has been created (for example) in 5th frame it does'nt work! It send me this error: TypeError: Error #1009: Cannot access a…
arshia
  • 13
  • 4
1
vote
0 answers

Test for collision between a sprite and a bitmap

How do i test for collision between a Sprite and a Bitmap image with a transparent background? I've look as much as i can for a reason why this isn't working but i cant find it. the collision that isn't working as i expect is in the function called…
Luke Bourne
  • 295
  • 2
  • 11
1
vote
1 answer

Prevent overlapping DragDrop Images in Flex

I am trying to create basically a puzzle in Flex Builder 3. I display images from an array onto a canvas that can be dragged and dropped around the canvas. My problem is that I don't want the images to be able to overlap each other. Any ideas on how…
Bridget
  • 21
  • 4
1
vote
2 answers

How to check if a target was not hit in WPF

I'm using the code below to see when the mouse right button is clicked, if it hits a target (Drawing) or not. Now If the mouse hits the target a message will be shown stating that we hit the target. But where can I show a message that the target…
Vahid
  • 5,144
  • 13
  • 70
  • 146