Jump to content
  • Advertisement
  • entries
  • comments
  • views

From the Forum – Issue #168

Sign in to follow this  


Welcome to this week’s From the Forum. In this post, we highlight a few Corona Community Forums posts that cover important topics.

Modules, modules, modules

Developers love to build their own libraries. The bigger they get, the more important organization of the code becomes. In this thread, learn some strategies for maintaining modules in your code.

Moving containers

The original poster’s question was curious how to move a display object so that it only shows part of the object, depending on the position. Think of moving a character in front of an X-Ray machine. Enter containers. This thread goes into quite a bit of depth on how to use containers to partially reveal objects.

Cool Lua syntax

The original poster saw some Lua syntax that wasn’t familiar. Enter forum superstar @roaminggamer with a great explanation on single line conditionals to populate variables in this thread.

Do you have a particular forum thread that was helpful for you? Let us know about it! Email support@coronalabs.com, put FTF: and the forum title in the subject, and include the URL in the email. We will consider adding it to an upcoming edition of From the Forum.

View the full article

Sign in to follow this  

1 Comment

Recommended Comments

I'm not sure if this is a bot but oh well.

That cool Lua syntax has a small issue that if the second value is falsy (nil or false, nothing else in Lua is falsy like thing in PHP, Python or JS are, but in Python there is a dedicated conditional anyway) it'll assigng the last no matter what so it's not a 100% equivalent for an if to pick between false and nil.


$ lua51
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> print((1 == 2) and false or nil)
> print((1 == 1) and false or nil)
> print((1 == 1) and 3 or nil)
> print((1 == 2) and 3 or nil)


Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!