2012/1/8 Duncan Cross <duncan.cross@gmail.com>:
>
> Try first removing the module('canvas') line (module() is not useful
> in situations like this, where you are constructing your own object
> and returning it at the end), and then setting the global variable
> yourself at the end, e.g.:
>
> -- Create base instance
> local baseInstance = Canvas.newcanvas(otherModule:CreateSurface
> {caps='DSCAPS_PRIMARY|DSCAPS_FLIPPING'})
> _G.canvas = baseInstance
> return baseInstance
>
> -Duncan
>
Sounds like a sensible solution. Thanks.