td2-visualizer/src/components/map/object-renderers/SpawnPointRenderer.jsx
izawartka db1c21757a Update icon urls base
- Updated icon urls to use BASE_URL instead of PUBLIC_URL
2026-08-12 20:58:10 +02:00

31 lines
1012 B
JavaScript

import { ReactSVG } from 'react-svg'
import AlwaysUpText from '../text/AlwaysUpText';
export default function SpawnPointRenderer(props) {
const { object } = props;
const [x, y] = object.pos.toSVGCoords();
return (
<g transform={`translate(${x}, ${y}) rotate(${object.rot.y})`}>
<g className="map-icon" transform={`rotate(180) translate(-2.835, -2.835)`}>
<ReactSVG
src={`${import.meta.env.BASE_URL}assets/spawn.svg`}
wrapper='svg'
beforeInjection={(svg) => {
svg.setAttribute('width', '1.5mm');
svg.setAttribute('height', '1.5mm');
}}
/>
</g>
<AlwaysUpText
baseRot={object.rot.y}
additionalRot={-90}
offsetY={3}
reverseAnchor={true}
text={object.getPrintableSpawnPointName()}
/>
</g>
);
}