content: sub init()
      m.container = m.top.findNode("container")
      m.message = m.top.findNode("message")
      m.timer = m.top.findNode("timeout")
      
      m.maxwidth = 1080
      m.container.color = m.global.colors["color-black"]
      m.container.opacity = 0
  
      m.timer.ObserveField("state","setTimeout")
  end sub
  
  sub setMessage(event as Object)
      message = event.getData()
      size = m.message.font.size
  
      width = len(message)*(size/2)
  
      print(width)
  
      if width > m.maxwidth
          print("entre")
          m.message.width = m.maxwidth
      else
          print("no entre")
          m.message.width = width 
      end if
      
      m.message.text = message
      setPosition()
  end sub 
  
  sub setShow(event as object)
      visible = event.getData()
      m.top.visible = visible
      if visible
          m.global.scene.appendChild(m.top)
          m.timer.control = "start"
      else
          m.timer.control = "stop"
      end if
  end sub
  
  sub setPosition()
      height = m.message.boundingRect().height
      width = m.message.boundingRect().width 
  
      m.container.width = width
      m.container.height = height
  
      posX = (1280 - width) / 2
      posY = (670 - height)
      
      m.top.translation = [posX, posY]
  end sub
  
  sub setTimeout(event = invalid as object)
      state = event.getData()
      print(state)
      if state <> "running"
          m.top.visible = false
          m.global.scene.removeChild(m.top)
      end if
  end sub
  
  