       background.regY = h + pointerHeight
     else if o.vPos is "top"
       background.regY = -pointerHeight
+
+    if @style is Label.STYLE_TEXT
+      if o.hPos is 'left'
+        background.regX = 0
+      else if o.hPos is 'right'
+        background.regX = o.textWidth
+      background.regY = h / 2
+      if o.vPos is "bottom"
+        background.regY = h
+      else if o.vPos is "top"
+        background.regY = 0
 
     o.label.regX = background.regX - o.marginX
     o.label.regY = background.regY - o.marginY


  buildLabelOptions: ->
    o = {}
    st = {dialogue: 'D', say: 'S', name: 'N', variable: 'V'}[@style]
    o.marginX = {D: 5, S: 6, N: 3, V: 0}[st]
    o.marginY = {D: 6, S: 4, N: 3, V: 0}[st]
    o.fontWeight = {D: 'bold', S: 'bold', N: 'bold', V: 'bold'}[st]
    o.shadow = {D: false, S: true, N: true, V: true}[st]
    o.shadowColor = {D: '#FFF', S: '#000', N: '#000', V: "#000"}[st]
    o.fontSize = {D: 25, S: 12, N: 24, V: 18}[st]
    o.lineSpacing = 2
    o.fontFamily = {D: 'Arial', S: 'Arial', N: 'Arial', B: 'Arial', V: 'Arial'}[st]
    o.textAlign = "left" # it's disabled for customizing on purpose, we don't need it now and need to rework "bubble" forming for that
    o.fontColor = {D: '#000', S: '#FFF', N: '#6c6', V: '#6c6'}[st]
    if @style is 'name' and @sprite?.thang?.team is 'humans'
      o.fontColor = '#c66'
    else if @style is 'name' and @sprite?.thang?.team is 'ogres'
      o.fontColor = '#66c'
    else if @style is 'variable'
      o.fontColor = '#fff'

    o.backgroundFillColor = {D: 'white', S: 'rgba(0,0,0,0.4)', N: 'rgba(0,0,0,0.7)', V: 'rgba(0,0,0,0.7)'}[st]
    o.backgroundStrokeColor = {D: 'black', S: 'rgba(0,0,0,0.6)', N: 'rgba(0,0,0,0)', V: 'rgba(0,0,0,0)'}[st]
    o.backgroundStrokeStyle = {D: 2, S: 1, N: 1, V: 1}[st]
    o.backgroundBorderRadius = {D: 10, S: 3, N: 3, V: 3}[st]
    o.layerPriority = {D: 10, S: 5, N: 5, V: 5}[st]
    o.maxWidth = {D: 300, S: 300, N: 180, V: 100}[st]
    o.maxWidth = Math.max @camera.canvasWidth / 2 - 100, o.maxWidth
    o.maxLength = {D: 100, S: 100, N: 30, V: 30}[st]
    o = _.merge(o, @labelOptions)
    o.fontDescriptor = "#{o.fontWeight} #{o.fontSize}px #{o.fontFamily}"
    multiline = @addNewLinesToText _.string.prune(@text, o.maxLength), o.fontDescriptor, o.maxWidth

  # We might want to combine 'say' and 'name'; they're very similar
  # Nick designed 'say' based off of Scott's 'name' back when they were using two systems
  @STYLE_VAR = 'variable'
  @STYLE_TEXT = 'text' # "Direct" label on the sprite pos without following screen caps

  @BITMAP_SPACE = 20 # Size extenstion for speech bubbles for box pointers

