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

hitTest() usage in swift

let subView = parentView.hitTest(point, with: nil) Return Value The view object that is the farthest descendent of the current view and contains point. Returns nil if the point lies completely outside the receiver’s view hierarchy. // As i…
Selçuk Yıldız
  • 539
  • 1
  • 5
  • 14
-1
votes
1 answer

Hittesting works fine but setting values to the same object results in error?

Im working on shooting some bullets and the collision testing works perfectly fine it even hurts the zombies. Except the one problem, i want the bullets to disappear when they hit a zombie this sounds easy sense Im already hit testing inside the…
Xenland
  • 510
  • 1
  • 6
  • 19
-1
votes
1 answer

WPF InkCanvas draw even on space beyond bounds of Clip. Override Hit Test

I am using InkCanvas.Clip property to clip my InkCanvas to the shape I need (I am using PathGeometry for that). I can only start drawing in this area, but I want to be able to start drawing outside of it. Of course, stoke parts beyond this area…
IntegerOverlord
  • 1,477
  • 1
  • 14
  • 33
-1
votes
1 answer

hit test with for loop

i have 10 bricks, whenever my ball hit one of them i want to remove that brick. (brick breaker) That is what i tried for (int bri=1; bri<11; bri++) { // NSObject *brickimg = [NSObject stringWithFormat:@"brick%d", bri]; // if…
siniradam
  • 2,727
  • 26
  • 37
-1
votes
1 answer

Best practice to cut down hitTest calls to improve performance of a flash game

I'm developing a flash game with Macromedia Flash 8 (it's really obsolete, isn't it?). The player moves a plane that continuously fires a stable stream of bullets and uses it to destroy enemies. Much like Bloons Super Monkey I use…
iBug
  • 35,554
  • 7
  • 89
  • 134
-1
votes
1 answer

When doing hittest, circle reacts to invisible part of maze

I'm making a maze-game. I have two objects that need to react to a hittest, my little circle (called "brikke") and the maze itself (called "form"). (I'm Norwegian) I drew a part of the maze in flash (as one big object, connected) and converted it in…
-1
votes
2 answers

Why does not enter if loops?

I just want to make restart button with touch button via below code, but if statment does not work. Could you find reason? function OnGUI() { if(Input.touchCount>0) { if (GUI.Button(Rect(Screen.width/1.12, 0, Screen.width/8,…
ugur albayrak
  • 35
  • 1
  • 9
-1
votes
1 answer

Cant get value of scores hitTestObject

error when adding scores. when mc1 hitTestObject line scores plus 1, and when mc2 scores did not increase stage.addEventListener(Event.ENTER_FRAME, scoring); function scoring(e:Event):void { if (mc1.hitTestObject(line) ||…
-1
votes
1 answer

How to do hit testing in the View Model?

I can't seem to find this with Google. In WPF using MVVM, I have an InkCanvas for the view. Under this InkCanvas there are several more canvases providing different textual information. Binding the InkCanvas with a PreviewMouseDown to the view…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
-1
votes
1 answer

Actionscript 2 - hitTesting multiple instances

I'm making a platformer using Actionscript 2. I got the jumping and gravity and everything going, but I'm limited to one "ground". As one might imagine, platformers require multiple "grounds" for jumping onto and falling off of. I tried editing the…
Ziggy
  • 365
  • 2
  • 5
  • 13
-1
votes
1 answer

How to HitTest several objects at the same time in AS2.0?

So I am making a game on AS2.0 where you control a square you can move and you are supposed not to touch any of the walls or else the level resets andyou go back to the initial position. I've managed to do it, but I have to make an If for each wall…
OrangeWall
  • 79
  • 1
  • 8
-1
votes
1 answer

as3 TypeError: Error #1009: Cannot access a property or method of a null object reference. -enterframe

i'm making a simple game and i'm still learning as3 i want to hit test object on the stage , bila1 with omidae1 if hittestobject gotoframe all the objects are on the stage with corect instancename, maintimeline as3 below everything works fine but i…
mx marius
  • 1
  • 1
-1
votes
1 answer

Using hitTestObject with 'if' statements in ActionScript

I am trying to use hitTestObject and enter_frame to create a "Test" page where the user drags an "answer box to another box, and if the answer is correct it displays the word "correct, if not "wrong", but I have four questions (q1) and 4 answers…
-1
votes
1 answer

Bitmap hittesting in AS3

I'm building a 16 bit game for my final project and have completed all the objects and environments, I exported all the images as png files into flash as well as my character, breaking the environment up into background, objects and foreground. I…
Crossman
  • 278
  • 5
  • 18
-1
votes
3 answers

How to increase the UIButton hittest area?

i need some help for a rapid prototype iPad app demo. I have a large background image with some graphical elements. Then i created a custom UIButton onto this view. Unfortunately i need to increase the hit test area of that button.with, so the user…
geforce
  • 2,593
  • 3
  • 28
  • 44
1 2 3
36
37