swatch.putflush([X0,Y0,X,Y1])
メイン画面の内容をSmartWatchの画面にフラッシュします。引数省略時は、メイン画面全体がSmartWatch画面にフラッシュします。
引数
- X0: フラッシュ範囲の左上X座標
- Y0: フラッシュ範囲の左上Y座標
- X1: フラッシュ範囲の右下X座標
- Y1: フラッシュ範囲の右下Y座標
SmartWatchへの画面のフラッシュは、1秒に3回程度にしないと表示やタッチ処理が追いつかない感じです。
(注意) swatchコマンドを使うには、別アプリのBitmapキャッチャが必要です。
Bitmapキャッチャのダウンロードはこちらから
→ https://play.google.com/store/apps/details?id=com.luaridaworks.smartwatch.bitmapcatcher
使用例
local gwide,gheight = 128, 128 --内部グラフィック画面設定の変更 canvas.setMainBmp( gwide, gheight ) canvas.setWorkBmp( gwide, gheight ) canvas.putCls() canvas.workCls() --SmartWatchアプリBitmapキャッチャを起動させる swatch.start() --加速度を取得 local ax, ay, az = swatch.getAccel() local h = 30 local droidangle = 180 - math.atan2( ax, -ay )*57.29577951 canvas.putCls(color(0,0,0)) canvas.putText( string.format("X= %f",ax), 0, h, 18, color(255,255,255) ) canvas.putText( string.format("Y= %f",ay), 0, h+20, 18, color(255,255,255) ) canvas.putText( string.format("Z= %f",az), 0, h+40, 18, color(255,255,255) ) canvas.putText( string.format("a= %f",droidangle), 0, h+60, 18, color(255,255,255) ) --SmartWatchの画面に表示します swatch.putflush() canvas.putflush() --Androidの画面にも表示します touch(3) --Android画面タッチで終了します --SmartWatchアプリBitmapキャッチャを終了させる swatch.stop() system.exit()