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.
Follow the steps in this recipe to write text on the user's screen:
Create a new main stack in LiveCode.
Add a label field to the card with the following properties:
Name:
userInput
Width:
300
foregroundColor: Yellow
Align text left
Size of text:
18
Add the following code to the card:
on openCard put the long date & tab & the long time into fld "userInput" end openCard
Run the app in the mobile simulator. Your results should be similar to what is displayed in the following screenshot: