Created
August 18, 2024 15:46
-
-
Save nightm4re94/466266d7ceb359b410770c7b50255f02 to your computer and use it in GitHub Desktop.
LITIENGINE sprite info generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This PowerShell script will help you generate sprite info files for LITIENGINE. | |
# Define the path to the folder containing the images | |
$folderPath = "." | |
# Define the path to the output text file | |
$outputFilePath = "sprites.info" | |
Get-ChildItem -Recurse $folderPath -Include "*.jpg","*.png","*.bmp" | % { | |
$image = [System.Drawing.Image]::FromFile($_.FullName) | |
[PSCustomObject]@{ | |
name = $_.name | |
width = $image.Width | |
height = $image.Height | |
} | |
} | ConvertTo-Csv -NoTypeInformation | ForEach-Object { | |
$_ -replace '"', '' | |
} | Set-Content $outputFilePath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment