本文へスキップ

地図テーマ

説明

このコンポーネントはマップの視覚的テーマを表します。

名称タイプデフォルト説明
ランドカラーストリング#FFFFFFFF16進コードによる土地の色
土地容量番号1土地の不透明度範囲(0.0~1.0)
ランドビジビリティブーリアン真の土地の視認性
ビルディングカラーストリング#FFFFFFFF16進コードによる建物の色
建物容量番号1建物の不透明度範囲(0.0~1.0)
建物最小メーター番号6建物の最低高(メートル
ビルディング・マックスメーター番号6建物の最大高さ(メートル
ビルディング可視性ブーリアン真の建物の視認性
ビルディングベース番号0.014土地からオフセットされた建物の底の高さ
パークカラーストリング#FFFFFFFF16進コードによる公園の色
パーク容量番号1公園の不透明度範囲(0.0~1.0)
パーク可視性ブーリアン真のチェックボックスとしての公園の可視性
パークベース番号0.002公園の高さ、土地からのオフセット
パーキングカラーストリング#FFFFFFFF駐車場の色を16進コードで表示
パーキング容量番号1駐車場の不透明度範囲(0.0~1.0)
パーキング可視性ブーリアン真の駐車場の視認性
パーキングベース番号0.008駐車場の高さ、土地からのオフセット
トランジットカラーストリング#FFFFFFFF16進コードによる通過線の色
トランジット・オパシティ番号1トランジットラインの不透明度範囲(0.0~1.0)
トランジットビジビリティブーリアン真のトランジット・ラインの視認性
トランジットメーター番号6トランジット・ラインの幅(メートル
トランジットベース番号0.012トランジット・ラインの高さ、土地からのオフセット
トランジット最小番号0ズームアウト時のトランジットラインの最小マッピングシステム単位幅
ロードカラーストリング#FFFFFFFF16進コードによる道路の色
道路容量番号1道路の不透明度範囲(0.0~1.0)
ロードビジビリティブーリアン真の道路の視認性
ロードメーター番号2S字道路の幅(メートル
ロードメーター番号4M道路の幅(メートル
ロードメーター番号8L字道路の幅(メートル
ロードXLメーター番号32XL道路の幅(メートル
ロードスミン番号0S字道路の最小マッピングシステム単位幅(ズームアウト時
ロードミン番号0ズームアウト時のM道路の最小マッピングシステム単位幅
ロードルミン番号0L字道路の最小マッピングシステム単位幅(ズームアウト時
ロードXLミン番号0XL道路の最小マッピングシステム単位幅(ズームアウト時
ロードベース番号0.01道路の高さ、土地からのオフセット
サンドカラーストリング#FFFFFFFF16進コードによる砂の色
砂の不透明度番号1砂の不透明度範囲(0.0~1.0)
サンドビジビリティブーリアン真の砂の視認性
サンドベース番号0.004砂の高さ、陸地からのオフセット
ウォーターカラーストリング#FFFFFFFF16進コードによる水路の色
不透明度番号1水路の不透明度範囲(0.0~1.0)
ウォータービジビリティーブーリアン真の水路の視認性
水幅番号6水路の幅(メートル
ウォーターベース番号0.006水路の高さ、陸地からのオフセット
ウォーターミン番号0水路の最小マッピングシステム単位幅(ズームアウト時
ロッド番号1詳細レベル。 LODが1より高いとタイルデータが少なく(ディテールが低く)レンダリングされ、LODが1より低いとタイルデータが多く(ディテールが高く)レンダリングされます。 LODは0より大きくなければならない。

機能

Get

Returns a read-only reference.

Example

ecs.MapTheme.get(world, component.eid)

Set

Ensures the component exists on the entity, then assigns the (optional) data to the component.

Example

ecs.MapTheme.set(world, component.eid, {
landColor: '#AEC988',
buildingColor: '#EFEFEA',
parkColor: '#80B063',
buildingOpacity: 0.4,
buildingMinMeters: 6,
buildingMaxMeters: 50
})

Mutate

Perform an update to the component within a callback function. Return true to indicate no changes made.

Example

ecs.MapTheme.mutate(world, component.eid, (cursor) => {
cursor.buildingColor = '#FFFFFF';
cursor.transitColor = '#000000';
return false;
})

Remove

Removes the component from the entity.

Example

ecs.MapTheme.remove(world, component.eid)

Has

Returns true if the component is present on the entity.

Example

ecs.MapTheme.has(world, component.eid)

Reset

Adds, or resets the component to its default state.

Example

ecs.MapTheme.reset(world, component.eid)

Advanced Functions

Cursor

Returns a mutable reference. Cursors are reused so only one cursor for each component can exist at a time.

Example
ecs.MapTheme.cursor(world, component.eid)

Acquire

Same behavior as cursor, but commit must be called after the cursor is done being used.

Example
ecs.MapTheme.acquire(world, component.eid)

Commit

Called after acquire. An optional third argument determines whether the cursor was mutated or not.

Example
ecs.MapTheme.commit(world, component.eid)
ecs.MapTheme.commit(world, component.eid, false)

Dirty

Mark the entity as having been mutated. Only needed in a specific case where systems are mutating data.

Example
ecs.MapTheme.dirty(world, component.eid)