mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
Added support for scrollFactor to the BuildGameObject.
This commit is contained in:
parent
2aadd2ac79
commit
a50a8d31f7
1 changed files with 15 additions and 0 deletions
|
@ -30,6 +30,21 @@ var BuildGameObject = function (state, gameObject, config)
|
|||
gameObject.scaleY = GetAdvancedValue(scale, 'y', 1);
|
||||
}
|
||||
|
||||
// ScrollFactor
|
||||
// Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }}
|
||||
|
||||
var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null);
|
||||
|
||||
if (typeof scrollFactor === 'number')
|
||||
{
|
||||
gameObject.setScrollFactor(scrollFactor);
|
||||
}
|
||||
else if (scrollFactor !== null)
|
||||
{
|
||||
gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1);
|
||||
gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1);
|
||||
}
|
||||
|
||||
// Rotation
|
||||
|
||||
gameObject.rotation = GetAdvancedValue(config, 'rotation', 0);
|
||||
|
|
Loading…
Reference in a new issue