td2-visualizer/src/components/map/object-renderers/SwitchNameRenderer.js
izawartka b76752e40d Added Vector3 class, code cleanup
+Added Vector3 class and replaced all position and angle values with it to clean up the code
*Minor bugfixes and code cleanup
2025-06-01 01:54:26 +02:00

19 lines
430 B
JavaScript

export default function SwitchNameRenderer(props) {
const { object } = props;
const [x, y] = object.pos.toSVGCoords();
const text = object.id_switch;
return (
<text
x={x}
y={y}
textAnchor='middle'
id={`switch-${object.id}`}
style={{ userSelect: "none" }}
className="switch-name"
>
{text}
</text>
);
}