Scripting: add displayImage property to Tile to get pre-cropped image #3960
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I saw #3918 is marking these as
@since 1.11
, so I did the same here, but I could change it.The idea here was to provide a pre-cropped image (since
Tile.image
returns the full image) so that you could display it on a dialog. It came up when I was asking if a new type of widget that lets you select & preview a tile (a TileButton like a color picker button) might be useful.Let me know what you think
Example script:
https://gist.github.com/dogboydog/363a4fec2e7b1c408e9ecc4b93234bde
Example images
![image](https://private-user-images.githubusercontent.com/9920963/337055579-f9e46196-8df4-4702-919d-ee15d75d2890.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MTAxNjMsIm5iZiI6MTcxOTcwOTg2MywicGF0aCI6Ii85OTIwOTYzLzMzNzA1NTU3OS1mOWU0NjE5Ni04ZGY0LTQ3MDItOTE5ZC1lZTE1ZDc1ZDI4OTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MzBUMDExMTAzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduY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