34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
import os
|
|
from PIL import Image, ImageDraw
|
|
|
|
def create_directory(path):
|
|
if not os.path.exists(path):
|
|
os.makedirs(path)
|
|
|
|
create_directory("assets/items")
|
|
|
|
def create_placeholder(path, color, size=(64, 64), type='circle'):
|
|
img = Image.new('RGBA', size, (0, 0, 0, 0))
|
|
draw = ImageDraw.Draw(img)
|
|
|
|
if type == 'circle':
|
|
draw.ellipse([5, 5, size[0]-5, size[1]-5], fill=color)
|
|
# Add some "fire" details
|
|
draw.ellipse([15, 15, size[0]-15, size[1]-15], fill=(255, 100, 0, 255))
|
|
draw.ellipse([25, 25, size[0]-25, size[1]-25], fill=(255, 255, 0, 255))
|
|
elif type == 'rect':
|
|
draw.rectangle([10, 5, size[0]-10, size[1]-5], fill=color)
|
|
# Pillow
|
|
draw.rectangle([12, 7, size[0]-12, 20], fill=(200, 200, 200, 255))
|
|
|
|
img.save(path)
|
|
print(f"Generated {path}")
|
|
|
|
# Campfire (Orange/Red)
|
|
create_placeholder("assets/items/campfire.png", (139, 69, 19, 255), size=(64, 64), type='circle')
|
|
|
|
# Sleeping Bag (Blue)
|
|
create_placeholder("assets/items/sleeping_bag.png", (0, 0, 150, 255), size=(64, 100), type='rect')
|
|
|
|
print("Camp assets created.")
|