File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -501,6 +501,9 @@ var Tilemap = new Class({
501501 * way to configure Sprite properties from within the map editor. For example giving an object a
502502 * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created.
503503 *
504+ * Custom object properties not sharing names with the Sprite's own properties are copied to the
505+ * Sprite's {@link Phaser.GameObjects.Sprite#data data store}.
506+ *
504507 * @method Phaser.Tilemaps.Tilemap#createFromObjects
505508 * @since 3.0.0
506509 *
@@ -579,6 +582,16 @@ var Tilemap = new Class({
579582
580583 if ( ! obj . visible ) { sprite . visible = false ; }
581584
585+ for ( var key in obj . properties )
586+ {
587+ if ( sprite . hasOwnProperty ( key ) )
588+ {
589+ continue ;
590+ }
591+
592+ sprite . setData ( key , obj . properties [ key ] ) ;
593+ }
594+
582595 sprites . push ( sprite ) ;
583596 }
584597 }
You can’t perform that action at this time.
0 commit comments