<commit_before>from browser import window, document
from javascript import JSObject, JSConstructor


# depends on pixi.js, buzz.js



class Frame(object):


    def __init__(self, app, x, y, w, h):
        self.app = app
        self.x = x
        self.y = y
        self.w = w
        self.h = h
        self.PIXI = app.PIXI_Rectangle(x,y,w,h)
    
    @property
    def center(self):
        return (self.x + self.w//2, self.y + self.h//2)
    
    @center.setter
    def center(self, value):
        c = self.center
        self.x += value[0] - c[0]
        self.y += value[1] - c[1]

        
class ImageAsset(object):

    def __init__(self, app, url):
        self.url = url
        self.PIXI = app.PIXI_Texture_fromImage(url, False)

class Sprite(object):
    
    
    def __init__(self, asset, position = (0,0), frame = False):
        self.asset = asset
        if (frame):
            self.PIXI = self.asset.app.PIXI_Sprite(
                self.asset.app.PIXI_Texture(asset.PIXI, frame.PIXI))
        else:
            self.PIXI = self.asset.app.PIXI_Sprite(asset.PIXI)
        self.position = position
        self.asset.app._add(self)
        
    @property
    def x(self):
        return self.PIXI.position.x
        
    @x.setter
    def x(self, value):
        self.PIXI.position.x = value
        
    @property<commit_msg>Updated from Brython Server: 7/29/2015 2:24:34 PM<commit_after>from browser import window, document
from javascript import JSObject, JSConstructor


# depends on pixi.js, buzz.js



class Frame(object):


    def __init__(self, app, x, y, w, h):
        self.app = app
        self.x = x
        self.y = y
        self.w = w
        self.h = h
        self.PIXI = app.PIXI_Rectangle(x,y,w,h)
    
    @property
    def center(self):
        return (self.x + self.w//2, self.y + self.h//2)
    
    @center.setter
    def center(self, value):
        c = self.center
        self.x += value[0] - c[0]
        self.y += value[1] - c[1]

        
class ImageAsset(object):

    def __init__(self, app, url):
        self.app = app
        self.url = url
        self.PIXI = self.app.PIXI_Texture_fromImage(url, False)

class Sprite(object):
    
    
    def __init__(self, asset, position = (0,0), frame = False):
        self.asset = asset
        if (frame):
            self.PIXI = self.asset.app.PIXI_Sprite(
                self.asset.app.PIXI_Texture(asset.PIXI, frame.PIXI))
        else:
            self.PIXI = self.asset.app.PIXI_Sprite(asset.PIXI)
        self.position = position
        self.asset.app._add(self)
        
    @property
    def x(self):
        return self.PIXI.position.x
        
    @x.setter
    def x(self, value):
        self.PIXI.position.x = value
        
    @property
{'fraction_non_alphanumeric': 0.12145454545454545, 'fraction_numerical': 0.010181818181818183, 'mean_word_length': 1.795731707317073, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '28038', 'n_tokens_mistral': 990, 'n_tokens_neox': 935, 'n_words': 209}