why is display a nil value

I’m a noob to Solar2D. I just want to display a rectangle.

This is my only code in main.lua :
local bird = display.newRect(100,200,20,20)

I get this result from ZeroBrane Studio when I run it.
“attempt to index global ‘display’ (a nil value)”

but it works fine in Corona Simulator.
Why does it not run in ZeroBrane Studio?

There are probably additional steps required to develop Solar2D in ZeroBrane.

I found a debugging tutorial (for Corona SDK, so, before the whole rebranding thing). It deals with running and debugging your applications akin to what the Simulator allows, so it could prove helpful:

To enable the integration shown in the demo, you need to select Corona as an interpreter in ZeroBrane Studio by going to Program | Lua Interpreters | Corona. If you installed Corona in the default location on OSX (/Applications/CoronaSDK) or on Windows (C:\Program Files\Corona Labs\Corona SDK or D:\Program Files\Corona Labs\Corona SDK), it will be found and used by the IDE.

1 Like

Do you have a separate copy of Lua installed don your system?

It sounds like ZeroBrane is not running the script with Corona/Solar2D.

i did your first message and it works fine. Thanks :slight_smile: