Skip to content

Instantly share code, notes, and snippets.

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
View animating_gif_in_pythonista_scene
# coding: utf-8
import scene
import ui
from PIL import Image as PILImage
class MyScene (scene.Scene):
def setup(self): ='tunnelswirl.gif')
self.mypalette =
self.savefile = 'tmp.png'
View Generating .pyui file from the file created using embed pyui script
# Sharing pyui file is simplified by the following omz's script.
# This may be good enough if users just want to run the script.
# But if they want to see or edit the .pyui file, it would be helpful
# to generate the .pyui file. This script does this geneartion.
# This script extracts the encoded string, decode it and
# generate the .pyui file. Like the embedpyui script,
# this needs to be added to editor actions (wrench) menu.
View pythonista_cc_mandelbrot_shader
import scene, ui
shadercode_text = '''
// Modified Mandelbrot code from
// used make_color function from ccc (pythonista forum)
precision highp float;
varying vec2 v_tex_coord;