Skip to content

Commit

Permalink
Play with heading alignment in startanim
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios committed Nov 23, 2024
1 parent e5c261e commit 8a68360
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
File renamed without changes.
Binary file modified pkg/credits/startanim-pt-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions pkg/generate-credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def replace_tabbed_lines(placeholder, lines, tabs):
content = content.replace('{{0}}', '<br/>' * total_num)

# {{1}}: '<br/>' * (# of programmers)
content = content.replace('{{1}}', '<br/>' * num_dict['Programming'])
content = content.replace('{{1}}', '<br/>' * num_dict['Code'])

# {{2}}: '<br/>' * (# of artists)
content = content.replace('{{2}}', '<br/>' * num_dict['Graphics'])
Expand All @@ -66,7 +66,7 @@ def replace_tabbed_lines(placeholder, lines, tabs):
list_break = ' <br/>\n'

# {{5}}: Programmer name lines
name_lines = list_break.join(name_dict["Programming"]) + list_break
name_lines = list_break.join(name_dict["Code"]) + list_break
content = replace_tabbed_lines('{{5}}', name_lines, 8)

# {{6}}: Artist name lines
Expand All @@ -86,12 +86,13 @@ def replace_tabbed_lines(placeholder, lines, tabs):

# Generate startanim.png using ImageMagick

image_lines_col1 = []
image_lines_col2 = []
# These allow whitespace to come at the start of the real content, and will be cropped out.
image_lines_col1 = ["-"]
image_lines_col2 = ["-"]

# Note: blank lines need to have a space in them for some reason
def add_heading(heading):
image_lines_col1.append(f'- {heading.upper()} -')
image_lines_col1.append(f' - {heading.upper()} -')
image_lines_col1.append(' ')
image_lines_col2.extend([' ', ' '])

Expand Down Expand Up @@ -120,7 +121,7 @@ def add_heading(heading):
image_lines_col1.append(' ')
image_lines_col2.append(' ')

add_heading('Programming')
add_heading('Code')
add_heading('Graphics')
add_heading('Testing')
add_heading('Funding')
Expand Down
5 changes: 5 additions & 0 deletions pkg/generate-startanim.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash

font_size=8
spacing=5
actual_line_size=$((font_size + spacing))

magick convert +append pkg/credits/startanim-col-*.png pkg/credits/startanim-pt-2.png
magick convert pkg/credits/startanim-pt-2.png -chop 0x$actual_line_size -gravity North pkg/credits/startanim-pt-2.png
magick convert -append pkg/credits/startanim-pt-*.png rsrc/graphics/startanim.png
# Clean up:
rm pkg/credits/startanim-col-*.png
Expand Down
Binary file modified rsrc/graphics/startanim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8a68360

Please sign in to comment.