2
\$\begingroup\$

What would be the easiest way to draw a thin border around a rectangle image display object in Corona Lua?

This is what I tried:

  • Reviewed API and could not find a "border" method/property on displayObject
  • Have tried creating a black box slightly bigger behind object, however can not see how to place object behind an existing object hence question How do I move an existing display object behind another in Corona Lua?
  • Google results for putting a border around a display object in corona didn't help
\$\endgroup\$
  • 2
    \$\begingroup\$ -1 this question shows no research effort. You should tell us what you've tried and how it didn't work. \$\endgroup\$ – MichaelHouse Apr 16 '12 at 2:51
  • \$\begingroup\$ @Byte56 - added to main question \$\endgroup\$ – Greg Apr 16 '12 at 6:14
2
\$\begingroup\$

We have display option available now. You can set strokeWidth & setStrokeColor based on your requirement for display objects.

Here is the help link

Kudos!!!

\$\endgroup\$
2
\$\begingroup\$

You can add an object behind another. Just add the black object (the border) first and then your main object. If you are using physics you have to set some flags so the 2 objects don't collide. Why don't you just add a sprite for your object (png, jpg) ?

\$\endgroup\$
  • \$\begingroup\$ was really more from trying to understand what is possible in Lua/Corona - so I guess there's no API/SDK method then to do this... \$\endgroup\$ – Greg Apr 16 '12 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.