vpythonpydroid

Change button size in vpython on Pydroid


I have the following code in Pydroid. I creates 3D text in Python on Android. I need to make the button bigger.

import asyncio
from vpython import *

scene = canvas()

scene.width = 1600
scene.height = 1600

text(text = "Hello World", align = "center")

def capture_scene():
    img = scene.capture("image")

button(bind=capture_scene, text='Download')

asyncio.get_event_loop().run_forever()

Solution

  • This is what worked for me. Instead of trying to change the button and its font. I discovered that I could inject html in the button text.

    button(bind=capture_scene, text="""<span style="font-size: 63px;"><h1 style="display: inline-block;margin:0;padding:23px;">Download</h1></span>""")