You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it gives me an error. because the texture is not passed
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'defaultAnchor')
at _Sprite (/home/blackram/game-template/node_modules/pixi.js/src/scene/sprite/Sprite.ts:119:26)
at <anonymous> (/home/blackram/game-template/src/values/locations.tsx:13:1)
Expected Behavior
that a blank texture is added by default. or force you to add a texture
Steps to Reproduce
newSprite({x: 100,y: 100,});
Environment
pixi.js version: 8.1.1
Browser & Version: Chrome
OS & Version: Windows
Possible Solution
constDEFAULT_OPTIONS={// ...}classSprite{constructor(_options={}){constoptions=Object.assign({},_options,DEFAULT_OPTIONS);// do stuff with the options, like set the sprite's coordinates}}
Additional Information
No response
The text was updated successfully, but these errors were encountered:
BlackRam-oss
changed the title
Bug:
Bug: new Sprite gives me an error because the texture is not passed
May 12, 2024
Thanks, this definitely is not intended. We should support undefined texture in the constructor. Suggestion is setting a default in the options destructure or reordering the default anchor line to be after the texture set.
Current Behavior
it gives me an error. because the texture is not passed
Expected Behavior
that a blank texture is added by default. or force you to add a texture
Steps to Reproduce
Environment
pixi.js
version: 8.1.1Possible Solution
Additional Information
No response
The text was updated successfully, but these errors were encountered: