Added object management
BIN
OBJ00.png
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.1 KiB |
BIN
OBJ01.png
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2 KiB |
BIN
OBJ02.png
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
OBJ03.png
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
OBJ04.png
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
OBJ05.png
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.3 KiB |
BIN
OBJ06.png
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
OBJ07.png
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.3 KiB |
BIN
OBJ08.png
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.3 KiB |
BIN
OBJ09.png
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.1 KiB |
6
obj.csv
|
@ -1,3 +1,3 @@
|
|||
A11.png,248,185
|
||||
B13.png,256,159
|
||||
B14.png,284,148
|
||||
A11.png,248,185,OBJ00.png,OBJ01.png,OBJ02.png,OBJ03.png,OBJ04.png,OBJ05.png,OBJ06.png,OBJ07.png,OBJ08.png,OBJ09.png,
|
||||
B13.png,256,159,OBJ00.png,OBJ01.png,OBJ02.png,OBJ03.png,OBJ04.png,OBJ05.png,OBJ06.png,OBJ07.png,OBJ08.png,OBJ09.png,
|
||||
B14.png,284,148,OBJ00.png,OBJ01.png,OBJ02.png,OBJ03.png,OBJ04.png,OBJ05.png,OBJ06.png,OBJ07.png,OBJ08.png,OBJ09.png,
|
||||
|
|
|
20
randstrip.py
|
@ -50,15 +50,19 @@ def fetchVign():
|
|||
nvign +=1
|
||||
return story
|
||||
|
||||
def addThing(vign):
|
||||
#TODO
|
||||
pass
|
||||
def addThing(indVign):
|
||||
with open("obj.csv") as obj:
|
||||
csvReader = csv.reader(obj)
|
||||
for row in csvReader:
|
||||
if row[0] == indVign:
|
||||
return row[random.randint(3,len(row)-1)],row[1],row[2]
|
||||
return 0
|
||||
|
||||
def writeStrip(story):
|
||||
strip = []
|
||||
for indVign in story:
|
||||
if indVign!="000":
|
||||
vign = Image.open(indVign)
|
||||
vign = Image.open(indVign).convert('RGBA')
|
||||
addtext = ImageDraw.Draw(vign)
|
||||
fnt = ImageFont.truetype("ubuntu.ttf",16)
|
||||
if indVign[0] == 'A':
|
||||
|
@ -71,11 +75,11 @@ def writeStrip(story):
|
|||
addtext.multiline_text((int(textVign[0]),int(textVign[1])),textVign[4],fill="#000000",font=fnt,align="center")
|
||||
addtext.multiline_text((int(textVign[2]),int(textVign[3])),textVign[5],fill="#000000",font=fnt,align="center")
|
||||
obj = addThing(indVign)
|
||||
if obj!=(0,0):
|
||||
#TODO
|
||||
pass
|
||||
if obj!=0:
|
||||
objImg = Image.open(obj[0])
|
||||
vign.paste(objImg,(int(obj[1]),int(obj[2])))
|
||||
strip.append(vign)
|
||||
image = Image.new('RGB',(2400,500))
|
||||
image = Image.new('RGBA',(2400,500))
|
||||
xshift=0
|
||||
for vign in strip:
|
||||
image.paste(vign,(xshift,0))
|
||||
|
|