Total Pageviews

Monday, April 21, 2014

physics.removeBody()

physics.removeBody()
ប្រើសំរាប់ removed a physics body ចេញពី Display object ដោយគ្មានការ destroying the entire object។ សំរាប់ការ remove the body វានឹងបង្កើតនៅ physics.addBody()។ សំរាប់ API នេះមិនអាចប្រើនៅក្នុង Collision event listener។ physics.removeBody() គ្រាន់តែ remove physics body ចេញពី DisplayObject – it does not remove the display object itself។ សំរាប់ហ្វាំងសិននេះត្រឡប់ជា true បើសិនជា body វាត្រូវបាន removed and false បើសិនជាមិនបាន removed។ API will fail បើសិនជាហៅនៅ any collision event listener
Syntax:
physics.removeBody( object )
object (required)
DisplayObject. The object whose physics body will be removed.

សូមមើលកូដះ
if not ( physics.removeBody( object ) ) then
    print( "Could not remove physics body" )
end


No comments:

Post a Comment