adding sprite in group to MTE spriteLayer

Hi,

I’ve got a sprite encapsulated inside a table (as a kind of class instance) as follows -

ship.lua Ship = {} local self = display.newGroup() local shipImg = display.newImageRect("ship.png", 46, 46) return self  

So, in my main setup, I’m trying to add the ship sprite to the MTE layer (so I can have the camera follow it) -

main.lua require("ship") local mte   = require('mte').createMTE()   ship1        = Ship:new() ship2        = Ship:new() gameShips = {ship1, ship2}  local setup = {kind = "sprite", layer = mteLayer, locX = 5, locY = 5, levelWidth = 10, levelHeight = 10} mte.addSprite(gameShips[1], setup)  

however, MTE throws this error - ‘attempt to call method ‘setFillColor’  (a nil value)’

Could someone tell me how to add my sprite inside the group into MTE’s sprite layer?

Thanks,

Carl

Hello Carl,

Change kind = “sprite” to kind = “group” to prevent this error. 

Hello Carl,

Change kind = “sprite” to kind = “group” to prevent this error.