Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriel Pettier tshirtman

View GitHub Profile
View nested_scrollviews.py
'''
'''
from kivy.app import App
from kivy.lang import Builder
KV = '''
#:import choices random.choices
#:import printable string.printable
View test_crop.py
'''Demonstrate showing a cropped image using get_region
Drop any image supported by kivy on the window and play with the sliders
'''
from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
from kivy import properties as P
View test_theme.py
'''Theme object example
'''
from kivy.app import App
from kivy.lang import Builder
from kivy import properties as P
from kivy.lang.parser import global_idmap
from kivy.event import EventDispatcher
KV = '''
View test.py
'''Simulate a specific device that is not in kivy's screen module
'''
width = 1480
height = 720
dpi = 274
density = 1
scale = .5
portrait = True
if portrait:
View time_graph_sorted.py
from random import randint
from datetime import datetime, timedelta
from math import log10, ceil
from kivy.app import App
from kivy.animation import Animation
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.factory import Factory
from kivy import properties as P
@tshirtman
tshirtman / test_h_sv.py
Created Jul 28, 2020
horizontal scrolling label
View test_h_sv.py
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory
KV = '''
ScrollView:
Label:
text: "SUPERCALIFRAGILISTICEXPIALIDOCIOUS"
size_hint_x: None
View fbowidget.py
'''
FBO example
===========
This is an example of how to use FBO (Frame Buffer Object) to speedup graphics.
An Fbo is like a texture that you can draw on it.
By default, all the children are added in the canvas of the parent.
When you are displaying thousand of widget, you'll do thousands of graphics
instructions each frame.
View effect_widget_for_fbo.py
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory
KV = '''
FloatLayout:
EffectWidget:
id: eff
BoxLayout:
@tshirtman
tshirtman / test.py
Created Jun 7, 2020
showing the usage of - before a property rule
View test.py
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory
from kivy import properties as P
KV = '''
<CustomLabel@Label>:
font_size: app.font_size1
View test_tp.py
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory
KV = '''
<Item@TabbedPanelItem>:
BoxLayout:
Label:
text: "it's me {}".format(root.text)
You can’t perform that action at this time.