| | |
| | | import MuiInput from '@mui/material/Input'; |
| | | import { useTranslate } from 'react-admin'; |
| | | import * as Tool from '../tool'; |
| | | import ConfirmButton from '../../page/components/ConfirmButton'; |
| | | |
| | | const MapSettings = (props) => { |
| | | const { sprite, setSpriteSettings, onSubmit } = props; |
| | |
| | | rotation: (sprite?.rotation * 180) / Math.PI || 0, |
| | | copyDirection: 'right', |
| | | copyCount: 1, |
| | | // 其他默认值... |
| | | }, |
| | | }); |
| | | |
| | | // 监听所有字段的变化 |
| | | const watchAllFields = watch(); |
| | | |
| | | useEffect(() => { |
| | |
| | | scaleX: sprite.scale.x, |
| | | scaleY: sprite.scale.y, |
| | | rotation: (sprite.rotation * 180) / Math.PI, |
| | | // 设置其他字段的初始值 |
| | | }); |
| | | } |
| | | }, [sprite, reset]); |
| | | |
| | | // 更新精灵属性的函数 |
| | | const updateSprite = (data) => { |
| | | if (sprite) { |
| | | sprite.position.x = data.x; |
| | |
| | | sprite.scale.x = data.scaleX; |
| | | sprite.scale.y = data.scaleY; |
| | | sprite.rotation = (data.rotation * Math.PI) / 180; |
| | | // 更新其他属性... |
| | | } |
| | | }; |
| | | |
| | |
| | | }}> |
| | | {translate('ra.action.delete')} |
| | | </Button> |
| | | {/* <ConfirmButton /> */} |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |