Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: editor updates #149

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ module.exports = {
'@typescript-eslint/no-parameter-properties': 1,
'@typescript-eslint/type-annotation-spacing': 1,
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
'@typescript-eslint/no-non-null-assertion': 0,
},
};
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
# Generated Example and Tutorial Markdowns
/docs/tutorials/*
!/docs/tutorials/index.md
/docs/examples/*
!/docs/examples/index.md
/versioned_docs/version-*/tutorials/*
!/versioned_docs/version-*/tutorials/index.md
/versioned_docs/version-*/examples/*
!/versioned_docs/version-*/examples/index.md

# Misc
Expand Down
18 changes: 11 additions & 7 deletions blog/2024-11-29-pixi-v8.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ tags: [PixiJS, Updates, Improvements]
hide_table_of_contents: true
keywords: ['PixiJS', 'Updates', 'Improvements', 'QoL']
---
import Example from '@site/src/components/Example/index';
import version from '@site/docs/pixi-version.json';
import { EmbeddedEditor } from "@site/src/components/Editor/EmbeddedEditor";
import CacheAsTextureFile from '!!raw-loader!../docs/examples/basic/cache-as-texture';
import PixelLineFile from '!!raw-loader!../docs/examples/graphics/pixel-line';
import ParticleContainerFile from '!!raw-loader!../docs/examples/basic/particle-container';
import InverseMaskFile from '!!raw-loader!../docs/examples/masks/inverse-mask';
import PerspectiveMeshFile from '!!raw-loader!../docs/examples/mesh-and-shaders/perspective-mesh';


Thank you to everyone who participated in our survey! One thing came through loud and clear: **better documentation is a top priority for the PixiJS community**. We’ve taken your feedback to heart, and work is already underway to make significant improvements.
Expand Down Expand Up @@ -55,13 +59,13 @@ We will be bringing out more detailed guides/examples on all of these features a
:::info[Guide]
We have a full guide on this feature [here](/8.x/guides/advanced/cache-as-texture).
:::
<Example id="basic.cacheAsTexture" pixiVersion={version} mode={"embedded"}/>
<EmbeddedEditor files={{"index.js": CacheAsTextureFile}}/>
- **pixelLine**: The `pixelLine` property is a neat feature of the PixiJS Graphics API that allows you to create lines that remain 1 pixel thick, regardless of scaling or zoom level. This feature is especially useful for achieving crisp, pixel-perfect visuals, particularly in retro-style or grid-based games, technical drawing, or UI rendering.

:::info[Guide]
We have a full guide on this feature [here](/8.x/guides/components/graphics-pixel-line).
:::
<Example id="graphics.pixelLine" pixiVersion={version} mode={"embedded"}/>
<EmbeddedEditor files={{"index.js": PixelLineFile}}/>

- **New Global Methods**: We have added three new functions to Container to make it easier to work with global transforms / tints / alphas.

Expand Down Expand Up @@ -99,12 +103,12 @@ We will be bringing out more detailed guides/examples on all of these features a
:::info[Blog]
We have a blog post on this feature [here](/blog/particlecontainer-v8).
:::
<Example id="basic.particleContainer" pixiVersion={version} mode={"embedded"}/>
<EmbeddedEditor files={{"index.js": ParticleContainerFile}}/>


- **Inverse Masking**:
You can now use `element.setMask({ mask, inverse: true })` to create an inverse mask effect. This is great for creating cut-out effects or other creative visuals.
<Example id="masks.inverseMask" pixiVersion={version} mode={"embedded"}/>
<EmbeddedEditor files={{"index.js": InverseMaskFile}}/>

### v8.4.0
- **Multiview**: Support for renderering the same context to multiple canvases. Eliminating the need for multiple PixiJS instances and duplicating resources.
Expand All @@ -116,7 +120,7 @@ We will be bringing out more detailed guides/examples on all of these features a

### v8.3.0
- **PerspectiveMesh**: A new mesh type that allows you to create 3D perspective effect
<Example id="meshAndShaders.perspectiveMesh" pixiVersion={version} mode={"embedded"}/>
<EmbeddedEditor files={{"index.js": PerspectiveMeshFile}}/>

### v8.2.0
- **Container Reparenting**: You can now reparent a container to another container without it looking visually different with two new methods `reparentChild(child)` and `reparentChildAt(child, 1)`.
Expand Down
2 changes: 2 additions & 0 deletions docs/examples/advanced/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: Advanced
position: 2
11 changes: 11 additions & 0 deletions docs/examples/advanced/collision-detection.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 5
custom_edit_url: null
title: Collision Detection
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./collision-detection';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/advanced/mouse-trail.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 3
custom_edit_url: null
title: Mouse Trail
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./mouse-trail';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/advanced/scratch-card.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 1
custom_edit_url: null
title: Scratch Card
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./scratch-card';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/advanced/screen-shot.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 4
custom_edit_url: null
title: Screen Shot
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./screen-shot';

<ExampleEditor files={{"index.js": IndexFile}} />
File renamed without changes.
11 changes: 11 additions & 0 deletions docs/examples/advanced/slots.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 0
custom_edit_url: null
title: Slots
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./slots';

<ExampleEditor files={{"index.js": IndexFile}} />
26 changes: 26 additions & 0 deletions docs/examples/advanced/spinners.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 6
custom_edit_url: null
title: Spinners
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./spinners/index';
import SpinnerGenerator1 from '!!raw-loader!./spinners/spinner1';
import SpinnerGenerator2 from '!!raw-loader!./spinners/spinner2';
import SpinnerGenerator3 from '!!raw-loader!./spinners/spinner3';
import SpinnerGenerator4 from '!!raw-loader!./spinners/spinner4';
import SpinnerGenerator5 from '!!raw-loader!./spinners/spinner5';
import SpinnersIntersect from '!!raw-loader!./spinners/intersect';

<ExampleEditor files={{
"index.js": IndexFile,
'./spinner1.js': SpinnerGenerator1,
'./spinner2.js': SpinnerGenerator2,
'./spinner3.js': SpinnerGenerator3,
'./spinner4.js': SpinnerGenerator4,
'./spinner5.js': SpinnerGenerator5,
'./intersect.js': SpinnersIntersect,
}} />

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import { Application, Assets, Container, Graphics, Point, Sprite } from 'pixi.js

mask.position.set(size / 2, size / 2);
base.mask = mask;
window.mask = mask;

container.addChild(bottom);
container.addChild(base);
Expand Down Expand Up @@ -181,7 +180,6 @@ import { Application, Assets, Container, Graphics, Point, Sprite } from 'pixi.js

mask.position.set(size / 2, size / 2);
base.mask = mask;
window.mask = mask;

container.addChild(base);
container.addChild(mask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export function generateSpinner1(app, position)

mask.position.set(size / 2, size / 2);
base.mask = mask;
window.mask = mask;

container.addChild(bottom);
container.addChild(base);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Container, Sprite } = require('pixi.js');
import { Container, Sprite } from 'pixi.js';

/* -----------------------
Spinner 2. Scaling balls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function generateSpinner3(app, position)

mask.position.set(size / 2, size / 2);
base.mask = mask;
window.mask = mask;

container.addChild(base);
container.addChild(mask);
Expand Down
11 changes: 11 additions & 0 deletions docs/examples/advanced/star-warp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 2
custom_edit_url: null
title: Star Warp
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./star-warp';

<ExampleEditor files={{"index.js": IndexFile}} />
2 changes: 2 additions & 0 deletions docs/examples/assets/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: Assets
position: 12
File renamed without changes.
11 changes: 11 additions & 0 deletions docs/examples/assets/async.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 1
custom_edit_url: null
title: Async
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./async';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/assets/background.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 3
custom_edit_url: null
title: Background
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./background';

<ExampleEditor files={{"index.js": IndexFile}} />
File renamed without changes.
11 changes: 11 additions & 0 deletions docs/examples/assets/bundle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 4
custom_edit_url: null
title: Bundle
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./bundle';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/assets/multiple.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 2
custom_edit_url: null
title: Multiple
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./multiple';

<ExampleEditor files={{"index.js": IndexFile}} />
File renamed without changes.
11 changes: 11 additions & 0 deletions docs/examples/assets/promise.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 0
custom_edit_url: null
title: Promise
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./promise';

<ExampleEditor files={{"index.js": IndexFile}} />
2 changes: 2 additions & 0 deletions docs/examples/basic/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: Basic
position: 1
11 changes: 11 additions & 0 deletions docs/examples/basic/blend-modes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 4
custom_edit_url: null
title: Blend Modes
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./blend-modes';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/basic/cache-as-texture.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 7
custom_edit_url: null
title: Cache As Texture
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./cache-as-texture';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/basic/container.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 0
custom_edit_url: null
title: Container
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./container';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/basic/mesh-plane.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 5
custom_edit_url: null
title: Mesh Plane
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./mesh-plane';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/basic/particle-container.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 3
custom_edit_url: null
title: Particle Container
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./particle-container';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/basic/render-group.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 6
custom_edit_url: null
title: Render Group
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./render-group';

<ExampleEditor files={{"index.js": IndexFile}} />
File renamed without changes.
11 changes: 11 additions & 0 deletions docs/examples/basic/tinting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 2
custom_edit_url: null
title: Tinting
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./tinting';

<ExampleEditor files={{"index.js": IndexFile}} />
11 changes: 11 additions & 0 deletions docs/examples/basic/transparent-background.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 1
custom_edit_url: null
title: Transparent Background
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./transparent-background';

<ExampleEditor files={{"index.js": IndexFile}} />
2 changes: 2 additions & 0 deletions docs/examples/events/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: Events
position: 6
File renamed without changes.
11 changes: 11 additions & 0 deletions docs/examples/events/click.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
hide_edit_this_page: true
sidebar_position: 0
custom_edit_url: null
title: Click
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./click';

<ExampleEditor files={{"index.js": IndexFile}} />
Loading
Loading