Hello everyone. I thought I would share a small tweet button I made using the web browser module and the scene module. I did this because we currently can't use the Twitter module. Hope you guys enjoy this and get good use out of it!

from scene import *
import webbrowser

class MyScene(Scene):
    def setup(self):
        self.x = self.size.w * 0
        self.y = self.size.h * 0

    def draw(self):
        background(0.00, 0.00, 0.00)

        fill(0.40, 0.80, 1.00) # button color

        if self.size.w > self.size.h: # button landscape
            self.tweetpx, self.tweetpy = (320, 350)
            self.tweetsx, self.tweetsy = (358, 100)
            rect(self.tweetpx, self.tweetpy, self.tweetsx, self.tweetsy)

        if self.size.h > self.size.w: # button portrait
            self.tweetpx, self.tweetpy = (200, 600)
            self.tweetsx, self.tweetsy = (358, 100)
            rect(self.tweetpx, self.tweetpy, self.tweetsx, self.tweetsy)

        tint(1.00, 1.00, 1.00) # text color

        if self.size.w > self.size.h: # text landscape
            text('Tweet Tweet', font_name='ArialRoundedMTBold', font_size=55.0, x=500.0, y=400.0)
        if self.size.h > self.size.w: # text portrait
            text('Tweet Tweet', font_name='ArialRoundedMTBold', font_size=55.0, x=380.0, y=650.0)

    def check(self, x, y, posx, posy, sizex, sizey):
        if x >= posx and x <= posx + sizex:
            if y >= posy and y <= posy + sizey:
                return True
        return False

    def check_tweet(self, x, y):
        return self.check(x, y, self.tweetpx, self.tweetpy,self.tweetsx ,self.tweetsy)

    def touch_ended(self, touch):
        x, y = touch.location
        if self.check_tweet(x, y): webbrowser.open('twitter://post?message=Hello%20world!')
        else: pass

run(MyScene())