浏览代码

stash shadow so it does not come back when showcode shows it

Joe Shochet 21 年之前
父节点
当前提交
fc2592fabb
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      direct/src/showbase/ShadowDemo.py

+ 4 - 2
direct/src/showbase/ShadowDemo.py

@@ -105,7 +105,8 @@ class ShadowCaster:
 
 
 def avatarShadow():
 def avatarShadow():
     # Turn off the existing drop shadow.
     # Turn off the existing drop shadow.
-    base.localAvatar.dropShadow.hide()
+    # stash it so that when the game hides and shows it, it will still be gone
+    base.localAvatar.dropShadow.stash()
 
 
     # Set up a new node to hold the "light": this is an abitrary point
     # Set up a new node to hold the "light": this is an abitrary point
     # somewhere above the avatar, looking down, as if from the sun.
     # somewhere above the avatar, looking down, as if from the sun.
@@ -150,7 +151,8 @@ def piratesAvatarShadow():
 def arbitraryShadow(node):
 def arbitraryShadow(node):
     # Turn off the existing drop shadow, if any
     # Turn off the existing drop shadow, if any
     if hasattr(node, "dropShadow"):
     if hasattr(node, "dropShadow"):
-        base.localAvatar.dropShadow.hide()
+        # stash it so that when the game hides and shows it, it will still be gone
+        base.localAvatar.dropShadow.stash()
 
 
     # Set up a new node to hold the "light": this is an abitrary point
     # Set up a new node to hold the "light": this is an abitrary point
     # somewhere above the node, looking down, as if from the sun.
     # somewhere above the node, looking down, as if from the sun.