This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from collections import defaultdict | |
import re | |
class AsaiMaps(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ui | |
def closepage(sender): | |
v.close() | |
def function_1(sender): | |
v['label1'].text = 'Oh! You clicked my button.' | |
#uncomment or comment lines below based on platform | |
#v = ui.MainView(frame=(0, 0, 600, 450)) # kivy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l = [[[[(265.0, -15.0), (348.0, -15.0), (405.0, 38.0), (438.0, 100.0)], | |
[(438.0, 100.0), (438.0, 0.0)], | |
[(438.0, 0.0), (488.0, 0.0)], | |
[(488.0, 0.0), (488.0, 460.0)], | |
[(488.0, 460.0), (438.0, 460.0)], | |
[(438.0, 460.0), (438.0, 362.0)], | |
[(438.0, 362.0), (406.0, 422.0), (350.0, 470.0), (265.0, 470.0)], | |
[(265.0, 470.0), (162.0, 470.0), (59.0, 388.0), (59.0, 226.0)], | |
[(59.0, 226.0), (59.0, 60.0), (168.0, -15.0), (265.0, -15.0)]], | |
[[(265.0, 31.0), (169.0, 31.0), (109.0, 116.0), (109.0, 225.0)], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from objc_util import * | |
import ui | |
import math | |
load_framework('SceneKit') | |
SCNView, SCNScene, SCNBox ,SCNNode, SCNMaterial, SCNCamera, SCNLookAtConstraint , SCNLight, SCNPlane= map(ObjCClass, ['SCNView', 'SCNScene', 'SCNBox' ,'SCNNode', 'SCNMaterial', 'SCNCamera', 'SCNLookAtConstraint', 'SCNLight', 'SCNPlane']) | |
class SCNVector3 (Structure): | |
_fields_ = [('x', c_float), ('y', c_float), ('z', c_float)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ui | |
import sys | |
class TextViewFile(object): | |
def __init__(self, textview): | |
self.textview = textview | |
def write(self, msg): | |
self.textview.text += msg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# code from https://github.com/controversial/ui2/blob/master/ui2/animate.py | |
# code modified for bug in https://forum.omz-software.com/topic/3504/lab-ui-animate-sliding-in-views | |
from copy import copy | |
from objc_util import * | |
# Constants representing easings. See http://apple.co/29FOF5i | |
ANIMATE_EASE_IN = 1 << 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ui | |
images = [ui.Image.named(i) for i in 'Rabbit_Face|Mouse_Face|Cat_Face|Dog_Face|Octopus|Cow_Face'.split('|')] | |
def button_action(sender): | |
def animation(): | |
cv = sender.superview['view1'].subviews[0] | |
w = sender.superview['view1'].width | |
if sender.title == '>': | |
if cv.x > (-(len(images)-1)*w): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scene | |
import ui | |
""" | |
Carwash example. | |
Covers: | |
- Waiting for other processes | |
- Resources: Resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scene | |
import copy | |
import math | |
import ui | |
class Paddle(scene.ShapeNode): | |
def __init__(self, x, y, parent=None): | |
path = ui.Path.rect(0,0, 40, 200) | |
super(Paddle, self).__init__(path, position=(x, y), fill_color='green', parent=parent) | |
self.touch = None |
NewerOlder