From the posts on this site, it seems that many Corona developers come from the Flash, gaming or related worlds. For those of us who don’t (my background is in headless server apps), things like reference points, xOrigin, xReference, X, tiles and bitmap-masks initially feel a bit daunting & the docs presume that you know what these things are about.
I’m trying to make an object disappear behind an INVISIBLE object. The invisible object (lets call it the “wall”) needs to be invisible so that the construct (an object) will work on any background that I place it over. And because this “wall” has a fixed edge, my object must disappear in increments as it’s Y coordinate changes…in other words, I can’t just set “isVisible” to false.
I would greatly appreciate any tips or examples (using masks I presume) from you experienced guys that show how to do such a thing.
In return, I share one of my favorite Lua tips that greatly simplifies the code for setting default params in your objects.
Instead of all this code:
[lua]if ( params.font ) then
font=params.font
else
font=native.systemFontBold
end
– you can do this
font = params.font or native.systemFontBold
– if params.font is nil, the value after “or” gets returned[/lua]
[import]uid: 6175 topic_id: 6151 reply_id: 306151[/import]