Skip to content

Instantly share code, notes, and snippets.

@nightm4re94
Created August 18, 2024 15:46
Show Gist options
  • Save nightm4re94/466266d7ceb359b410770c7b50255f02 to your computer and use it in GitHub Desktop.
Save nightm4re94/466266d7ceb359b410770c7b50255f02 to your computer and use it in GitHub Desktop.
LITIENGINE sprite info generator
# 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