Category: Landscape / Material
Since engine version: 5.1 OC
Inserts a material pixel at the given position and given speed.
bool InsertMaterial(int material_index, int x, int y, int xdir, int ydir, proplist out_insertpos);
- Material to be inserted (see Material()).
- [opt] X insert position or offset
- [opt] Y insert position or offset
- [opt] horizontal speed of material pixel to be inserted
- [opt] vertical speed of material pixel to be inserted
- [opt] If a writeable proplist is passed, members x and y are filled with the actual insertion position.
If the target position already contains material of the same density as the inserted material, the engine will search upwards for a proper insertion position.
If the target position is outside the landscape (either because one of the parameters is outside the map or because insertion position search found such a position), no material is inserted. The function still returns success if the out-of-landscape position has the same or lower density than the inserted pixel. Out-of-landscape densities are controlled by *Open-parameters in the Scenario.txt [Landscape] section.
For the sake of material insertion calculations, all densities above C4M_Solid are considered the same.
See also: Material