ThinkGeo.com    |     Documentation    |     Premium Support

How to offset TextLabel in Derived TextStyle

I have a derived TextStyle class in order to determine if labels are printing due to overlap rules.


I would like to offset the text of the lable from the point for that lable.  If I use a SimpleTextStyle I can give it offset values.  How can I get my derived TextStyle class to also offset the label?


 


Jim



Jim, 
  
   This might be too simple but there is a TextSytle.XOffsetInPixels and the same for the YOffset. 
  
 David

Jim, 
  
   Another thing you can do as well is whenever you override the method and look at the features you could do it there.  The features at that point should be in screen coordinates and you could loop through them and offset all their points.  Just an idea.  Can you let me know what method you overrode and the what parameters you can access from it? 
  
 David

David,  
  
 I overrode DrawCore, but your simple suggestion worked just fine.  I feel stupid for having missed it.   
  
 Now I just set this.XOffsetInPixels = 8 in the constructor of the TextStyle. 
  
 Thanks

Jim, 
  
   No problem.  The API is quite large and it is easy to get turned around.  I’m glad you get it working! 
  
 David