| @@ -5699,13 +5699,26 @@ function spawnAll() { | |||||
| const category = document.querySelector("#category-picker").value; | const category = document.querySelector("#category-picker").value; | ||||
| const maker = availableEntities[category][element.value]; | const maker = availableEntities[category][element.value]; | ||||
| const entity = maker.constructor(); | const entity = maker.constructor(); | ||||
| if (config.lockYAxis) { | |||||
| yOffset = getVerticalOffset(); | |||||
| } else { | |||||
| // Snap to the ground if it's visible. | |||||
| if (config.groundSnap && pos2pix({x: 0, y: 0}).y < canvasHeight + 50) { | |||||
| yOffset = -config.y; | |||||
| } else { | |||||
| yOffset = config.height.toNumber("meters") / 2; | |||||
| } | |||||
| } | |||||
| displayEntity( | displayEntity( | ||||
| entity, | entity, | ||||
| entity.view, | entity.view, | ||||
| -worldWidth * 0.45 + | -worldWidth * 0.45 + | ||||
| config.x + | config.x + | ||||
| (worldWidth * 0.9 * index) / (count - 1), | (worldWidth * 0.9 * index) / (count - 1), | ||||
| config.y | |||||
| config.y + yOffset | |||||
| ); | ); | ||||
| index += 1; | index += 1; | ||||
| return entityIndex - 1; | return entityIndex - 1; | ||||