physics_fixture_set_awake


描述

When you start a room with physics, or bind fixtures to instances, the fixtures are always considered to be "awake"... that is to say, they are processing events and interacting with the surrounding instances. However this can sometimes lead to problems, especially if you have a number of instances with fixtures that are side by side when a room starts (think of a tower made of various instances with fixtures) as with them being "awake" they will move and possibly change position due to the sudden start of gravity and collisions affecting them. In these cases you can use this function to flag the fixture as been "asleep", in which case it will not be processing anything when it is first created in the room.


语法:

physics_fixture_set_awake(fixture, state)

参数 描述
fixture the index of the fixture
标识 whether a fixture is awake (true) or not (false)


返回:

N/A(无返回值)


例如:

physics_fixture_set_awake(fix_Cloud, true);

The code above flag the fixture as being "awake" when bound to an instance.