-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripting API: New image format? #2695
Comments
What image format are you looking to support? Qt only supports adding custom image formats through C++ plugins and I don't think it even supports even a C++ API to register custom formats. If this is about adding support for a common image format then maybe we could ship another image format plugin. Alternatively, we could of course route all image loading through a custom function that also takes registered formats from JavaScript into account. Why the custom |
I'm trying to use a generated image as a tileset image. That generated image has two input files. So the normal "watch the file" approach that's built in wouldn't work. Currently I have to remember to update it whenever either file changes, and I have to perform the generation in a particular order. It's error prone. |
As for the image format, in this case I'm just going to make a temporary png file and load that, after running the generator (if needed). So QT doesn't have to bend over backwards for the format, I just need to be able to intercept reads and override the auto-checking behavior. The exact process in my case is that I'm taking a |
In the more general case, could we allow a script to generate BMP-formatted image data and then "trick" qt into thinking that it's a bmp file? |
I think the best way to support this case would be to expose the
We can definitely also expose a script function to turn a byte array into an image with any supported format. Essentially exposing |
@bjorn exposing |
Now a script can create an image, either directly or by loading from a file or data or based on raw data. Then, the image can be passed to Tileset.loadFromImage or Tile.setImage. Related to issue #2695
Hi, sorry for not getting back to you sooner about this feature, but I had trouble building Tiled and then got busy with other things. The above branch (which I synced with I only came across two minor problems:
|
Now a script can create an image, either directly or by loading from a file or data or based on raw data. Then, the image can be passed to Tileset.loadFromImage or Tile.setImage. Related to issue #2695
Now a script can create an image, either directly or by loading from a file or data or based on raw data. Then, the image can be passed to Tileset.loadFromImage, Tile.setImage or ImageLayer.loadFromImage. Related to issue #2695
Hey, I'm trying to use the new scripting API to allow tiled to read a new image format for tilesets. However, the API only allows registering handlers for Tileset files and TileMap files.
I'd like to suggest this as a workable API:
The text was updated successfully, but these errors were encountered: