> For the complete documentation index, see [llms.txt](https://gilmour.online/compsci/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gilmour.online/compsci/robotics-8/kivy-basics.md).

# Kivy Basics

## Kivy Video Overviews

{% embed url="<https://youtu.be/kUDXXhJ4Bn4>" %}

{% embed url="<https://youtu.be/JCiaJqM4o_w>" %}

##

```
// Basic Kivy Code (main.py)
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout

class Interface(BoxLayout):
    pass
    
class LayoutApp(App):
    pass
    
LayoutApp().run()
```

##

## Widgets

Kivy uses widgets as the basic building block for GUIs (Graphical User Interfaces). Widgets are objects which can be layed out on your screen and which perform specific tasks. Some examples are input fields, buttons and drop down menus. In this section, you will find an example of widgets we will use in the class as well as specific parameters which can control individual widgets. If you feel like digging deeper into your options, [the kivy documentation can be found here.](https://kivy.org/doc/stable/guide/widgets.html)

### Label

The label widget is used to create text on your screen.

* **text: "Hello World"**
  * *Displays "Hello World" on the interface*
* **color: 1, 0, 0, 1**
  * *Color takes 4 numbers from 0 - 1. These correspond to RGB and Alpha*
* **font\_size: 32**
  * *Sets the font to 32 pt*
* ***markup: True***
  * *Allows you to add markups such as bold, italics, font in your text*
  * *\[b] Bold \[/b], \[i] italics\[/i], \[font=times] Change the font to times \[/font]*
  * *\[s] strikethrough \[/s], \[u] underline \[/u], \[color=#hexcolor] change color \[/color]*
* **size\_hint: 0.5, 0.5**
  * *changes the size of the text box in relation to horizontal width of the window and vertical height of the window.*
* ***size: 200, 200***
  * *Changes the size of the text BOX, not the text.*

***

### Button

***

### TextInput


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gilmour.online/compsci/robotics-8/kivy-basics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
