0 votes

I'd like to bake something like a preview of the tiles of the meshlibs, but with a bigger size (the previews from getitempreview are 64x64). Do you guys know if this is possible?

in Engine by (51 points)

(the previews from get_item_preview() are 64x64)

Note that the built-in previews are only available when running the project from the editor, not in an exported project. This is because they are only generated by the editor.

Therefore, you must generate your own previews to use them in an exported project.

1 Answer

+2 votes

You could do this with a Viewport. Give it the size you want. Put one tile under it, with a camera to choose a proper view angle and distance. Wait one frame for the viewport to render its contents (using the Update Once mode), and take a screenshot of the result (Image obtainable with get_texture().get_data()). Then swap the tile to another and repeat the cycle if needed, for every tile.

by (29,088 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.