From bc63ff3ea8266e7332ebc4b4a8d76206d7447b5f Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Fri, 16 Nov 2012 12:35:49 +0100 Subject: [PATCH] Use Canvas and CanvasGroup ghosts provided by fgfs core --- Nasal/canvas/api.nas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Nasal/canvas/api.nas b/Nasal/canvas/api.nas index 2a15fa804..3f6d79b6b 100644 --- a/Nasal/canvas/api.nas +++ b/Nasal/canvas/api.nas @@ -736,7 +736,17 @@ var Canvas = { # @param id Optional id/name for the group createGroup: func(id = nil) { - return Group.new([me.texture, "group"], id); + if( size(me.parents) >= 2 ) + { + var ghost = me.parents[1].createGroup(); + return { + parents: [ Group.new(props.wrapNode(ghost._node_ghost), id), + ghost ] + }; + } + else + # Fallback for Canvas instances not based on a ghost + return Group.new([me.texture, "group"], id); }, # Set the background color #