|
-
Senior Member
Hittest Question
I cant figure out how to use getbounds, might be because im tryed, so any hoo, i have a huge freaking long hittest and i porably could half its length if i use getBounds (I know how it does, i just cant get the sytax right).
Could someone please translate this for me to work useing getBounds.
Hero._x+Hero._width/2, Hero._y+Hero._height/2,
Cheers
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
OOP is one letter from OOPS
getBounds takes a movieclip as a parameter and returns min and max values for x and y. What exactly are you trying to end up with?
-
Not exactly sure what you are trying to achieve either, but this might help:
hitTestBounds = function(mc, targetMc) {
var bounds:Object = mc.getBounds(targetMc);
mc.yMin = bounds.yMin;
mc.yMax = bounds.yMax;
mc.xMax = bounds.xMax;
mc.xMin = bounds.xMin;
}
hitTestBounds(Hero, targetMc);
var x = (Hero.xMin + Hero.xMax)/2;
var y = (Hero.yMin + Hero.yMax)/2;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|