This commit is contained in:
@@ -11,4 +11,9 @@ local file used to track next stuff to do
|
|||||||
- Fix larger names
|
- Fix larger names
|
||||||
- Fix 20
|
- Fix 20
|
||||||
- Fix 19
|
- Fix 19
|
||||||
- Texte du Con Artist avec la bonne couleur; Pareil pour Kikuri
|
- Texte du Con Artist avec la bonne couleur; Pareil pour Kikuri
|
||||||
|
|
||||||
|
|
||||||
|
## Idées
|
||||||
|
|
||||||
|
- 69: demonic cloud -> darkness CSM
|
||||||
+56
-9
@@ -583,15 +583,62 @@ def create_effects(card: Card, effects: list[Effect], height: int, width: int):
|
|||||||
effect_types = list(grouped_effects.keys())
|
effect_types = list(grouped_effects.keys())
|
||||||
|
|
||||||
if len(grouped_effects) == 1:
|
if len(grouped_effects) == 1:
|
||||||
group.append(
|
if False:
|
||||||
create_effect_row(
|
group.append(
|
||||||
card=card,
|
create_effect_row(
|
||||||
effects=grouped_effects[effect_types[0]],
|
card=card,
|
||||||
type=effect_types[0],
|
effects=grouped_effects[effect_types[0]],
|
||||||
height=height,
|
type=effect_types[0],
|
||||||
width=width,
|
height=height,
|
||||||
),
|
width=width,
|
||||||
)
|
),
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.append(
|
||||||
|
dw.Line(sx=10, sy=80, ex=width - 10, ey=80, stroke="black", stroke_width=1)
|
||||||
|
)
|
||||||
|
group.append(
|
||||||
|
create_effect_row(
|
||||||
|
card=card,
|
||||||
|
effects=grouped_effects[effect_types[0]],
|
||||||
|
type=effect_types[0],
|
||||||
|
height=80,
|
||||||
|
width=width,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
flavor_text = "chouette!"
|
||||||
|
|
||||||
|
font_width = 0.5
|
||||||
|
line_width = (
|
||||||
|
max(*[len(x) for x in flavor_text.split("\n")], len(flavor_text)) * font_width
|
||||||
|
)
|
||||||
|
# Take width in account
|
||||||
|
font_size = effect_text_size
|
||||||
|
font_size = min(
|
||||||
|
font_size, (font_size * 3) - line_width, font_size * width / (line_width or 1)
|
||||||
|
)
|
||||||
|
# Take height in account
|
||||||
|
font_size = min((height) / (flavor_text.count("\n") or 1), font_size)
|
||||||
|
|
||||||
|
font_size = max(font_size, 11)
|
||||||
|
|
||||||
|
group.append(
|
||||||
|
dw.Group(
|
||||||
|
[
|
||||||
|
dw.Text(
|
||||||
|
text="Funky!", # TODO: mettre en italique & gris
|
||||||
|
x=0,
|
||||||
|
y=(-font_size / 2) * flavor_text.count("\n"),
|
||||||
|
text_anchor="middle",
|
||||||
|
fill="black",
|
||||||
|
font_size=font_size,
|
||||||
|
font_family="Helvetica",
|
||||||
|
transform=f"translate({width / 2},{height - 80})"
|
||||||
|
)
|
||||||
|
],
|
||||||
|
transform=f"translate({0},{55})"
|
||||||
|
)
|
||||||
|
)
|
||||||
if len(grouped_effects) == 2:
|
if len(grouped_effects) == 2:
|
||||||
group.append(
|
group.append(
|
||||||
dw.Line(sx=10, sy=80, ex=width - 10, ey=80, stroke="black", stroke_width=1)
|
dw.Line(sx=10, sy=80, ex=width - 10, ey=80, stroke="black", stroke_width=1)
|
||||||
|
|||||||
Reference in New Issue
Block a user