playcanvas / playcanvas/engine

SpriteComponents always load their Sprite assets even when disabled and not preloaded?

Open
#2,168 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: assets area: graphics
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

Description

While investigating why I had too many assets loaded I discovered that sprite component (simple and animated) load their associated sprite and textureatlas event when they are disabled and the assets are not preloaded.
This behavior is different from the similar image component that will not load their assets when they are already disabled at launch.

Steps to Reproduce
  1. Open sample project and notice all graphics node are disabled and assets are not preloded.
  2. Launch sample project and notice the scene is empty.
  3. Open console and notice logs about all assets used by sprites components been loaded.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked sample project and reproduce the console asset-loading logs described in the issue. Trace the sprite component asset-loading path and compare it with the disabled image component behavior; done means disabled, non-preloaded sprite components do not load their sprite or texture atlas assets at launch.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.