I was wondering if there is something like Flash’s hitTestObject in Corona. I figure I can write a simple function using contentBounds and maybe localToContent that’ll do the job, but before bothering with that I want to know if there is already a way built in. [import]uid: 12108 topic_id: 5158 reply_id: 305158[/import]
btw for people not familiar with Flash here is their documentation on this command
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#hitTestObject() [import]uid: 12108 topic_id: 5158 reply_id: 17117[/import]
without using physics? [import]uid: 6645 topic_id: 5158 reply_id: 17119[/import]
yes [import]uid: 12108 topic_id: 5158 reply_id: 17138[/import]
can you not use physics with gravity zero, and kinematic objects/sensors etc
might be overkill, but otherwise you’ll have to bounds check etc manually i’m sure [import]uid: 6645 topic_id: 5158 reply_id: 17191[/import]
Turning on physics for this would definitely be overkill, since literally the only time I’d be using physics in my game would be to make this check about every other minute.
Checking the bounds is pretty easy since display objects have the contentBounds property, and it doesn’t seem any simpler approaches are forthcoming. [import]uid: 12108 topic_id: 5158 reply_id: 17207[/import]