import store from './store' import * as constraint from './constraint' export function autoCenter(target: any, ...args: any) { constraint.putCenter(target, ...args) if (!target._center_resized) { target._center_resized = true store.game.on('RESIZE', () => constraint.putCenter(target, ...args)) } return target } export function autoCenterX(target: any, ...args: any) { constraint.putCenterX(target, ...args) if (!target._center_x_resized) { target._center_x_resized = true store.game.on('RESIZE', () => constraint.putCenterX(target, ...args)) } return target } export function autoCenterY(target: any, ...args: any) { constraint.putCenterY(target, ...args) if (!target._center_y_resized) { target._center_y_resized = true store.game.on('RESIZE', () => constraint.putCenterY(target, ...args)) } return target } export function autoLeft(target: any, ...args: any) { constraint.putLeft(target, ...args) if (!target._left_resized) { target._left_resized = true store.game.on('RESIZE', () => constraint.putLeft(target, ...args)) } return target } export function autoTop(target: any, ...args: any) { constraint.putTop(target, ...args) if (!target._top_resized) { target._top_resized = true store.game.on('RESIZE', () => constraint.putTop(target, ...args)) } return target } export function autoRight(target: any, ...args: any) { constraint.putRight(target, ...args) if (!target._right_resized) { target._right_resized = true store.game.on('RESIZE', () => constraint.putRight(target, ...args)) } return target } export function autoBottom(target: any, ...args: any) { constraint.putBottom(target, ...args) if (!target._bottom_resized) { target._bottom_resized = true store.game.on('RESIZE', () => constraint.putBottom(target, ...args)) } return target }