export function addText ( scene , x , y , content ) { const text = scene . add . text ( x , y , content ) ; const globalFontFamily = '"Noto Sans JP", sans-serif' ; const globalFontTestString = '䲜笑う狭い友達|週漢字|MÉgjpqy' ; text . setFontFamily ( globalFontFamily ) ; text . style . setTestString ( globalFontTestString ) ; return text ; } export function shuffle ( array ) { var currentIndex = array . length , randomIndex ; while ( 0 !== currentIndex ) { randomIndex = Math . floor ( Math . random ( ) * currentIndex ) ; currentIndex -- ; [ array [ currentIndex ] , array [ randomIndex ] ] = [ array [ randomIndex ] , array [ currentIndex ] ] ; } return array ; } export function tweenPromise ( scene , config ) { return new Promise ( resolve => { ( config as Phaser . Types . Tweens . TweenBuilderConfig ) . onComplete = resolve ; scene . tweens . add ( config ) ; } ) ; } export function sleep ( ms ) { return new Promise ( resolve => setTimeout ( resolve , ms ) ) ; }