Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@pixi/app
Advanced tools
@pixi/app is a part of the PixiJS library, which is a fast, lightweight 2D rendering engine for creating interactive graphics and animations in the browser. The @pixi/app package specifically provides the core functionality to create and manage the main application instance, including the renderer, ticker, and stage.
Creating an Application
This feature allows you to create a new PixiJS application with specified width and height. The application instance includes a renderer, ticker, and stage, and appends the canvas element to the document body.
const app = new PIXI.Application({ width: 800, height: 600 }); document.body.appendChild(app.view);
Adding Sprites
This feature allows you to add sprites to the stage. You can create a sprite from an image path and add it to the application's stage for rendering.
const sprite = PIXI.Sprite.from('path/to/image.png'); app.stage.addChild(sprite);
Handling Animation
This feature allows you to handle animations using the application's ticker. You can add a function to the ticker that updates the properties of objects on each frame, such as rotating a sprite.
app.ticker.add((delta) => { sprite.rotation += 0.01 * delta; });
Three.js is a popular 3D library that provides a wide range of features for creating 3D graphics in the browser. While @pixi/app focuses on 2D rendering, Three.js offers extensive support for 3D scenes, including complex geometries, materials, and lighting.
Phaser is a fast, robust, and mature 2D game framework for making HTML5 games. It provides a comprehensive suite of features for game development, including physics, input handling, and asset management. Compared to @pixi/app, Phaser is more focused on game development with built-in support for various game mechanics.
Babylon.js is a powerful, beautiful, and simple open-source 3D engine. It provides a complete set of tools for creating 3D experiences in the browser. While @pixi/app is focused on 2D rendering, Babylon.js offers extensive capabilities for 3D graphics, including physics, animations, and advanced rendering techniques.
npm install @pixi/app
import { Application } from '@pixi/app';
const app = new Application();
document.body.appendChild(app.view);
PixiJS provides a few plugins to add features to the Application. These can be installed from the following packages. Use Application.registerPlugin
to use these plugins. Note: if you are using pixi.js or pixi.js-legacy bundles, this is unnecessary since plugins are installed automatically by default.
@pixi/loaders
@pixi/ticker
FAQs
Convenience class to create a new PixiJS application
The npm package @pixi/app receives a total of 126,397 weekly downloads. As such, @pixi/app popularity was classified as popular.
We found that @pixi/app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.