Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
上QQ阅读APP看书,第一时间看更新

Conventions

You will also find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

textObject = display.newText( "Hello World!", 160, 80, native.systemFont, 36 )
textObject: setFillColor ( 1, 1, 1 )

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

    local buyLevel2 = function ( product ) 
      print ("Congrats! Purchasing " ..product)

     -- Purchase the item
      if store.canMakePurchases then 
        store.purchase( {validProducts[1]} ) 
      else
        native.showAlert("Store purchases are not available, please try again later",  { "OK" } ) – Will occur only due to phone setting/account restrictions
      end 
    end 
    -- Enter your product ID here
 -- Replace Product ID with a valid one from iTunes Connect
 buyLevel2("com.companyname.appname.NonConsumable")

Any command-line input or output is written as follows:

keytool -genkey -v -keystore my-release-key.keystore -alias aliasname -keyalg RSA -validity 999999

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Click on the Enroll Now button and follow Apple's instructions to complete the process."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.