| | |
| | | import React, { useState, useRef, useEffect } from 'react'; |
| | | import moment from 'moment'; |
| | | import { Col, Form, Input, Row, Checkbox, Slider, Select, Drawer, Space, Button, InputNumber, Switch } from 'antd'; |
| | | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; |
| | | import * as PIXI from 'pixi.js'; |
| | | import { createStyles } from 'antd-style'; |
| | | import './index.css'; |
| | | import * as Utils from '../utils' |
| | | import * as PIXI from 'pixi.js'; |
| | | import moment from 'moment'; |
| | | import Http from '@/utils/http'; |
| | | |
| | | const useStyles = createStyles(({ token, css }) => { |
| | |
| | | default: |
| | | break; |
| | | } |
| | | Utils.removeSelectedEffect(); |
| | | Utils.showSelectedEffect(curSprite); |
| | | }) |
| | | }) |
| | | } |
| | |
| | | |
| | | export const showSelectedEffect = (sprite) => { |
| | | const { width, height } = sprite; |
| | | const scale = mapContainer.scale.x; |
| | | const scale = sprite.scale.x; |
| | | const sideLen = (Math.max(width, height) + 10) * scale; |
| | | const color = 0x273c75; |
| | | |
| | | effectHalfCircle = new PIXI.Graphics(); |
| | | effectHalfCircle.beginFill(color); |
| | | effectHalfCircle.lineStyle(2, color); |
| | | effectHalfCircle.lineStyle(2 * scale, color); |
| | | effectHalfCircle.arc(0, 0, sideLen, 0, Math.PI); |
| | | effectHalfCircle.endFill(); |
| | | effectHalfCircle.position.set(sprite.x, sprite.y); |
| | | effectHalfCircle.scale.set(1 / scale); |
| | | |
| | | effectRectangle = new PIXI.Graphics(); |
| | | effectRectangle.lineStyle(2, color, 1); |
| | | effectRectangle.drawRoundedRect(0, 0, sideLen, sideLen, 16); |
| | | effectRectangle.lineStyle(2 * scale, color, 1); |
| | | effectRectangle.drawRoundedRect(0, 0, sideLen, sideLen, 16 * scale); |
| | | effectRectangle.endFill(); |
| | | effectRectangle.mask = effectHalfCircle; |
| | | |