Skip to content

Document Sprite.filename specifics - #172

Open
Arecher wants to merge 3 commits into
aseprite:mainfrom
Arecher:document-sprite-filename-specifics
Open

Document Sprite.filename specifics#172
Arecher wants to merge 3 commits into
aseprite:mainfrom
Arecher:document-sprite-filename-specifics

Conversation

@Arecher

@Arecher Arecher commented Aug 27, 2026

Copy link
Copy Markdown
Contributor
  • Added examples and explanation for the three different strings that sprite.filename can return (filepath, name only and "")
  • Added link to app.fs.fileTitle to show how to get the name of the Sprite
    Since filename sounds like it would return this, rather than the filepath
  • Added note that switching filenames for opened sprite only changes where the file is saved on subsequent save actions, and does not switch to the file at the new path.
    I wasn't fully sure what to expect from setting a filename during runtime, and since it originally mostly mentioned it was where the file was loaded from, I wondered whether it would switch the data in the sprite if you adjusted the filename to a preexisting sprite

- Added examples and explanation for the three different strings that sprite.filename can return (filepath, name only and "")
- Added link to app.fs.fileTitle to show how to get the name of the Sprite
- Added note that switching filenames for opened sprite only changes where the file is saved on subsequent save actions, and does not switch to the file at the new path.
- Reference to `filenamechange` event for `Sprite.events`
@Arecher
Arecher force-pushed the document-sprite-filename-specifics branch from c599f98 to c1e5279 Compare August 27, 2026 11:19
@dacap

dacap commented Aug 27, 2026

Copy link
Copy Markdown
Member

Sorry @Arecher, I've just pushed some old commits to the Sprite.filenames just today, so this PR is giving some conflicts, but probably you can just replace the latest content with your reword.

@Arecher

Arecher commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Done! I'll make some changes though, because like your change mentioned, even sprites that don't have any files associated with them return their name (which seems to just be Sprite).

@Arecher

Arecher commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

I couldn't squash/amend the commits because one of them is a merge. Wasn't aware of that, so it's a bit of a mess of small commits now.

But the end result should be a properly merged file. I also removed my sentence that stated that Sprite(width, height).filename would return "", since that's incorrect, and added a reference to the newly added hasAssociatedFile().

- Removed incorrect description of `Sprite(width,height).filename` returning `""`.
- Linked to `hasAssociatedFile()` in explanation
@Arecher
Arecher force-pushed the document-sprite-filename-specifics branch from 6cd1541 to ad09001 Compare August 27, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants