Write PIXI apps using React declarative style
MIT License
Bot releases are hidden (Show)
Published by inlet almost 4 years ago
Update modules to latest (incl. React v17.0.1
)
Published by inlet about 4 years ago
As you might have noticed, React 17 just landed with quite some improvements. Hooray, this means that I had to implement new methods to the reconciler as well. I'm happy to inform you that ReactPixi is now fully compatible with React 17.
NOTE: This release is not compatible with React 16.x or older. If you need to stick to React 16.x make sure to use ReactPixi v5.x.
Published by inlet about 4 years ago
Support for pixi legacy without having to create aliases in your project π
npm install pixi.js-legacy
import { Stage } from '@inlet/react-pixi/legacy';
<Stage options={{ forceCanvas: true }}>... </Canvas>
Published by inlet about 4 years ago
Now the devtools will be injected once, this prevents warning errors or duplicate injections.
Published by inlet about 4 years ago
Make prop { options: { resizeTo } }
for <Stage>
optional.
Published by inlet about 4 years ago
Typings for animated components
Published by inlet about 4 years ago
π Use React-Pixi with React Spring is now available through import @inlet/react-pixi/animated
,
see https://reactpixi.org/react-spring
Compatible with
react-spring@next
(v9+). Note that older versions of react-spring don't work as they have a different API.
fbjs
dependencyidx
dependencyanimated
animated
.React-Pixi:
https://unpkg.com/@inlet/[email protected]/dist/react-pixi.umd.js
React-Pixi with React-Spring support:
https://unpkg.com/@inlet/[email protected]/animated/react-pixi.umd.js
Published by inlet about 4 years ago
Instead of resetting the interaction manager, simply update the resolution
of the interaction manager. Libraries like pixi-viewport
depends on the interaction manager, this patch will fix any related issues.
Published by inlet about 4 years ago
Ref's in custom components (PixiComponent
):
import { Graphics } from 'pixi.js';
interface RectangleProps {
x: number;
y: number;
color: number;
}
const Rectangle = PixiComponent<RectangleProps, Graphics>('Rectangle', {
create: () => new Graphics(),
applyProps: (ins, _, props) => {
ins.x = props.x;
ins.y = props.y;
ins.beginFill(props.color);
ins.drawRect(0, 0, 100, 100);
ins.endFill();
},
});
const App = () => (
<Rectangle
ref={rect => console.assert(rect instanceof Graphics)}
x={100}
y={100}
color={0xff0000}
/>
);
Published by inlet about 4 years ago
AutoDensity is now set to PIXI.Application
allowing app.renderer.resize
to set width, height and css styles correctly.
Published by inlet over 4 years ago
Change the applyDefaultProps
behaviour, fixes #235
Prop is not undefined?
Set direct PIXI value
Prop has a default value?
Set value to default
Else?
Show a warn log
Published by inlet over 4 years ago
New major release π
Now compatible with PIXI v5.3+.
Published by inlet over 4 years ago
Supports multiple renderer contexts
Published by inlet over 4 years ago
Published by inlet over 4 years ago
options.resolution
changePublished by inlet over 4 years ago
Support for updating the PIXI stage on React component change π
Published by inlet over 4 years ago
PointLike
supporting { x: number, y: number }
Graphics draw
prop.
Breaking change
The draw
prop now accepts a function to redraw that is part of the
React eco-system, see https://reactpixi.org/components/graphics#usage
Graphics preventDefault
prop.
Breaking change
Published by inlet over 4 years ago
v2.0.0
πreact-reconciler
docz
and internalsPublished by inlet over 4 years ago
The type definition wrapping Container
works better.
Published by inlet over 4 years ago
Types for Graphics
, and all Components have children
props now