======================================================================== (2D)MarkerAutoRotate.gsm
eps=0.0001 angleViewRot = 0 if Marker then rrr = REQUEST ("View_Rotangle", "", angleViewRot) endif totalRotate = (SYMB_ROTANGLE + angleViewRot) MOD 360 ! ----------------------------------------------------------------2D TEXT unID = 20000 if Marker then HOTSPOT2 0, MarkerPos_y, unID, MarkerPos_x, 1+128 : unID=unID+1 HOTSPOT2 MarkerPos_x, MarkerPos_y, unID, MarkerPos_x, 2 : unID=unID+1 HOTSPOT2 -1, MarkerPos_y, unID, MarkerPos_x, 3 : unID=unID+1 HOTSPOT2 MarkerPos_x, 0, unID, MarkerPos_y, 1+128 : unID=unID+1 HOTSPOT2 MarkerPos_x, MarkerPos_y, unID, MarkerPos_y, 2 : unID=unID+1 HOTSPOT2 MarkerPos_x, -1, unID, MarkerPos_y, 3 : unID=unID+1 add2 MarkerPos_x,MarkerPos_y !MarkerRotation - Readable / Always Horizontal / Align with Symbol ! ---------------------------------------------------------------------- if MarkerRotation_m = 2 then ! Readable rot2 180 * (totalRotate > (gs_readable_angle + eps) & totalRotate < (gs_readable_angle + 180 + eps)) else if MarkerRotation_m = 1 then ! Horizontal rot2 totalRotate * (SYMB_MIRRORED - not(SYMB_MIRRORED)) ! 1/-1 endif endif ! ---------------------------------------------------------------------- pen MarkerFontPen define style ElemMarker MarkerFont, 10/GLOB_SCALE*MarkerFontSize, 8,4 define style Value MarkerFont, 10/GLOB_SCALE*MarkerFontSize, 2,0 style ElemMarker text2 0,0,MarkerText style Value text2 0,0,MarkerTextUnderLine del 1 endif
parameters MarkerFontSize = abs(MarkerFontSize) values "MarkerFontSize" range (0,] values "MarkerRotation" `Читаемый`,`Горизонтально`,`Выровнять по символу` values "MarkerRotation_m" 2, 1, 0 if GLOB_MODPAR_NAME = "MarkerRotation" then if MarkerRotation= `Читаемый` then MarkerRotation_m = 2 if MarkerRotation= `Горизонтально` then MarkerRotation_m = 1 if MarkerRotation= `Выровнять по символу` then MarkerRotation_m = 0 parameters MarkerRotation_m = MarkerRotation_m else if MarkerRotation_m = 2 then MarkerRotation= `Читаемый` if MarkerRotation_m = 1 then MarkerRotation= `Горизонтально` if MarkerRotation_m = 0 then MarkerRotation= `Выровнять по символу` parameters MarkerRotation= MarkerRotation endif dim fontNames[] n = request("FONTNAMES_LIST", "", fontNames) values "MarkerFont" fontNames, custom ======================================================================== |
NOTES >