hittest

Hit detection when drawing lines in iOS

最后都变了- 提交于 2019-12-17 16:27:32
问题 I would like to allow the user to draw curves in such a way that no line can cross another line or even itself. Drawing the curves is no problem, and I even found that I can create a path that is closed and still pretty line-like by tracing the nodes of the line forwards and back and then closing the path. Unfortunately, iOS only provides a test for whether a point is contained in a closed path (containsPoint: and CGPathContainsPoint). Unfortunately, a user can pretty easily move their finger

AS3 Stop character from moving through walls

此生再无相见时 提交于 2019-12-14 02:10:53
问题 I want to stop the movieclips movement when it hits a wall (another movieclip). The example below works, but after the collision the movieclip 'blocks' all movement to the left... My question to you is, is this a good way and why isn't it working well? There will be something wrong in this code, but i'm learning. For now the example with the leftArrow key; variables to check the key, if it's hitting the walls and if it's moving or not: var leftArrow:Boolean; var speed:int = 10; var hitting

AS3 - array hit test in 'for each' loop only works properly with last object in array

给你一囗甜甜゛ 提交于 2019-12-13 05:50:57
问题 I'm trying to build a platform game in AS3 by placing all instances of my Platform class into an Array, then running a for each loop with a hitTestObject to check whether the player is touching any of them. My problem is that whilst the player will react correctly to touching each of the platforms in the Array (i.e. stop falling and set y position to the top of the platform), I can only perform the jump function whilst standing on the last Platform in the Array. I'm fairly new to ActionScript

as3 Enemies in an array hit testing each other?

懵懂的女人 提交于 2019-12-13 04:02:47
问题 I'm progressing slowly with my test game, and I've gotten to the point where I can add enemies to the stage through an array, they follow the player and rotate towards the player with no problem. My next task is to give each enemy collision detection with each other, otherwise they all eventually just completely overlap each other and that's not very realistic. Here's my code so far just regarding the enemies: public function initEnemy():void { enemyArray = new Array(); for (var i = 0; i < 2;

IOS/Objective-C: Pass Touch Event on ScrollView to View Below using HitTouch

半城伤御伤魂 提交于 2019-12-13 03:55:59
问题 I have a bug where touches to the bottom area of a textview that can only be reached by scrolling are not being recognized. Using the visual debugger, I discovered that a scrollview was blocking the bottom of the view. A number of questions on SO and some Apple docs and this excellent article here suggest when you have a view blocking one below, you need to implement some version of the following method: - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { NSLog(@"hit test firing")

How can I get rid of non-null hitTestObject error with already instantiated objects?

安稳与你 提交于 2019-12-13 03:25:13
问题 I am a beginner/intermediate AS3 "programmer" trying to complete a skeeball-like flash-based game for a university assessment, and I'm doing myself serious mental damage trying to get even basic object (ball) collisions working with scoring targets on my stage. I'm using a power bar type variable to determine the force of the ball roll which is translated into a tween to create a smooth movement up my "lane" and into the scoring area (this is overhead perspective). The targets are instances

as3 draw with mouse and erase lines when hitTestObject is reached

谁说我不能喝 提交于 2019-12-13 02:59:02
问题 I am trying to create a simple hitTestObject and see the lines that are being drawing on screen hit with a Ball. If it does it will erase all lines and start fresh. I am very close. The checkIt() function is where the code needs to happen and its clearing the lines but not making a new shape. How can I erase the lines the mouse drew and start fresh when a hit test is reached? var myshape:Shape; myshape = new Shape(); myshape.graphics.lineStyle(12, 0xC807DE); var alreadyDrawn:Shape;

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

ぐ巨炮叔叔 提交于 2019-12-12 08:26:35
问题 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 button to start a new diagram. However, because the border has its IsHitTestVisible set to False , it shorts out the True value of the button so the user can't click on the button. That said, how can you make a control invisible to the mouse, while

WPF: How to make an overlay control with transparent canvas and clickable child

断了今生、忘了曾经 提交于 2019-12-12 07:47:15
问题 I want to make a custom control which will be used as an overlay. The control should contain a couple of child controls which should be drawn and should be clickable as usual. But everything else in the control should be transparent and "clickable-through". Here is how I try to achieve this... First, I'm using PreviewMouseDown\Up\Move events in the window where the overlay is going to be placed. I want these events to "go through" transparent part of my custom control, but stop at not

Hit-Testing and Resolving Occlusion of AutoShapes in Excel

我只是一个虾纸丫 提交于 2019-12-12 06:17:27
问题 I am using code to draw a number of AutoShapes in Excel based on user input using VBA. However, some of these shapes may occlude each other, so I would like to run a second pass to hit-test which shapes occlude and to nudge them until they no longer occlude. So the basic pseudocode outline would be: do foreach shape s in shapes if (s.hittest(shapes)) then do s.nudgeup(1) until (!s.hittest(shapes)) endif next until (!shapes.hittest(shapes)) Can any of you think of some way of doing this (or