Skip to content

Instantly share code, notes, and snippets.

View tshirtman's full-sized avatar

Gabriel Pettier tshirtman

View GitHub Profile
@tshirtman
tshirtman / nodes.py
Last active April 14, 2023 18:02
A really simple example of free node manipulations in kivy with a bezier line in between.
from kivy.lang import Builder
from kivy.app import App
KV = '''
<Node@Scatter>:
# do_scale: False
# do_rotation: False
size_hint: None, None
size: 200, 100
color: [0, 0, 0, 1]
@tshirtman
tshirtman / key_down.py
Created June 7, 2015 11:15
simplest key binding demo with kivy
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.core.window import Window
class KeyDown(App):
def build(self):
Window.bind(on_key_down=self.key_action)
return Widget()
@tshirtman
tshirtman / text_vertical.py
Created August 13, 2013 16:21
Show how to use either a Scatter or the Rotate instruction to make a widget (here, a Label), rotate around its center, still being correctly centered
from kivy.app import App
from kivy.properties import NumericProperty
from kivy.lang import Builder
from kivy.clock import Clock
kv = """
BoxLayout:
Widget:
Scatter:
center: self.parent.center
@tshirtman
tshirtman / mah_button.py
Created September 30, 2013 17:42
usage demonstration of ids, dynamic classes/Factory, and doing a default binding using them, plus ScreenManager
'''
Little demonstration of various kivy useful features:
- loading kv code
- adding dynamic parts to static parts using ids
- dynamic classes
- getting a reference to a Dynamic classes using Factory
- binding events to python expressions on kv side
useful references:
- http://kivy.org/docs/guide/lang.html#referencing-widgets
#!/usr/bin/env bash
echo '--------------------------------------------------------------- '
echo ' Xperia 2011 ICS Easy Rooting toolkit (v1.0) '
echo ' created by DooMLoRD '
echo ' linux conversion by tshirtman '
echo ' "andorid emulator" trick '
echo ' Credits go to all those involved in making this possible! '
echo '--------------------------------------------------------------- '
echo ' [*] This script will: '
echo ' (1) root ur device using "andorid emulator" trick '
from kivy.app import App
from kivy.factory import Factory as F
from kivy.core.window import Window as W
class CrossHairCursorApp(App):
def build(self):
root = F.Widget()
with root.canvas.after:
self.v_line = F.Line(points=[])
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ListProperty, StringProperty, NumericProperty
from kivy.graphics import Mesh
from kivy.core.window import Window
from kivy.core.image import Image
from math import sin, cos, pi
texture_tree = Image('texture_tree.png').texture
@tshirtman
tshirtman / dndm.py
Created November 2, 2013 19:55
Drag'n drop example between a gridlayout and a floatlayout, using magnet for nicer animations
from kivy.app import App
from kivy.garden.magnet import Magnet
from kivy.uix.image import Image
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from os import listdir
IMAGEDIR = '/usr/share/icons/hicolor/32x32/apps/'
@tshirtman
tshirtman / radial_shader.py
Last active June 16, 2022 02:12
Radial gradient shader demo
'''
radial gradient in glsl
'''
from kivy.app import App
from kivy.graphics import RenderContext, Rectangle
from kivy.uix.widget import Widget
from kivy.properties import ListProperty
from kivy.clock import Clock
from kivy.animation import Animation
from kivy.uix.gridlayout import GridLayout
'''
line instruction in shadder
'''
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.clock import Clock
from kivy.properties import ListProperty, NumericProperty, ObjectProperty
from kivy.core.window import Window
from kivy.graphics import RenderContext, Rectangle, Color
from random import random