Exemple #1
0
def setup():
    ratio = 1.8
    pf.size(1280 / ratio, 720 / ratio)
    pf.text_font(font)
    pf.text_size(50)
    pf.no_stroke()
    pf.no_loop()
Exemple #2
0
def setup():
    if verbose:
        print(f"Setting up.")
    if fn_img:
        furthest_element = img.height
        size(img.width, img.height)
    else:
        furthest_element = df.location.str.get('y').max()
        furthest_element_height = df[df.location.str.get(
            'y') == furthest_element].dimensions.str.get('height').tolist()[0]
        length = int(furthest_element_height + furthest_element + 10)
        size(375, length)
    if verbose:
        print(f"Length of canvas is {furthest_element} px.")
    no_loop()
Exemple #3
0
def draw():
    # sayac değikenini düzenlemek için global
    global sayac
    # Eğer ilk framede isek, arka planı siyah yap
    if sayac == 0:
        p5.background(p5.Color(0, 0, 0))

    # isimlerin sayacinci elemanını al
    isim = isimler[sayac]

    # 0, 0 noktasını ekranın sol üst köşesine taşı (resetleme)
    p5.reset_matrix()
    # 0, 0 noktasını ekranın x ekseninnde orta, y ekseninde alt tarafa taşı
    p5.translate(1920 / 2, 1080 - 50)

    # isim deki her harf için döngü başlat
    for harf in isim:
        # harfın ascii değerine bak.
        if ord(harf) % 2:
            # Çift ise pozitif yönde aci kadar dön
            p5.rotate(aci)
        else:
            # Tek ise negatif yönde aci kadar dön
            p5.rotate(-aci)

        # 0, 0'dan y yönünde uzunluk kadar br çizgi çiz
        p5.line(p5.Vector(0, 0), p5.Vector(0, -uzuluk))
        # 0, 0 noktasını çizilen çizginin son noktasına taşı
        p5.translate(0, -uzuluk)

    # Eğer sayac isimlerin uzunluğundan bir eksik ise
    if sayac == len(isimler) - 1:
        # Bitti yaz ve p5, döngüsünü durdur
        print("Bitti")
        p5.no_loop()
    else:
        # değilse, sayac'ı bir arttır
        sayac += 1
Exemple #4
0
 def setup(self):
     p5.size(self.window_width, self.window_height)
     p5.background(0)
     p5.no_loop()
def draw():
    p5.no_loop()
Exemple #6
0
def draw():
    p5.background(0)
    p5.no_loop()
Exemple #7
0
def setup():
    p.size(width, height)
    p.color_mode('HSB')
    p.no_stroke()
    p.no_loop()
Exemple #8
0
def setup():
    ratio = 1.8
    pf.size(1280/ratio,720/ratio)
    pf.text_font(font)
    pf.title("Patato")
    pf.no_loop()
Exemple #9
0
def setup():
    p.size(width, height)
    p.no_stroke()
    p.no_loop()
Exemple #10
0
def setup():
    # pass
    ratio = 1
    pf.size(1280 / ratio, 720 / ratio)
    pf.title("Patato")
    pf.no_loop()