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