> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
