import { Container, type PointLike, Texture } from 'pixi.js'
} from '../../../../solid-pixi/src/index'
render(() => <Dragging canvas={document.getElementById('root')! as HTMLCanvasElement} />)
function DraggingContainer() {
const app = useApplication()
const [texture] = useAsset('https://pixijs.com/assets/bunny.png')
let dragTarget: Container | null = null
function onDragMove(event) {
dragTarget.parent.toLocal(event.global, null, dragTarget.position)
app!.stage.off('pointermove', onDragMove)
app!.stage.interactive = true
app!.stage.hitArea = app!.screen
app!.stage.on('pointerup', onDragEnd)
app!.stage.on('pointerupoutside', onDragEnd)
x={Math.random() * app!.screen.width}
y={Math.random() * app!.screen.height}
// store a reference to the data
// the reason for this is because of multitouch
// we want to track the movement of this particular touch
// this.data = event.data;
app!.stage.on('pointermove', onDragMove)
anchor={{ x: 0.5, y: 0.5 } as PointLike}
function Dragging(props) {
<Application background='#1099bb' resizeTo={window} canvas={props.canvas}>