Skip to content

Commit

Permalink
add gif example
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Jan 23, 2025
1 parent 1c3567c commit a956f20
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 15 deletions.
19 changes: 19 additions & 0 deletions docs/examples/sprite/gif.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Application, Assets } from 'pixi.js';
import { GifSprite } from 'pixi.js/gif';

(async () =>
{
// Create a new application
const app = new Application();

// Initialize the application
await app.init({ background: '#1099bb', resizeTo: window });

// Append the application canvas to the document body
document.body.appendChild(app.canvas);

const source = await Assets.load('https://userland.pixijs.io/gif/examples/chew.gif');
const gif = new GifSprite({ source, x: window.innerWidth / 2, y: window.innerHeight / 2, anchor: 0.5 });

app.stage.addChild(gif);
})();
11 changes: 11 additions & 0 deletions docs/examples/sprite/gif.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: Gif
---
import { ExampleEditor } from "@site/src/components/Editor/ExampleEditor";
import IndexFile from '!!raw-loader!./gif';

<ExampleEditor files={{"index.js": IndexFile}} />
10 changes: 5 additions & 5 deletions docs/pixi-version.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"versionLabel": "v8.x",
"version": "8.6.6",
"releaseNotes": "https://github.com/pixijs/pixijs/releases/tag/v8.6.6",
"build": "https://pixijs.download/v8.6.6/pixi.min.js",
"docs": "https://pixijs.download/v8.6.6/docs/index.html",
"npm": "8.6.6",
"version": "8.7.1",
"releaseNotes": "https://github.com/pixijs/pixijs/releases/tag/v8.7.1",
"build": "https://pixijs.download/v8.7.1/pixi.min.js",
"docs": "https://pixijs.download/v8.7.1/docs/index.html",
"npm": "8.7.1",
"prerelease": false,
"latest": true
}
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"classnames": "^2.5.1",
"clsx": "^2.1.1",
"docusaurus-plugin-sass": "^0.2.6",
"pixi.js": "^8.6.6",
"pixi.js": "^8.7.0",
"prism-react-renderer": "^2.4.1",
"ramda": "^0.30.1",
"raw-loader": "^4.0.2",
Expand Down
10 changes: 5 additions & 5 deletions pixi-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},
{
"versionLabel": "v8.x",
"version": "8.6.6",
"releaseNotes": "https://github.com/pixijs/pixijs/releases/tag/v8.6.6",
"build": "https://pixijs.download/v8.6.6/pixi.min.js",
"docs": "https://pixijs.download/v8.6.6/docs/index.html",
"npm": "8.6.6",
"version": "8.7.1",
"releaseNotes": "https://github.com/pixijs/pixijs/releases/tag/v8.7.1",
"build": "https://pixijs.download/v8.7.1/pixi.min.js",
"docs": "https://pixijs.download/v8.7.1/docs/index.html",
"npm": "8.7.1",
"prerelease": false,
"latest": true,
"isCurrent": true
Expand Down
Binary file added static/assets/chew.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a956f20

Please sign in to comment.