11# gob_unifiedButton
22
3- [ English ] ( README.en .md )
3+ [ 日本語 ] ( https://github.com/GOB52/gob_unifiedButton/blob/master/ README.ja .md)
44
5- ## 概要
6- 物理ボタン、タッチボタンを持たない CoreS3 上にタッチボタンを追加し、 M5.BtnX 経由で状態を取得できるようにしたライブラリです。
7- 将来的に [ M5Unified] ( https://github.com/m5stack/M5Unified ) に同様の機能がつくまでの暫定としてお使いください。
8- CoreS3 以外では処理をしないので、Basic, Gray, Core2 と共通のソースで作っている方にも有用です。
5+ ![ gob_unifiedButton] ( https://github.com/GOB52/gob_unifiedButton/assets/26270227/590cde0d-f4b6-4fe6-8cae-e25d27b32f8b )
96
10- ## 必要なもの
7+ ## Overview
8+ This library adds touch buttons on CoreS3, which does not have physical buttons or touch buttons, and enables the user to acquire the status via M5.BtnX.
9+ Please use this as an interim feature until a similar feature is added to [ M5Unified] ( https://github.com/m5stack/M5Unified ) in the future.
10+ It is also useful for those who are making a common source for Basic, Gray, and Core2, as it does not process anything other than CoreS3.
11+
12+ ## Required libraries
1113* [ M5Unified] ( https://github.com/m5stack/M5Unified )
1214* [ M5GFX] ( https://github.com/m5stack/M5GFX )
1315
14- ** M5Unified 前提ですので、 M5Core3.h を使用した物には適用できません。 **
16+ ** M5Unified is assumed, so it cannot be applied to those using M5Core3.h. **
1517
16- ## 導入
17- 環境によって適切な方法でインストールしてください
18- * git clone や Zip ダウンロードからの展開
18+ ## How to install
19+ Install in an appropriate way depending on your environment.
20+ * git clone or download zip, and extract into place
1921* platformio.ini
2022``` ini
21- lib_deps = https://github.com/GOB52 /gob_unifiedButton
23+ lib_deps = gob /gob_unifiedButton
2224```
23- * ArduinoIDE ライブラリマネージャからのインストール
24-
25- ## 使い方
25+ * Use library manager on ArduinoIDE
2626
27+ ## How to use
2728``` cpp
2829#include < M5Unified.h>
2930#include < gob_unifiedButton.hpp>
3031
31- goblib::UnifiedButton unfiedButton ;
32+ goblib::UnifiedButton unifiedButton ;
3233
3334void setup ()
3435{
3536 M5.begin();
36- unfiedButton .begin(&M5.Display);
37+ unifiedButton .begin(&M5.Display);
3738}
3839
3940void loop ()
4041{
4142 M5.update();
42- unfiedButton .update(); // M5.update() の後に呼ぶ事 ( 0.1.0 から後呼びに変更されました )
43+ unifiedButton .update(); // Must be call after M5.update. (Changed to call after M5.update() since 0.1.0)
4344
44- // M5.BtnX 経由で同様に状態取得
45+ // M5.BtnX can be used to obtain status
4546 if(M5.BtnA.wasHold())
4647 {
4748 // ...
@@ -51,44 +52,48 @@ void loop()
5152 // ...
5253 }
5354
54- // ボタンを描画する
55- unfiedButton .draw();
55+ // Drawing Buttons
56+ unifiedButton .draw();
5657}
5758```
59+ ## Button text font changes
60+ You can configure which fonts can be used with M5GFX.
61+ ``` cpp
62+ unifiedButton.setFont(&fonts::Font4);
63+ ```
5864
59- ## 外観変更
60-
61- begin で指定、または changeAppearance で変更できます。
65+ ## Appearance changes
66+ You can specify it with begin or change it with changeAppearance.
6267
63- | 引数 goblib::UnifiedButton::appearance\_ t| 外観 |
68+ | Argument goblib::UnifiedButton::appearance\_ t| Description |
6469| ---| ---|
65- | bottom| 画面下側にボタンを表示 (default)|
66- | top| 画面上側にボタンを表示 |
67- | custom| 独自にボタンをカスタマイズ(下記参照) |
68- | transparent\_ bottom| bottom と同様の位置に透明ボタンを配置 |
69- | transparent\_ top| top と同様の位置に透明ボタンを配置 |
70- | transparent_all| 画面全体に透明ボタンを配置(縦3分割 )|
70+ | bottom| Display buttons at the bottom of the screen (default)|
71+ | top| Display buttons at the top of the screen |
72+ | custom| Customize your own buttons |
73+ | transparent\_ bottom| Transparent buttons on the bottom of the screen |
74+ | transparent\_ top| Transparent buttons on the top of the screen |
75+ | transparent_all| Transparent buttons are placed on the entire screen (three vertical sections )|
7176
72- ## ボタンのカスタマイズ
77+ ## Customize Buttons
78+ If after specifying goblib::UnifiedButton::appearance\_ t::custom,
79+ getButtonA / getButtonB / getButtonC to get LGFX_Button\* .
7380
74- goblib::UnifiedButton::appearance\_ t::custom を指定した後であれば、
75- getButoonA / getButtonB / getButtonC で LGFX_Button\* を取得できます。
7681``` cpp
77-
7882void setup ()
7983{
8084 M5.begin();
81- unfiedButton .begin(&M5.Display, goblib::UnifiedButton::appearance_t::custom);
85+ unifiedButton .begin(&M5.Display, goblib::UnifiedButton::appearance_t::custom);
8286
83- auto btnA = unfiedButton .getButtonA();
84- auto btnB = unfiedButton .getButtonB();
85- auto btnC = unfiedButton .getButtonC();
87+ auto btnA = unifiedButton .getButtonA();
88+ auto btnB = unifiedButton .getButtonB();
89+ auto btnC = unifiedButton .getButtonC();
8690
87- // 独自形状、色、テキストのボタンを再作成
88- btnA->initButton(unfiedButton .gfx(), 40, 120, 80, 240 ,TFT_GREEN, TFT_BLUE, TFT_WHITE, "[A]");
91+ // Re-create buttons with unique shape, color, and text
92+ btnA->initButton(unifiedButton .gfx(), 40, 120, 80, 240 ,TFT_GREEN, TFT_BLUE, TFT_WHITE, "[A]");
8993 ...
9094}
9195```
9296
93- ## ドキュメント
94- [ Doxygen] ( https://www.doxygen.nl/ ) 用の[ 設定ファイル] ( doc/Doxyfile ) と[ シェルスクリプト] ( doc/doxy.sh ) で作成できます。
97+ ## Document
98+ Can be created from a [ configuration file] ( doc/Doxyfile ) and [ shell script] ( doc/doxy.sh ) for [ Doxygen] ( https://www.doxygen.nl/ ) .
99+
0 commit comments