Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit 2320892d389a6149cd98fa30c472bd2bd4e65982
parent 82a0fd393e1dc883dcb338bb3bf6594814f4ea5e
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Mon, 28 Dec 2020 11:30:35 -0600

added ability for scene bg to be transparent

Diffstat:
Msrc/scene.py | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/scene.py b/src/scene.py @@ -136,7 +136,8 @@ class StillScene(object): with open(os.path.join(SCENE_JSON_PATH, scenefile)) as df: scenedef = json.load(df) self.name = scenedef["name"] - self.background = entity.Entity(sh[scenedef["bg_sheet"]], tuple(scenedef["bg_sprite"])) + if scenedef["bg_sheet"] != None: + self.background = entity.Entity(sh[scenedef["bg_sheet"]], tuple(scenedef["bg_sprite"])) self.script = scenedef["script"] for f in scenedef["fonts"]: self.fonts[f] = pygame.font.Font(os.path.join(FONT_PATH, scenedef["fonts"][f][0]), scenedef["fonts"][f][1]) @@ -279,7 +280,8 @@ class StillScene(object): """ xoff = 0 if surface != None: - self.background.update(surface) + if self.background != None: + self.background.update(surface) # Update character compounds for c in self.displayed_characters: