Closed elgansayer closed 10 years ago
Body is defined as an 'any' because the definition depends on which physics engine you're using.
This is likely because sprite.body can be one of three different systems, each with their own set of properties and methods.
That makes a lot of sense, Would be impossible have them all.
They don't follow a uniform interface, so unfortunately not. However! You can always do a type cast to get Intellisense if you wrap your sprite. So if you know you're using Arcade physics, when you go to extend sprite, write an an accessor for body that is just a getter to return a type cased version of the phaser body. Then you get strong typed Intellisense :)
On Thu, May 29, 2014 at 11:50 AM, elgansayer notifications@github.comwrote:
Closed #857 https://github.com/photonstorm/phaser/issues/857.
— Reply to this email directly or view it on GitHubhttps://github.com/photonstorm/phaser/issues/857#event-126045639 .
very smart idea of course!, i've just been using the very nice documentation online for now.
Thank you :)
Autocorrect when typing sprite.body.* all seem to be blank?