title: Adding a new line to a canvas.textout
body: <p>I am trying to put this to the canvas text out</p>
  
  <p>Name
  Flying
  Lava
  Water</p>
  
  <p>Doing it like so.. it checks if the player should have something under there name like flying,lava,or water.  So label text starts as the players name. All labels will have this. and then if any of the "extras" like canwater are true then it will add a new line with the related text. Seen below.</p>
  
  <pre><code>                canwater := (FTherePlayers.Player[strtoint(name2)].values['water'] = 'Yes');  //checks if unit can enter water
                  canlava := (FTherePlayers.Player[strtoint(name2)].values['lava'] = 'Yes');  //checks if unit can enter lava
                  canfly := (FTherePlayers.Player[strtoint(name2)].values['Flying'] = 'Yes');   //checks if unit can fly
                  labeltext :=  FTherePlayers.Player[strtoint(name2)].values['name'];
                 if canfly then
                    labeltext := labeltext+ #13#10+ 'Flying';
                 if canlava then
                    labeltext := Labeltext+#13#10+'Lava';
                 if canwater then
                    labeltext := labeltext+#13#10+'Water';
                 hexmap1.AddLabelName(Labeltext,posL); //add name to placement label
  </code></pre>
  
  <p>Now it will give the correct info to the caption. But it never adds the new line, instead it will look something like this</p>
  
  <pre><code>name[][]flying[][]lava[][]water[][]
  </code></pre>
  
  <p>where [] are small squares
  The code i am using for the textout looks like this.</p>
  
  <pre><code>procedure THexmap.AddLabelName(text :string; Position :TPoint);
  var
    hex_id :string;
    P0:tpoint;
  
  begin
      with TempMap.canvas do
     begin
        hex_id := text;
             hex_id := text;
             {font := self.font;}
             p0 := convertcoords(point(Position.X,Position.Y),ptROWCOL);
             textout(p0.x - (trunc(textwidth(hex_id) / 2)) ,p0.y- (textheight(hex_id)) ,hex_id);
     end;
         Refresh;
  end;
  </code></pre>
  
  <p>pretty much it loads the new images or in this case text, to a temp map.. the hex_ID is the name/flying/lava..ect  the PO is Where to put it on the map aka  row 1 , column 3.  As for the textout, i am not sure how that works.. But figure the "newline" code #10#13 is getting messed up there. So any ideas on how i can fix this?</p>
  
  <p>added how i get my XY(tpoint)</p>
  
  <pre><code>{******************************************************************************}
  {  This function will return the Row / Col pair based on a given X/Y
     for a using application that calls it}
   function THexMap.ConvertCoords(point:Tpoint;pointtype:Tpointtype):Tpoint;
   var
     temp:TPoint;
   begin
     case PointType of
       ptXY: {Convert from x/y to Row/Col}
       Begin
  
         temp.x:= round( (point.x + (HexRadius/2) ) / (1.5 * Hexradius));
  
  
  
         if odd(temp.x) then
            temp.y := round( (point.y + rise) / (rise*2))
         else
            temp.y := round( point.y  / (2*rise));
  
         { This section insures row / col is good}
        if (temp.x &lt; 1) or (temp.y &lt; 1) then
           begin
             temp.x := 0;
             temp.y := 0;
            end
         else if (temp.y &gt; HexRows) or (temp.x &gt; HexColumns) then
           begin
             temp.y := 0;
             temp.x := 0;
           end;
  
         ConvertCoords := temp;
       end;
  
       ptRowCol:  { Converts Row/Col to X/Y }
       begin
         if point.x=1 then
          temp.x:= HexRadius
         else
          temp.x := HexRadius+(point.x-1) * (round(1.5 * hexradius));
  
         if odd(point.x) then
          if point.y=1 then
             temp.y:= rise
          else
             temp.y := rise+(point.y-1) * (2 * rise)
         else
           temp.y := (point.y * (2*rise));
  
         ConvertCoords := temp;
       end;
     end;
   end;
  </code></pre>