Skip to content

Instantly share code, notes, and snippets.

View gottadiveintopython's full-sized avatar

水戸う納豆齋(Nattōsai Mitō) gottadiveintopython

View GitHub Profile
@gottadiveintopython
gottadiveintopython / test_magnet.py
Created October 23, 2017 07:06
kivy.garden.magnet test
import random
from kivy.base import runTouchApp
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.properties import ListProperty
import kivy.utils
from kivy.garden.magnet import Magnet
@gottadiveintopython
gottadiveintopython / recycleview_example_modified.py
Created November 15, 2017 11:12
recycleviewの内部動作検証
from random import sample
from string import ascii_lowercase
from kivy.config import Config
Config.set('modules', 'inspector', '')
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.factory import Factory
@gottadiveintopython
gottadiveintopython / simple_gradient_fill.py
Created April 6, 2018 16:10
simple gradient fill (GLSL, Kivy)
from kivy.app import runTouchApp
from kivy.core.window import Window
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.graphics import RenderContext
from kivy.properties import StringProperty
Builder.load_string(r'''
<ShaderWidget>:
@gottadiveintopython
gottadiveintopython / slide_in_menu.py
Last active September 30, 2018 02:59
slide in menu. old code. (Kivy)
# -*- coding: utf-8 -*-
import kivy
kivy.require('1.9.1')
from kivy.base import runTouchApp
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.animation import Animation
Builder.load_string(r'''
@gottadiveintopython
gottadiveintopython / main.py
Last active April 29, 2021 21:17
My first time 3D graphics on Kivy
from kivy.base import EventLoop, runTouchApp
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.graphics import RenderContext
from kivy.properties import NumericProperty
from kivy.graphics.transformation import Matrix
from kivy.clock import Clock
EventLoop.ensure_window()
@gottadiveintopython
gottadiveintopython / android.txt
Last active August 1, 2018 22:23
pause resume test
title=pause resume test
author=GottaDiveIntoPython
orientation=sensor
@gottadiveintopython
gottadiveintopython / main.py
Last active July 8, 2018 20:20
OpenGL contextの消失への対応(WIP)
from __future__ import print_function
from kivy.config import Config
Config.set('kivy', 'pause_on_minimize', 1)
# Config.set('graphics', 'fullscreen', 1)
from kivy.app import App
from kivy.factory import Factory
from kivy.graphics.texture import Texture
import kivy.core.window
from sys import stderr
@gottadiveintopython
gottadiveintopython / main.py
Last active October 8, 2018 00:03
A situation that 'Animation._instances' keeps getting fat.
# This script shows you a situation that 'Animation._instances' keeps getting
# fat. I'm not sure this should be fixed or not.
import gc
from kivy.animation import Animation
from kivy.app import runTouchApp
from kivy.uix.widget import Widget
from kivy.clock import Clock
@gottadiveintopython
gottadiveintopython / main.py
Created October 8, 2018 00:53
'Sequence.stop_property()' doesn't affect to the next part of the animation
# case A ... 'stop_property()' affects to the next part of the animation
# case B ... 'stop_property()' doesn't affect to the next part of the animation
#
# This behavior confuses users.
from kivy.animation import Animation
from kivy.app import runTouchApp
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.clock import Clock
@gottadiveintopython
gottadiveintopython / part1(fail).py
Last active October 10, 2018 06:45
あえてpos_hintを使わずに中央揃えを試みる
from kivy.config import Config
Config.set('graphics', 'width', 400)
Config.set('graphics', 'height', 300)
from kivy.app import runTouchApp
from kivy.lang import Builder
runTouchApp(Builder.load_string('''
FloatLayout:
Button:
text: 'Kivy'