CRxTRDude
Member
The title says it all. Apparently, uTunnels implemented a configuration text file for use of his Android build called 'touch.txt'. Like the text files we modders commonly edit, touch.txt can also be commented for ease of navigation and stuff.
You can place the touch.txt on either your save folder (/mnt/sdcard/OpenBOR/saves) or if you plan on including it on your pak, you can place it on your data folder of your mod prior to pak-ing it.
Here's the three syntax that touch.txt can detect:
buttons {x} {y} {size} {placement}
surface {path}
screendocking {value}
Tip:
That's all there is to it for touch.txt.
For now I have a zip file template for android porting:
touch.zip - 10.25 KB
The zip file contains the old buttons that was used by uTunnels from his previous commit from the source code. This can be used as a template for your buttons. The zip also has a touch.txt set on a configuration similar to what bWWd had but includes the screenshot and directional buttons configured as well the attack button enlarged a bit.
Thanks for bWWd for pointing this out!
EDIT: This is now available on the OpenBOR Wiki.
You can place the touch.txt on either your save folder (/mnt/sdcard/OpenBOR/saves) or if you plan on including it on your pak, you can place it on your data folder of your mod prior to pak-ing it.
Here's the three syntax that touch.txt can detect:
buttons {x} {y} {size} {placement}
- This is what we usually modify in touch.txt. This controls the placement of the on screen touch buttons.
- Firstly, placement defines what corner do we place the button. For a diagram, here's what uTunnels created in the source code:
0 1
3 2
- The reason why I explain placement first is because {x} and {y} are relative to {placement}. For example, if placement is defined 2, then {x} goes from right to left and {y} goes from down to up.
- X's range is 0.0 to 1.80 while Y's range is 0.0 to 1.0 (since the screen size is 9:5)
- You can adjust size of the button by using {size}. Default is 0.08, which is the comfortable size. I tested using 1.0 and it's gigantic.

surface {path}
- You can define your button's appearance using this. The path is relative to the OpenBOR folder path. If you plan to include it to your mod, you should point your touch.txt to point at the data folder. Example:
surface data\yourbutton.png
- The button should be in PNG and you need to follow the button template included in the tutorial zip.
screendocking {value}
- Screendocking, according to uTunnels' source, is "[changing] screen position to avoid buttons". This is optional since the buttons are already transparent, but you can place it anyway.
- Accepted values are left, right, top and bottom
Tip:
- If you want to hide a button, you can make the x and y go -99. Not placing graphics on the respective button might hide it, but it can still be detected when pressed.
- If you want to center a button, say the screenshot button, you can use x=0.90 and y=0.5
That's all there is to it for touch.txt.
For now I have a zip file template for android porting:
touch.zip - 10.25 KB
The zip file contains the old buttons that was used by uTunnels from his previous commit from the source code. This can be used as a template for your buttons. The zip also has a touch.txt set on a configuration similar to what bWWd had but includes the screenshot and directional buttons configured as well the attack button enlarged a bit.
Thanks for bWWd for pointing this out!
EDIT: This is now available on the OpenBOR Wiki.