操作ガイド
1. 概括
2. 使い方
3. スクリプト
AutoTouchはモバイルデバイスでの様々なタッチとクリック操作を記録し、再生することができる。また、事前にLuaスクリプト言語で作ったスクリプトを実行し、人間のタッチ操作をシミュレートすることによって、より多くの予想外の機能を実現することもできる。例えば、自動的にゲームをやり始め、猛獣を倒してお金を稼ぐ、大量の写真を一緒に編纂する、プログラムの自動化テストへ入る或いは自動的にメールアドレスにログインするなど。
現在、AutoTouchはすでに多くの人々の操作を記録して再生する能力を持っている。例えば、タッチ、実体のホームボタンや音量ボタンや声のスイッチボタンやロックボタンをクリックするなど。しかも、正確かつスムーズにできる。また、キャプチャー、一部の画面のキャプチャー、カラールックアップ、カラーマッチング、画像マッチングなどの拡張関数を提供し、更に大きな発掘可能の潜在能力を備えている。これらの特異な能力を組み合わせると、あなたを束縛できるのは想像力だけになる。
- CydiaにBigBossのソースを添加したことを確かめる;
- Cydiaの中でAutoTouchを探し出してインストールする;
- 今までにActivatorをインストールしたことがない場合、AutoTouchをインストールすると同時に、自動的にこのジェスチャーコントロール用のプラグインをインストールする。それをアンインストールしないことを進める。さもなければ、AutoTouchも一緒にアンインストールされる。
- 録画を開始したいインタフェースで、音量ダウンボタン(あるいは設定した他のActivatorコントロール動作)を長押しして、コントロールパネルをポップアップする。コントロールパネルに録画ボタンとスクリプトリストがある;
- コントロールパネルの上の「収録」ボタンをクリックすると、震動で録画の開始を提示する;
- 次はやりたいタッチや他の操作をしてください、例えば猛獣倒しなど;
- 録画を止めたい時、「録画終了」のヒントボックスがポップアップまで音量ダウンボタン(或いは前述の他のコントロール動作)を長押しして、震動で録画の終了を提示する;
- 次は、AutoTouchでさっき収録したスクリプトをチェックして、管理や放送できる。スクリプトはデフォルトで作成時間を名称とする、よりわかりやすい名前になるように修正することもできる。
- 再生したいインターフェースで、音量ダウンボタン(あるいは設定した他のActivatorコントロール動作)を長押しして、コントロールパネルをポップアップする;
- コントロールパネルで再生したいスクリプトをクリックする;
- 次は、再生回数、間隔と速度を聞く再生設置のダイアログボックスが出てくるのは普通である。(スクリプトを直接に再生すると設置したことがある場合を除く);
- 「ただちに実行」をクリックすると、さきほどの設置によってすぐに再生を行い、震動で開始を提示する。再生終了後、自動的に停止し、終了のダイアログをポップアップする(設置でダイアログの提示を閉じることができる)。音量ボタンを長押しして(或いは前述の動作)再生を中断することもできる;
- もし、「後に実行」をクリックする場合、準備するという状態に入る。この状態では、音量ダウンボタンをクリック(長押しではない、修正できない)することによって、繰り返しに起動したり再生を中断したりことができる。しかも問い合わせダイアログボックスが出てこなくなり、再びあなたを中断していない。再び、長押し(或いは前述の動作)して、準備するという状態を閉じる;
- あなたは、「再生設置」のインターフェースでスクリプトを直接に再生すると設置し、デフォルトの再生設置を設置する。こうしてこのスクリプトを選ぶと、直接に設置のままに再生し、再生設置の問い合わせダイアログボックスがで二度と出てこない。
- ツールバー中間の「アクション」ボタンを押して、「新規ファイル」を选択すれば、新しいスクリプトウィンドウが開ける;
- スクリプトの編集インタフェースでコードを書く;
- 「保存」ボタンをクリックして名称を入力保存する。
- AutoTouchでスクリプトをクリックして、「暗号化」を選ぶ;
- 暗号化パスワードを入力し、パスワードの間に空白のままでいい;
- 「確定」をクリックして暗号化を完了する。同時に同名だが、 lua.eで終わる暗号化ファイルが生成する;
- 暗号化したスクリプトを選択し、再生できる。パスワードがない場合、ヒントによってパスワードを入力すればいい。
- あなたは、設定インターフェイスのWebサーバを開き、ブラウザのURLを介してコンピュータ上のプロンプトにアクセスし、その後、スクリプトを編集することができ;
- また、インターフェイスを設定する際にWebDAVサーバーを開くことができますし、コンピュータ上のアドレスWebDAVクライアントソフトウェアによってプロンプト接続するために、そして、あなたは、スクリプトを編集することができます;
- 「設定」インターフェースの「授権」ボタンをクリックして、授権情報インタフェースを開く;
- 授権情報インタフェースを開くと、授権の検証を行う;
- 授権の検証が失敗する場合、支払いボタンが出てくる;
- 支払いボタンをクリックして、ブラウザウィンドウへ移り、支払いページが開く。alipayのユーザーは是非支払いページの「支払い説明」に設備のシリアル番号に貼り付けてください;
- 支払いが完了後、「設定」のインターフェースで「授権」をクリックして検証する;
- 授権が検証される後、無限の再生時間と全部の機能が獲得できる。
- 直接ショップからすべてのスクリプトをダウンロードすることができる;
- 暗号化したスクリプトもあるので、、作者と連絡してパスワードを購入する必要がある;
- スクリプトがダウンロードされる後、スクリプトリストに保管する。他のスクリプトのように直接に使用することができる。
- 共有や販売するために、ショップにスクリプトを公開することができる;
- ただスクリプトを分かち合いたい場合、直接に. luaファイルをアップロードすればいい。他人に内容を見られたくないなら、パスワードなしの暗号化ができる;
- ショップでスクリプトを売り出したい場合、スクリプト暗号化し、パスワードを設定することができる。このようにして、スクリプトを必要としている人はあなたと連絡してパスワードを購入する。
Lua Official Reference Manual でLua言語の使用を勉強することができる.
拡張関数はLua言語の広がりに使うものである。アナログ人間が携帯電話を操作すると同じいくつかの機能を備えさせる。また、キャプチャー、一部の画面のキャプチャー、カラールックアップ、カラーマッチング、画像マッチングなどの機能も提供する。
在スクリーンの(x, y)座標を押す。
- パラメータ
- id: 指の番号で、デフォルトで0とすればいい.
- x: スクリーンのx座標.
- y: スクリーンのy座標.
- 戻り値
- 例
touchDown(0, 100, 200); -- 座標(100, 200)のところで押す。
指を(x, y)座標に移動する。
- パラメータ
- id: 指の番号で、デフォルトで0とすればいい.
- x: スクリーンのx座標.
- y: スクリーンのy座標.
- 戻り値
- 例
touchDown(0, 100, 200); -- 座標(100, 200)のところで押す。
touchMove(0, 200, 200); -- 指を座標(200, 200)に移動する。
(x, y)座標から押した指を挙げる。
- パラメータ
- id: 指の番号で、デフォルトで0とすればいい.
- x: スクリーンのx座標.
- y: スクリーンのy座標.
- 戻り値
- 例
touchDown(0, 100, 200); -- 座標(100, 200)のところで押す.
touchMove(0, 200, 200); -- 指を座標(200, 200)に移動する.
touchUp(0, 200, 200); -- 座標(200, 200)のところで押した指を挙げる.
座標点(x、y)をクリックする.
- パラメータ
- x: スクリーンのx座標.
- y: スクリーンのy座標.
- 戻り値
- 例
tap(100, 200); -- 座標(100, 200)をクリックする.
Simulate a key button down event.
- Params
-
keyType: the keyType you want to simulate, now you can use these key type.
- Return
- Examples
keyDown(KEY_TYPE.HOME_BUTTON);
-- Simulate a home button down event.
-- how to make a key press
function keyPress(keyType)
keyDown(keyType);
usleep(10000);
keyDown(keyUp);
end
keyPress(KEY_TYPE.HOME_BUTTON);
Simulate a key button up event.
- Params
keyType: the keyType you want to simulate, now you can use these key type.
- Return
- Examples
keyUp(KEY_TYPE.HOME_BUTTON);
-- Simulate a home button up event.
現在のスクリーンで指定した座標の色情報を得る.
- パラメータ
- x: iOS座標係で指定した点のx座標.
- y: iOS座標係で指定した点のy座標.
- 戻り値
- 例
local rgb = getColor(100, 200);
alert("rgb:" .. rgb);
-- rgb:16777215
現在のスクリーですべての指定した色とマッチングする座標点を取得する。.注意すべきのは、このようにfind(rgb=0x0000ff、カウント=5)を使うではなく、find(0x0000ff、5)を使うべきである。findImageのパラメータは全体としてtableであるため、findImage関数と違っている.
- パラメータ
- rgb: intタイプのrgb値(必要).
- count: 最大何点を検査できるのか、デフォルトで0、すべてのマッチングする点を検査することを表示する。1である場合、、初めての点を探し出せばいい。2である場合、最初の2つを検出すればいい。検索の数が少なければ少ないほど早くなる(選択可能).
- 戻り値
- locations: 見つけた点の座標。例えば:{ { x1、y1 }、{ x 2、y2 }、…}.
- 例
-- 例 1:
local result = findColor(0x0000ff, 2, nil);
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
-- 例 2:
local result = findColor(0x00ddff, 0, {100, 50, 200, 200});
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
-- 例 3:
local region = {100, 50, 200, 200};
local result = findColor(0x00ddff, 0, region);
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
Find all the regions(rectangles) contain the specified colors and fit their relative positions on the screen, return the center coordinates of the regions as table. You can use the count parameter to limit the result number of finding, pass in 0 if no limit, and use region to limit the region of finding, pass in nil if no limit.
There is a powerful help tool in the script edit view, click on the "Extensions" to open the function list, click "HELPER" besides the findColors function, it will ask you to choose and open a screenshot from the album, zoom in the screenshot till the pixels are clear, click on the pixels you want to mark as anchor points, then it will get the colors and their relative positions, it will construct the "colors" parameters while you are marking, it's very intuitionistic.
- Params
- colors: a table contains some colors and their relative positions that can determine a region on the screen, for example {{0x00ddff,0,0}, {0x00eeff,10,10}, {0x0000ff,0,20}}, the little table contains three elements inside that big table means {color, relative_first_element_x, relative_first_element_y}, the relative position of first color always is (0,0), as you look, it is {0x00ddff,0,0}, meanwhile, the relative postion of other colors are the postions relative to the first color, {0x00eeff,10,10} means is is x:10,y:10 relative to the first color.With these colors and the relative positons, we can determine the regions on the screen.
- count: how many at most you want to find out, pass in 0 by default, means all the fit ones in the screen should be found.count=1 means only the first fit one should be found, count=2 means the first two should be found. It will be faster if you set this parameter to a small value.
- region: The region you want to find in, that's different with the region we've mentioned in the colors parameter. This region is a table contains 4 elements:left-top x-coordinate, left-top y-coordinate, region width, region height. Use like this {100, 100, 200, 200}. Pass in nil if you don't want any limit. ATENSION: all the 4 elements are in the iOS coordinate system.
- Return
- locations: a table ccontains the center locations of the regions fit the specified color. Looks like {{x1, y1}, {x2, y2}, ...}.ATTENSION: it returns the center coordinates of the regions found out, not the left-top coordinates.
- Examples
-- example 1:
local result = findColors({{0x00ddff,0,0}, {0x00eeff,10,10}, {0x0000ff,0,20}}, 2, nil);
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
-- example 2:
local colors = {{0x00ddff,0,0}, {0x00eeff,10,10}, {0x0000ff,0,20}};
local result = findColors(colors, 0, nil);
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
-- example 3:
local colors = {{0x00ddff,0,0}, {0x00eeff,10,10}, {0x0000ff,0,20}};
local region = {100, 50, 200, 200};
local result = findColors(colors, 0, region);
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
Find the regions similar to the specified image on the screen, return the center coordinates of the regions as table. ATENSION: from AutoTouch v3.1.1 on, the parameter of findImage is not a table as the old versions before anymore, you have to pass in the parameters one by one, event you don't want , you shold pass in the default value, such as 0, nil, etc.
- Params
- imagePath: the path of the small image you want to find out from the screen, such as the spirit image in the game. ATTENSION: the image path is the path that's relative to the root dir path (that is the defalut document directory path of AutoTouch, also is the result of rootDir() function), not the exact whole path, just the same as the file path of screenshot function. For example, a path "images/spirit.png" means "/var/mobile/Library/AutoTouch/Scripts/images/spirit.png" in fact, namely, it is rootDir() joins "images/spirit.png", never pass in a exact whole path, no whole path anymore from AutoTouch v
- count: how many at most you want to find out, pass in 0 by default, means all the fit ones in the screen should be found.count=1 means only the first fit one should be found, count=2 means the first two should be found.It will be faster when you set this parameter to a small value.
- fuzzy: the degree of fuzzy matching when finding, pass in 1 by default, means match exactly, fuzzy=0.5 means match 50%.
- ignoreColors: a table contains the colors will be ignored when finding, pass in nil by default, means no ignore colors.
- region: The region you want to find in. This parameter is table contains 4 elements:left-top x-coordinate, left-top y-coordinate, region width, region height. Use like this {100, 100, 200, 200}. Pass in nil if you don't want any limit. ATENSION: all the 4 elements are in the iOS coordinate system.
- Return
- locations: a table contains the center coordinates of the regions fit the specified image. Looks like {{x1, y1}, {x2, y2}, ...}. ATTENSION: it returns the center coordinates of the regions found out, not the left-top coordinates.
- Examples
-- example 1:
local result = findImage("images/spirit.png", 5, 1, nil, nil);
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
-- example 2:
local result = findImage("images/spirit.png", 0, 0.6, nil, nil};
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
-- example 3:
local result = findImage("images/spirit.png", 0, {0xffffff, 0x2b2b2b}, nil};
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
-- example 4:
local region = {100, 50, 200, 200};
local ignoreColors = {0xffffff, 0x2b2b2b};
local result = findImage("images/spirit.png", 1, 0.9, ignoreColors, region};
for i, v in pairs(result) do
log("x:" .. v[1] .. ", y:" .. v[2]);
end
この関数はfindColorとほぼ同じ、違いはfindColorTapがそれらの点を見つけて順番に0.016秒の間隔を置いてクリックし、それに何の値も戻らない.
- パラメータ
- color: intタイプのrgb値(必要).
- count: 最大何点を検査できるのか、デフォルトで0、すべてのマッチングする点を検査することを表示する。1である場合、、初めての点を探し出せばいい。2である場合、最初の2つを検出すればいい。検索の数が少なければ少ないほど早くなる(選択可能).
- 戻り値
- 例
-- 例 1:
findColorTap(0x0000ff, 2, nil); -- 色が0x0000ffである最初の二つの座標点を見つけて順番に0.016秒の間隔を置いてクリックする.
-- 例 2:
local region = {100, 50, 200, 200};
findColorTap(0x0000ff, 0, region);
As it looks like, this function finds out the regions (totally same as findColors does we've talked about before), and tap them a time one by one with 0.016 second interval. It's parameters are totally the same as findColor function, and it doesn't return anything.
- Params
- totoally same as the params of findColors
- Return
- Examples
findColors({{0x00ddff,0,0}, {0x00eeff,10,10}, {0x0000ff,0,20}}, 2, nil); -- find out the first two regions fit the specified colors and their relative positions, then tap them a time one by one.
local region = {100, 50, 200, 200};
findColors({{0x00ddff,0,0}, {0x00eeff,10,10}, {0x0000ff,0,20}}, 2, region); -- find out all the regions, then tap them a time one by one.
As it looks like, this function finds out the regions (totally same as findColor does we've talked about before), and tap them a time one by one with 0.016 second interval. It's parameters are totally the same as findColor function, and it doesn't return anything.
- Params
- totoally same as the params of findColor
- Return
- Examples
local region = {100, 50, 200, 200};
local ignoreColors = {0xffffff, 0x2b2b2b};
findImageTap("images/spirit.png", 1, 0.9, ignoreColors, region};
関数ととほぼ同じで、違いはあれらの区域をそして順次0.016秒間隔をクリックし、任意の値に戻る。この関数はfindImageとほぼ同じ、違いはfindImageTapがそれらの区域を見つけて順番に0.016秒の間隔を置いてクリックし、それに何の値も戻らない.
- パラメータ
- imagePath: 探す図面のの位置(必要).
- count: 最大何個の区域を検査できるのか、デフォルトで0、すべてのマッチングする区域を検査することを表示する。1である場合、、初めてのを探し出せばいい。2である場合、最初の2つを検出すればいい。検索の数が少なければ少ないほど早くなる(選択可能).
- fuzzy: 検査のあいまい度、デフォルトで1、完全に一緻することを示す。0 . 5は50%のドットをマッチングすればいい(選択可能).
- ignoreColors: 検索で無視する必要のある色値、配列の形式で(table in lua)を提供する。(選択可能).
- 戻り値
- 例
local region = {100, 50, 200, 200};
local ignoreColors = {0xffffff, 0x2b2b2b};
findImageTap("images/spirit.png", 1, 0.9, ignoreColors, region};
Take a screenshot of the whole screen or just a region and save it to the specified file path.
- Params
- filePath: The path that you want the screenshot be saved. ATTENSION: the file path is the path that's relative to the root dir path (that is the defalut document directory path of AutoTouch, also is the result of rootDir() function), not the exact whole path, just the same as the image path of findImage function. For example, a path "images/spirit.png" means "/var/mobile/Library/AutoTouch/Scripts/images/spirit.png" in fact, namely, it is rootDir() joins "images/spirit.png", never pass in a exact whole path, no whole path anymore from AutoTouch v
- region: The region you want to take a screenshot.This parameter is table type and contains 4 elements:left-top x-coordinate, left-top y-coordinate, region width, region height.Use like this region={100, 100, 200, 200}, do not use like region={x=100, y=100, width=200, height=200}.Pass in this parameter only when you want to take the screenshot of a region. And all the 4 elements are in the iOS coordinate system.
- Return
- Examples
screenshot ("images/screenshot1.png", nil);
-- Take a screenshot and save it to the specified path.
screenshot ("images/screenshot1.png", {100, 100, 200, 200});
-- Take a screenshot of region(100, 100, 200, 200) and save it to the specified path.
appIdentifierで指定するアプリを起動する.
- パラメータ
- appIdentifier: 応用し、「com.apple.mobilesafari」(必要).
- 戻り値
- 例
appRun("com.apple.mobilesafari");
-- Safariを実行する
appIdentifierで指定するアプリを終了する.
- パラメータ
- appIdentifier: アプリの標識、例えば、「com.apple.mobilesafari」(必要).
- 戻り値
- 例
appKill("com.apple.mobilesafari");
-- 実行しているSafariを終了する
get the state of the specified app with its identifier.
- Params
- appIdentifier: the identifier of the app, such as "com.apple.mobilesafari".
- Return
- state: string type state, they are: "NOT RUNNING", "ACTIVATED", "DEACTIVATED".
- Examples
b = appState("com.apple.mobilesafari");
-- get the state of Safari.
検査指定するアプリは活躍している或いは開いた状態にあるかどうかを検査する.
- パラメータ
- appIdentifier: アプリの標識、例えば「com.apple.mobilesafari」(必要).
- 戻り値
- 例
b = appIsActive("com.apple.mobilesafari");
-- アプリの開く状態を検査する
スクリプト保存のデフォルトアドレスを得る.
local dirPath = rootDir();
-- dirPath = "/var/mobile/Library/AutoTouch/Scripts/"
何マイクロ秒を中止する、つまり1/1000000秒.
- パラメータ
- microseconds: 何マイクロ秒を中止する.
- 戻り値
- 例
usleep(1000000);
-- 1秒中止する
日誌を記録する、日誌のインターフェース見ることができる。
- パラメータ
- logContent: 記録する必要のある日誌内容.
- 戻り値
- 例
log("play here...");
ダイアログボックスをポップアップし、指定内容を示す.
alert("Hello world!");
一回振動する.
vibrate(); -- 一回振動する.
Play the specified audio file, times means how may time you want to play, default is 0, means infinitely.
- Params
- audioFile: the audio file path.
- times: how many times to play, default is 0, means infinitely.
- Return
- Examples
playAudio("/var/audio.mp3", 0); -- play infinitely.
Pause the playing started before.
pauseAudio();
Resume the paused playing before.
resumeAudio();
Stop the playing started before.
stopAudio();
画面解像度を得る.
- パラメータ
- 戻り値
- width: 画面解像度の幅.
- height: 画面解像度の高さ.
- 例
local w, h = getScreenResolution();
-- 解像度の幅は1136、高さは640である.
画面の大きさを取得する。ここはアップル座標係の大きさを指している。画面解像度割る2はRetinaディスプレイとなる.
- パラメータ
- 戻り値
- width: スクリーンの幅.
- height: スクリーンの高さ.
- 例
local width, height = getScreenSize();
-- iPhone 5:幅は320、高さは568である
Get the retina scale of the screen.
- Params
- Return
- scale: The retina scale of the screen.
- Examples
local scale = getScreenScale();
-- 2.0 for iPhone 5, 3.0 for iPhone 6 Plus.
Get the bit depth of the screen.
- Params
- Return
- bitDepth: The retina bit depth of the screen.
- Examples
local bitDepth = getScreenBitDepth();
デバイスのシリアル番号を取得します。
b = getSN();
-- b: C15NFK32TWD2
AutoTouchの現在のバージョンを取得します。
- パラメータ
- 戻り値
- AutoTouchバージョン:string型の結果。
- 例
b = getVersion();
-- b: 3.0.1
R、G、Bタイプにカラー値のint型に変換する。
- パラメータ
- 戻り値
- r: 色の赤の値。
- g: 色の緑の値。
- b: 色の青の値。
- 例
local r, g, b = intToRgb(0x2b2b2b);
整数型にカラー値のRGBタイプに変換します。
- パラメータ
- r: 色の赤の値。
- g: 色の緑の値。
- b: 色の青の値。
- 戻り値
- 例
local intColor = rgbToInt(200, 255, 100);
後で使用することができ、クリップボードに指定されたテキストをコピーします。
copyText("This is a copied text!");
Get the text on the clipboard.
- Params
- Return
- text: string type of text on the clipboard.
- Examples
local text = clipText();
Input the specified text to the focused text field.
- Params
- text: the text will be inputted.
- Return
- Examples
inputText("Let's input some text automatically without tapping the keyboard!");
inputText("\b\b\b"); -- delete backward for 3 characters
Fake geographic position for the specified apps, it remains in effect until you call clearFakeLocation, or clear the faking in the settings view.
- Params
- appIdentifier: the identifier of the app you want to fake, such as "com.apple.Maps".
- latitude: the double type latitude value.
- longitude: the double type longitude value.
- Return
- Examples
fakeLocation("com.apple.Maps", 36, 50); -- fake location for Apple Map.
Clear the location faking for one specified app.
- Params
- appIdentifier: the identifier of the app you want to fake, such as "com.apple.Maps".
- Return
- Examples
clearFakeLocation("com.apple.Maps"); -- clear the location faking for Apple Map.
Show a dialog accepts user input.
- Params
- controls: see the example.Now CONTROLLER_TYPE.LABEL, CONTROLLER_TYPE.INPUT, CONTROLLER_TYPE.PICKER, CONTROLLER_TYPE.SWITCH are supported.
- enableRemember: if enable the switch for users to set remembering the input, if remembered, will use the saved values directly, without showing the dialog again. You can clear the remembered values at the accessory button actions at the script list view.
- Return
- Examples
local label = {type=CONTROLLER_TYPE.LABEL, text="Would you mind to provide some personal informations?"}
local nameInput = {type=CONTROLLER_TYPE.INPUT, title="Name:", key="Name", value="Kevin"}
local positionPicker = {type=CONTROLLER_TYPE.PICKER, title="Position:", key="Position", value="CEO", options={"CEO", "CTO", "CFO", "CXO"}}
local developerSwitch = {type=CONTROLLER_TYPE.SWITCH, title="A Developer:", key="ADeveloper", value=1}
local controls = {label, nameInput, positionPicker, developerSwitch}
local enableRemember = true;
dialog(controls, enableRemember);
alert(string.format("name:%s, birthday:%s, gender:%d", nameInput.value, positionPicker.value, developerSwitch.value))
Get the screen orientation.
local o = getOrientation();
- KEY_TYPE.HOME_BUTTON
- KEY_TYPE.VOLUME_DOWN_BUTTON
- KEY_TYPE.VOLUME_UP_BUTTON
- KEY_TYPE.POWER_BUTTON
- CONTROLLER_TYPE.LABEL
- CONTROLLER_TYPE.INPUT
- CONTROLLER_TYPE.PICKER
- CONTROLLER_TYPE.SWITCH
- ORIENTATION_TYPE.UNKNOWN
- ORIENTATION_TYPE.PORTRAIT PORTRAIT = 1, -- Device oriented vertically, home button on the bottom
- ORIENTATION_TYPE.PORTRAIT_UPSIDE_DOWN PORTRAIT_UPSIDE_DOWN = 2, -- Device oriented vertically, home button on the top
- ORIENTATION_TYPE.LANDSCAPE_LEFT LANDSCAPE_LEFT = 3, -- Device oriented horizontally, home button on the right
- ORIENTATION_TYPE.LANDSCAPE_RIGHT LANDSCAPE_RIGHT = 4 -- Device oriented horizontally, home button on the left