An open API service indexing awesome lists of open source software.

https://github.com/sammccord/solid-pixi

Create PIXI applications with JSX and Signals
https://github.com/sammccord/solid-pixi

gamedev pixijs solidjs

Last synced: 6 months ago
JSON representation

Create PIXI applications with JSX and Signals

Awesome Lists containing this project

README

          

![](./packages/docs/src/assets/logo.webp)

Create Pixi.js experiences using JSX and Signals

## Install

```sh
npm install --save solid-pixi solid-js pixi.js
```

If you need to execute code in environments that don't support `new Function`, use `solid-pixi-unsafe` instead.

`npm install --save pixi-unsafe solid-js solid-pixi-unsafe`

## Basic Usage

- [Basic Examples](https://sammccord.github.io/solid-pixi/guides/basic/assets/)
- [Examples Source](./packages/docs/src/components/)

```tsx
import { Texture } from 'pixi.js'
import { createSignal, Suspense } from 'solid-js'
import { render, Application, useAsset, P, useApplication } from 'solid-pixi'

render(() => )

function Click(props) {
return (





)
}

function ClickContainer() {
const app = useApplication()
const [texture] = useAsset('https://pixijs.com/assets/bunny.png')
const [scale, setScale] = createSignal(1)

return (

{
setScale(s => s * 1.25)
}}
scale={{ x: scale(), y: scale() }}
anchor={{ x: 0.5, y: 0.5 } as PointLike}
x={app.screen.width / 2}
y={app.screen.height / 2}
/>

)
}
```

## Contributing

Sure, go ahead and fork.

`solid-pixi` is a `pnpm` monorepo so run `pnpm install` from the root of the workspace.

Source code can be found in `/packages`, with the main published package in `/packages/solid-pixi`

### Developing

`cd packages/docs && npm run dev` will run the example page to quickly iterate on components