Book Image

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri
Book Image

LiveCode Mobile Development Cookbook

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (17 chapters)
LiveCode Mobile Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Writing text


When coding mobile applications, you might have the need to write text to the screen or external files, such as displaying a level completion message or posting a new high score on a leaderboard. In this recipe, you will learn how to write text to the screen of a mobile device.

How to do it...

Follow the steps in this recipe to write text on the user's screen:

  1. Create a new main stack in LiveCode.

  2. Add a label field to the card with the following properties:

    • Name: userInput

    • Width: 300

    • foregroundColor: Yellow

    • Align text left

    • Size of text: 18

  3. Add the following code to the card:

    on openCard
      put the long date & tab & the long time into fld "userInput"
    end openCard
  4. Run the app in the mobile simulator. Your results should be similar to what is displayed in the following screenshot:

How it works...

In this recipe, we used the put command to put data on the screen using a text field. The same command can be used to put data in objects such as buttons, text fields, and so on.

See also

  • The...