davidfig / pixi-viewport

A highly configurable viewport/2D camera designed to work with pixi.js
https://davidfig.github.io/pixi-viewport/
MIT License
1.06k stars 177 forks source link

✨✨✨ V5 ✨✨✨ #428

Closed cuire closed 1 year ago

cuire commented 1 year ago

Closes #426, #408 , #352, #378, #425.

Finally ready to merge PR.

That PR includes everything from #421. And adds more:

Installable via git now

While PR is no merged, you can use these to continue working on projects.

npm

npm i cuire/pixi-viewport#v5

yarn v2+ berry

yarn classic doesnt have life cycle scripts (or I dont found them 😵‍💫). So for now it only yarn 2. https://github.com/yarnpkg/yarn/pull/6131

yarn add pixi-viewport@cuire/pixi-viewport#v5

pnpm

pnpm add cuire/pixi-viewport#v5
olegarino commented 1 year ago

This is really appreciated thank you sir. @davidfig Would you be able to merge this ?

voidrender commented 1 year ago

While PR is no merged, you can use these to continue working on projects.

Installing via your fork doesn't work out of the box because the pixi-viewport code from your fork doesn't include the vite build output in the new dist directory referenced by the package.json changes (and it shouldn't).

ERROR: [plugin: vite:dep-scan] Failed to resolve entry for package "pixi-viewport". The package may have incorrect main/module/exports specified in its package.json.
Failed to resolve entry for package "pixi-viewport". The package may have incorrect main/module/exports specified in its package.json.

I was unable to build it manually inside of my app's node_modules.

Is there a good way to test this from your fork?

EDIT: Ah, it's because I'm using yarn 1.22.19, it builds with npm 8

TimWillebrands commented 1 year ago

I'm not sure if this PR is the cause, but when using this branch we're running into this issue with dragging: https://github.com/davidfig/pixi-viewport/issues/422#issuecomment-1429535913

Disorrder commented 1 year ago

can't use this version because of events:

import { EventSystem } from "@pixi/events";

  const viewport = new Viewport({
    ticker: app.ticker,
    events: new EventSystem(app.renderer),
  });
image
davidfig commented 1 year ago

Thanks @cuire! Published as v5 on npm.