Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriel Pettier tshirtman

View GitHub Profile
View cursor.py
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=[])
View odo.py
'''
'''
from datetime import datetime
from kivy.app import App
from kivy.lang import Builder
from kivy import properties as P
from kivy.clock import Clock
KV = '''
View t.py
from kivy.app import App
from kivy.lang import Builder
KV = '''
<BorderBoxLayout@BoxLayout,BorderGridLayout@GridLayout,CanvasButton@Label+ButtonBehavior,BorderLabel@Label>:
border_width: 1
canvas.before:
Line:
rectangle: self.pos + self.size
View recycled_checkboxes.py
from kivy.lang import Builder
from kivy.app import App
from kivy.properties import ListProperty, NumericProperty
KV = '''
#:import RGBA kivy.utils.rgba
<Row@BoxLayout>:
text: ''
rv_key: 0
View ScalableImageDemo.py
from kivy.app import App
from kivy.lang.builder import Builder
from kivy.uix.scatterlayout import ScatterLayout
from kivy.uix.image import AsyncImage
from kivy.properties import NumericProperty, ListProperty, StringProperty
from kivy.core.window import Window
from kivy.clock import Clock
from kivy.vector import Vector
from kivy.graphics.transformation import Matrix
from kivy import platform
View test_blur.py
from kivy.clock import Clock
from kivy.app import App
from kivy.animation import Animation
from kivy.uix.widget import Widget
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.graphics import RenderContext
from kivy.uix.modalview import ModalView
from kivy.properties import ListProperty, NumericProperty, ObjectProperty, ColorProperty
View odds.py
from random import choice
from decimal import Decimal
stats = [0] * 100
def advance(n, f):
return n * (1+f)
def backoff(n, f):
View 2021_09_21.glsl
$HEADER$
float pi = 3.1415926535;
uniform vec2 resolution;
uniform float time;
vec2 rotate(vec2 pos, float angle, vec2 origin) {
pos -= origin;
pos *= mat2(cos(angle), sin(-angle), sin(angle), cos(angle));
View unnamed.glsl
$HEADER$
float PI = 3.1415926535;
uniform vec2 resolution;
uniform float time;
vec2 rotate(vec2 pos, float angle, vec2 center){
pos -= center;
pos *= mat2(cos(angle), sin(-angle), sin(angle), cos(angle));
pos += center;
View glsl_viewer.py
#!/usr/bin/env python
'''
GLSLiewer
=======
GlslViewer, for KV-Viewer, is a simple tool allowing you to dynamically display
a GLSL file, taking its changes into account (thanks to watchdog).
You can use the script as follows::