Skip to content

Commit 204071d

Browse files
committed
fix(arcade): fix mix of fade and alpha
1 parent da666de commit 204071d

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

arcade/gui/experimental/splash.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import arcade
1111
from arcade import View
12-
from arcade.gui import UIView, UIAnchorLayout, UIImage, UILabel, UIBoxLayout
12+
from arcade.gui import UIAnchorLayout, UIBoxLayout, UIImage, UILabel, UIView
1313

1414

1515
class ArcadeSplash(UIView):
@@ -29,7 +29,9 @@ def __init__(self, view: View, duration: int = 3):
2929

3030
anchor = self.ui.add(UIAnchorLayout())
3131
box = anchor.add(UIBoxLayout(space_between=20))
32-
self._logo = box.add(UIImage(texture=arcade.load_texture(":system:/logo.png"), width=400, height=400))
32+
self._logo = box.add(
33+
UIImage(texture=arcade.load_texture(":system:/logo.png"), width=400, height=400)
34+
)
3335
self._logo.alpha = 0
3436
box.add(UILabel("Python Arcade", text_color=(0, 0, 0, 255), font_size=40, bold=True))
3537

arcade/gui/surface.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,14 @@ def draw_texture(
131131
"""
132132
if isinstance(tex, NinePatchTexture):
133133
if angle != 0.0:
134-
raise NotImplementedError(f"Ninepatch does not support an angle != 0 yet, but got {angle}")
134+
raise NotImplementedError(
135+
f"Ninepatch does not support an angle != 0 yet, but got {angle}"
136+
)
135137

136138
if alpha != 255:
137-
raise NotImplementedError(f"Ninepatch does not support an alpha != 255 yet, but got {alpha}")
139+
raise NotImplementedError(
140+
f"Ninepatch does not support an alpha != 255 yet, but got {alpha}"
141+
)
138142

139143
tex.draw_rect(rect=LBWH(0, 0, width, height))
140144
else:

arcade/gui/widgets/image.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,10 @@ def do_render(self, surface: Surface):
5050
self.prepare_render(surface)
5151
if self.texture:
5252
surface.draw_texture(
53-
x=0, y=0, width=self.content_width, height=self.content_height, tex=self.texture, alpha=self.alpha
53+
x=0,
54+
y=0,
55+
width=self.content_width,
56+
height=self.content_height,
57+
tex=self.texture,
58+
alpha=self.alpha,
5459
)

0 commit comments

Comments
 (0)