Kategorie: Landschaft
/ Material
Ab Engineversion: 1.0 OC
InsertMaterial
Beschreibung
Fügt ein Materialpixel an der angegebenen Position in der angegebenen Geschwindigkeit ein.
Syntax
bool InsertMaterial(int material_index, int x, int y, int xdir, int ydir, proplist out_insertpos);
Parameter
- material_index:
- Einzufügendes Material (siehe Material())
- x:
- [opt] X-Einfügeposition/-offset
- y:
- [opt] Y-Einfügeposition/-offset
- xdir:
- [opt] X-Geschwindigkeit des eingefügten Mateiralpixels
- ydir:
- [opt] Y-Geschwindigkeit des eingefügten Mateiralpixels
- out_insertpos:
- [opt] If a writeable proplist is passed, members x and y are filled with the actual insertion position.
Anmerkungen
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.
Siehe auch: Material