Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/sprite

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/sprite

Base object for textured objects rendered to the screen

  • 5.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
59K
decreased by-46.13%
Maintainers
3
Weekly downloads
 
Created

What is @pixi/sprite?

@pixi/sprite is a module in the PixiJS library that provides functionality for creating and manipulating sprites. Sprites are essential for rendering images and animations in 2D games and applications. This package allows you to create, position, scale, rotate, and animate sprites easily.

What are @pixi/sprite's main functionalities?

Creating a Sprite

This feature allows you to create a sprite from an image path. The sprite can then be added to the stage for rendering.

const sprite = PIXI.Sprite.from('path/to/image.png');

Positioning a Sprite

This feature allows you to set the position of the sprite on the stage. The x and y properties determine the sprite's coordinates.

sprite.x = 100; sprite.y = 150;

Scaling a Sprite

This feature allows you to scale the sprite. The scale property can be set to enlarge or shrink the sprite.

sprite.scale.set(2, 2);

Rotating a Sprite

This feature allows you to rotate the sprite. The rotation property is set in radians.

sprite.rotation = Math.PI / 4;

Animating a Sprite

This feature allows you to animate the sprite. The ticker adds a function that updates the sprite's rotation on each frame.

app.ticker.add((delta) => { sprite.rotation += 0.01 * delta; });

Other packages similar to @pixi/sprite

FAQs

Package last updated on 19 Jul 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc