スケール
商品説明
このコンポーネントは、エンティティのスケーリング方法を制御します。
プロパティ一覧
Property | Type | 初期値 | 商品説明 |
---|---|---|---|
x | 番号 | 0 | X方向のスケーリング係数。 |
y | 番号 | 0 | Y方向のスケーリング係数。 |
z | 番号 | 0 | Z方向のスケーリング係数。 |
関数一覧
Get
Returns a read-only reference.
Example
ecs.Scale.get(world, component.eid)
Set
Ensures the component exists on the entity, then assigns the (optional) data to the component.
Example
ecs.Scale.set(world, component.eid, {
x: 0,
y: 0,
z: 0
})
Mutate
Perform an update to the component within a callback function. Return true
to indicate no changes made.
Example
ecs.Scale.mutate(world, component.eid, (cursor) => {
カーソル.x = 2;
カーソル.y = 2;
カーソル.z = 2;
return false;
})
Remove
Removes the component from the entity.
Example
ecs.Scale.remove(world, component.eid)
Has
Returns true
if the component is present on the entity.
Example
ecs.Scale.has(world, component.eid)
Reset
Adds, or resets the component to its default state.
Example
ecs.Scale.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.Scale.cursor(world, component.eid)
Acquire
Same behavior as cursor, but commit must be called after the cursor is done being used.
Example
ecs.Scale.acquire(world, component.eid)