def writeCreditsFontToProject(self, resourceOpener): arr = EbArrangement(16, 12) for i in range(192): arr[i%16, i/16] = (False, False, False, self._CREDITS_PREVIEW_SUBPALS[i], i) img = arr.toImage(self._cfont, self._cpal) with resourceOpener("Fonts/credits", "png") as imgFile: img.save(imgFile, "png") imgFile.close()
def writeToProject(self, resourceOpener): arr1 = EbArrangement(16, 26) for i in range(416): arr1[i%16,i/16] = (False, False, False, self._PREVIEW_SUBPALS[i], i) i = 0 for pal in self._flavPals: with resourceOpener("WindowGraphics/Windows1_" + str(i), "png") as imgFile: img1 = arr1.toImage(self._gfx1, pal) img1.save(imgFile, "png") with resourceOpener("WindowGraphics/Windows2_" + str(i), "png") as imgFile: img2 = self._gfx2.dumpToImage(pal.getSubpal(7), width=7) img2.save(imgFile, "png") i += 1 updateProgress(40) # Write names with resourceOpener("WindowGraphics/flavor_names", "txt") as f: for ptr, field in self._flavNames: print >>f, field.dump() updateProgress(10)