SgGridMap
Renders a tile-based level from a Grid Map project item. Each cell references meshes or prefabs according to the grid map definition.
Inherits from
Usage
Reference
create
Create a new gridmap object in the scenegraph.
Parameters
selfoptions(table): A table of options to fill the parametersparent(SceneObject): The parent scene object to add this to
Returns
Promise: promise which will resolve to the created object
Example
-- Options can be omitted. This example shows the defaults,
-- only specify the ones you want different.
SgGridMap.create({
active = true,
name = "",
transform = Transform.new(),
layers = {0},
tags = {},
receiveShadow = false,
castShadow = false,
gridMap = nil
})
Properties
You can access these properties directly on the object or through :get("propertyName") or :set("propertyName", value) methods.
| Property | Type | Default | Description |
|---|---|---|---|
| materialCollection | Material Collection | Material Collection whose materials are mapped onto grid cells by index. | |
| meshCollection | Mesh Collection | Mesh Collection whose meshes are placed on grid cells by index. |