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
{{ message }}
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
Hello ! i cloned your repo , thanks , it is rather good starter. But i have some problem, how can i load sprite sheets.
i uploaded json atlas in Load.js file
Load.js--
dng.json // json of sprites
dng.png
Code:
import LOGO from './[email protected]';
import ScaledContainer from '../ScaledContainer/ScaledContainer';
import dngJSON from './dng.json'
export default class Logo extends ScaledContainer {
constructor() {
super();
this.loader = new Loader()
this.loader.add('dng',dngJSON)
this.loader.load(()=>{
console.log("ok")
const texture = Texture.from('blob_1.png');
// const sprite = new Sprite(texture);
// this.addChild(sprite);
})
// sprite.anchor.x = 0.5;
// sprite.anchor.y = 0.5;
// sprite.position.set(1920 / 2, 1080 / 2);
}
} ```
but this code shows error
uncaught promise error // when i wrote ``` const texture = Texture.from('blob_1.png'); ````
So how can load sprite sheets with json atlas ?
The text was updated successfully, but these errors were encountered:
On Tue, Dec 28, 2021 at 6:28 AM Nuruddin999 ***@***.***> wrote:
Hello ! i cloned your repo , thanks , it is rather good starter. But i
have some problem, how can i load sprite sheets.
i uploaded json atlas in Load.js file
Load.js--
dng.json // json of sprites
dng.png
Code:
import LOGO from ***@***.***';
import ScaledContainer from '../ScaledContainer/ScaledContainer';
import dngJSON from './dng.json'
export default class Logo extends ScaledContainer {
constructor() {
super();
this.loader = new Loader()
this.loader.add('dng',dngJSON)
this.loader.load(()=>{
console.log("ok")
const texture = Texture.from('blob_1.png');
// const sprite = new Sprite(texture);
// this.addChild(sprite);
})
// sprite.anchor.x = 0.5;
// sprite.anchor.y = 0.5;
// sprite.position.set(1920 / 2, 1080 / 2);
}
} ```
but this code shows error
uncaught promise error // when i wrote ``` const texture = Texture.from('blob_1.png'); ````
So how can load sprite sheets with json atlas ?
—
Reply to this email directly, view it on GitHub
<#38>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGCZUFENPCTYA4VUPU3YJLUTHCSTANCNFSM5K4HWZEQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello ! i cloned your repo , thanks , it is rather good starter. But i have some problem, how can i load sprite sheets.
i uploaded json atlas in Load.js file
Load.js--
dng.json // json of sprites
dng.png
Code:
The text was updated successfully, but these errors were encountered: