kivy

On Hover for Kivy ActionBar ActionButton

邮差的信 提交于 2020-04-30 06:35:06
问题 According to This Github File, I was trying to create a hover for an action button in python 3.7.5 windows 10 platform. This is what i tried: from kivy.app import App from kivy.uix.widget import Widget from kivy.base import runTouchApp from kivy.lang import Builder from kivy.uix.label import Label from kivy.core.window import Window from kivy.uix.floatlayout import FloatLayout from kivy.uix.actionbar import * from kivy.properties import ObjectProperty from kivy.properties import

kivy image button size

…衆ロ難τιáo~ 提交于 2020-04-21 05:31:17
问题 My goal is to have Buttons which are completely filled with an image. My screen is split in half. On the right hand side I would like to have nine buttons each completely filled with a different image, all buttons with same dimensions. I would like to reshape those image to fit the button, so the ratio would possibly have to change. This is how my GUI looks right now. The images do not fit the buttons I tried several adjustments in my kv file, but right now I am stuck. This is my kv file.

Position of The Kivy Label

蓝咒 提交于 2020-04-18 05:34:11
问题 In the same experiment, I tried to positionize a Label using this code: class TetraApp(App): def build(self): Window.size=(875,600) Window.clearcolor = (1, 1, 1, 1) b = BoxLayout(orientation ='vertical') #Here, the pos and pos hint doesnt seem to work for small values self.lab=Label(text="How Can I Help\n You?", font_size='35',color =[0, 0, 0, 1],font_name='VarelaRound-Regular',pos=[0.1,0.01],pos_hint={'x': 0.005, 'y': 0}) self.t = TextInput(hint_text='Say Something...', size_hint=(1,0.25),

How to Assign the Kivy Input Text to a variable immediately on pressing Enter?

半腔热情 提交于 2020-04-16 03:15:43
问题 I'm trying to create a user-interface for a personal assistant. I want the user to input a text and when he presses enter,i want to do something(' say print a text') and also automatically clear the input field. This is my code: from kivy.app import App from kivy.uix.widget import Widget from kivy.lang import Builder from kivy.core.window import Window from kivy.uix.floatlayout import FloatLayout from kivy.properties import ObjectProperty from kivy.uix.textinput import TextInput from kivy.uix

kivy buildozer VM

大憨熊 提交于 2020-04-08 15:11:55
问题 I tried to compile kivy with buildozer for android, but it did not work and I could not find the solution for this problem. So I tried to install the virtual machine from the kivy webside, which is supposed to include this, from this link: http://kivy.org/#download But I could not find a .vdi file,and so I wanted to know how I can find this .vdi file and how to install the vm. 回答1: EDIT: these instructions are outdated, please don't follow them The main points: Download the disc image from

kivy buildozer VM

回眸只為那壹抹淺笑 提交于 2020-04-08 15:10:30
问题 I tried to compile kivy with buildozer for android, but it did not work and I could not find the solution for this problem. So I tried to install the virtual machine from the kivy webside, which is supposed to include this, from this link: http://kivy.org/#download But I could not find a .vdi file,and so I wanted to know how I can find this .vdi file and how to install the vm. 回答1: EDIT: these instructions are outdated, please don't follow them The main points: Download the disc image from

kivy buildozer VM

百般思念 提交于 2020-04-08 15:09:18
问题 I tried to compile kivy with buildozer for android, but it did not work and I could not find the solution for this problem. So I tried to install the virtual machine from the kivy webside, which is supposed to include this, from this link: http://kivy.org/#download But I could not find a .vdi file,and so I wanted to know how I can find this .vdi file and how to install the vm. 回答1: EDIT: these instructions are outdated, please don't follow them The main points: Download the disc image from

Instantiate data class from dropdown menu options using on_touch_up

情到浓时终转凉″ 提交于 2020-03-25 12:31:09
问题 I would like to populate MyData with information gathered from dropdown menus that show up in a popup window with "on_touch_up" in AddTouch. That data includes the position of "on_touch_up", in addition to the dropdown data. I am able to print the position within the AddTouch class, but I am having a hard time getting the data further down in my script using (for example: print('from MyMainApp: {}'.format(MyData.pos))). I am also unable to get "mainbutton" or "dropdown" to show up in a popup

[Python 应用:Android App] Hello World App 之Kivy 介绍以及基本配置

梦想与她 提交于 2020-03-24 03:48:42
1. Kivy 是什么?     简单的说就是一个开源的库,这个库可以用来开发各种App。    https://kivy.org/#home 2. Kivy能做什么?    3. 用Python写一个安卓app的基本流程     一:当然是下载安装Python    二:确保安装的Python具备最新的 【 pip wheel setuptools virtualenv 】等模块。      如果没有或者不是最新的到【 https://pypi.org/ 】下载最新的库安装。    三:下载并安装kivy的依赖库     【 docutils pygments pypiwin32 kivy_deps . sdl2 == 0.1 . 22 kivy_deps . glew == 0.1 . 12 kivy_deps . gstreamer == 0.1 . 17 】,      版本则需要根据自己的Python版本对应下载(直接pip在线安装较慢的话,可以使用IDM下载工具下载)    四:安装Kivy,直接pip的方式安装或者下载到本地安装都没有问题。    五: 确认电脑CPU已经开启虚拟化支持,否则可能会导入kivy失败;    六 :Python console 里面 import kivy 试下,确定Kivy及其支持库都安装成功,      将官网的 例子

5类与对象:kivy库

女生的网名这么多〃 提交于 2020-03-17 01:57:37
文章目录 面向对象编程 定义类 在类内部调用自己的东西 类的初始化(构造函数) Kivy 安装 手机端 电脑端 开始 第一个kivy应用 事件 坐标系 绘画 kivy的颜色 完成kivy版贪吃蛇 kivy版贪吃蛇完整代码 接下来我们会使用一个跨平台库:kivy。这个库的厉害之处在于同样的代码可以直接运行在手机和电脑上。所以这一节会同时在手机和电脑上实现贪吃蛇游戏。 想想看,随手掏出个手机就可以愉快的做游戏了,简直美滋滋。但为了真的能够愉快,我们还要学习一些新东西。 面向对象编程 如果你还没有对象,现在赶紧去找一个 对象,听起来是个有血有肉的实体。想想看那么多人追求纸片人老婆,有血有肉这一条也不怎么重要了,但必须是切实存在的实体。 定义类 Python有提供这种“切实存在实体”的关键字: class 。 试一试: class Dog : name = "狗" breed = "中华田园犬" #品种 def Say ( self ) : print ( "汪汪!" ) 看起来 class 就是变量和函数的容器,这就是 类 的定义。不同的是类的函数定义 def Say(self): 中有一个参数 self ,当外部调用类的函数时会默认传入一个参数,所以定义类的函数时总要写个参数接收。 像函数的定义一样,只定义不执行,它就像是一个架子,还没有灵魂,需要继续这样操作: oneDog =