Wiki

Clone wiki

Core / CodeaViewer

Back to Beyond the Codea in-app reference


FunctionIconOverview-Small.png The Codea Viewer

Introduction

After you press the Play button to run your code, and while your code is running, you are presented with the Codea Viewer. What you see will depend on the display mode (set by the displayMode() function - see the 'Display' chapter of Codea's in-app reference) and the orientation of your iPad (the supported orientations can be limited by the use of the supportedOrientations() function - see also the 'Display' chapter). The default display mode is the standard screen mode, which presents the Viewer pane to the right and the Parameters and Output panes to the left.

Below is an example in landscape orientation, taken from Codea's 'Parameters' example project. The parts of the display are explained further below.

CodeaViewer.png

[a] The Viewer pane

The Viewer pane appears to the right. The width and height of the pane is provided by Codea's global variables WIDTH and HEIGHT and its background colour is set by Codea's background() function (see the 'Graphics' chapter of Codea's in-app reference).

[b] The display mode toggle

The display mode toggle allows the user to toggle between display modes: the standard screen mode or the fullscreen mode (with buttons).

[c] The Output pane

In standard screen mode, the Output pane appears to the right. The size of the pane can be adjusted (see [d] below).

The results of each call of Lua's print() function are displayed sequentially in a separate section of the Output pane. Individual results can be selected and copied to the clipboard (see [e] below). If the results cannot all be displayed, you can scroll up or down through the contents of the pane by touching and dragging the pane's contents.

The Output pane can be cleared in code by calling the output.clear() function (see the 'Parameters' chapter of Codea's in-app reference).

[d] The Output pane header

The size of the Output pane can be adjusted by touching and dragging the header of the pane. It can be expanded to obscure the whole of the Parameters pane or reduced so that there is no Output area visible.

[e] Contents of the output pane

If you touch a section of the Output pane, it darkens to indicate that a copy of the contents of the section has been placed onto the clipboard.

[f] The Parameters pane

The Parameters pane displays the features created by calls to the functions in the parameter table provided by the Codea API (see the 'Parameters' chapter of Codea's in-app reference).

The Parameters pane can be cleared in code by calling the parameter.clear() function (see also the 'Parameters' chapter).

[g] Type a Lua statement

While your code is running you can execute a Lua statement by touching this area and typing the statement.

[h] Tab back through past Lua statements

Touch this button to tab back through past Lua statements entered while the code was running.

[i] Back button

Touch the Back button to stop your code running and return to the Codea Editor.

[j] Pause/Play button

Touch the Pause button to pause the execution of your code. When paused, the button changes to a Play button. Touch the Play button to resume the execution of your code.

[k] Replay button

Touch the Replay button to rerun your code.

[l] Camera button

Touch the Camera button to take a snapshot of the contents of the Viewer pane. If you do not Cancel, you have the option of Tweeting or Saving the image.

[m] Video button

Touch the Video button to record a video of the contents of the Viewer pane. While recording, the Video button turns bright red and a red border appears around the Viewer pane. A timer in the top left corner counts the hours, minutes and seconds (hh:mm:ss) recorded. Touch the red Video button to stop the recording. You have the option of discarding the video or saving it to your camera roll.

Updated