Ver código fonte

FX2D: Shader on Flow background

Tom Spira 6 anos atrás
pai
commit
86d6ba4c7a
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10 0
      hrt/prefab/Shader.hx

+ 10 - 0
hrt/prefab/Shader.hx

@@ -70,6 +70,16 @@ class Shader extends Prefab {
 				ctx.cleanup = function() {
 					drawable.removeShader(shader);
 				}
+			} else {
+				var flow = Std.downcast(ctx.local2d, h2d.Flow);
+				if (flow != null) {
+					@:privateAccess if (flow.background != null) {
+						flow.background.addShader(shader);
+						ctx.cleanup = function() {
+							flow.background.removeShader(shader);
+						}
+					}
+				}
 			}
 		}
 		if(ctx.local3d != null) {