| 1165 | } |
| 1166 | |
| 1167 | void CStaticMap::DrawName(const ParamEntry& cls) |
| 1168 | { |
| 1169 | Vector3 pos; |
| 1170 | pos.Init(); |
| 1171 | pos[0] = (cls >> "position")[0]; |
| 1172 | pos[2] = (cls >> "position")[1]; |
| 1173 | pos[1] = 0; |
| 1174 | DrawCoord pt = WorldToScreen(pos); |
| 1175 | |
| 1176 | float size = _sizeNames * (_invScaleX * 0.05); |
| 1177 | saturate(size, 0.5 * _fontNames->Height(), 2.0 * _fontNames->Height()); |
| 1178 | |
| 1179 | RString text = cls >> "name"; |
| 1180 | float h = size; |
| 1181 | float w = GEngine->GetTextWidth(size, _fontNames, text); |
| 1182 | |
| 1183 | if (pt.x + w < _x) |
| 1184 | { |
| 1185 | return; |
| 1186 | } |
| 1187 | if (pt.y + 0.5 * h < _y) |
| 1188 | { |
| 1189 | return; |
| 1190 | } |
| 1191 | if (pt.x > _x + _w) |
| 1192 | { |
| 1193 | return; |
| 1194 | } |
| 1195 | if (pt.y - 0.5 * h > _y + _h) |
| 1196 | { |
| 1197 | return; |
| 1198 | } |
| 1199 | |
| 1200 | GEngine->DrawText(Point2DFloat(pt.x, pt.y - 0.5 * h), size, Rect2DFloat(_x, _y, _w, _h), _fontNames, _colorNames, |
| 1201 | text); |
| 1202 | } |
| 1203 | |
| 1204 | void CStaticMap::DrawMount(Vector3Par pos) |
| 1205 | { |
nothing calls this directly
no test coverage detected