Trying to add display.newImageRect to a group

I have the following code that worked perfectly fine as:

local screenGroup = self.view splashimage = display.newImage( "splash.jpg" ) screenGroup:insert( splashimage )  

and when I tried to change to:

local screenGroup = self.view splashimage = display.newImageRect( "splash.jpg" ) screenGroup:insert( splashimage )  

it horribly spits out some obtuse error about a table.

ERROR: table expected. If this is a function call, you might have used ‘.’ instead of ‘:’

(referencing the last line)…which makes no sense to me but I suppose someone else has an idea.

From the docs and online it looks like it should work.

Frustrated, can anyone help?

cheers!

You need to also pass in width and height as arguments to newImageRect dude. Check out http://docs.coronalabs.com/api/library/display/newImageRect.htmlRich

You are spot on. Another forum post here was marked as solved and didn’t note that key piece of info. I have called out the other post as its not a very good thing to reference. Thank you so much!

No problem mate. Error messages in Corona are pretty obscure at the best of times!

You need to also pass in width and height as arguments to newImageRect dude. Check out http://docs.coronalabs.com/api/library/display/newImageRect.htmlRich

You are spot on. Another forum post here was marked as solved and didn’t note that key piece of info. I have called out the other post as its not a very good thing to reference. Thank you so much!

No problem mate. Error messages in Corona are pretty obscure at the best of times!