Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

How to import .png file to game?

There are a lot of potential nuances to what you are asking and without elaboration on your part I will have to do so.

Importing an image is different than loading an image when working with Godot, Strive's game engine. Images are imported only by the Godot Editor and stored as multiple files; the critical ones being the text file(.import) that tells how to load the image and the slightly altered image file(.stex). Unless you are adding the image to a scene file(.tscn or .scn), loading images during the initialization of the game, or wish to obfuscate it from other users, there is no need for importing as Strive has a "loadimage" function in globals.gd that will load any valid image file.

The process of importing is fairly simple. Place the image in the Strive program folder in the exact location(relative to the program's root folder) where you plan to use it from. Start the Godot Editor and scan the Strive program folder to find the project file. Load the program folder as your project and the editor should automatically import the image.

Including the imported image in a mod is as simple as including all the files for the imported image except the image file itself (unless you want to, but it will double the size) in the "patch" folder of the mod. Use the same folder structure in the "patch" folder as program folder to get the files to the right locations.