import { Text, TextStyle } from 'pixi.js'

export const dropShadowStyle = {
  alpha: 0.5,
  angle: 0.3,
  blur: 5,
  distance: 4
}

export const mainText = new TextStyle({
  dropShadow: dropShadowStyle,
  fill: '#b71a1a',
  fontFamily: 'Arial, Helvetica, sans-serif',
  fontWeight: 'bold',
  letterSpacing: 1,
  stroke: '#658f56'
})

export function createText(str: string, x: number, y: number, style: TextStyle = mainText) {
  const text = new Text({ text: str, style })
  text.anchor.set(0.5, 0.5)
  text.x = x
  text.y = y
  return text
}
