Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Solved
    • Unsolved
    • Search
    1. Home
    2. eduairet
    3. Best
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by eduairet

    • Vertical Align

      I'm looking for a property to work with textBox() to align the text to the vertical center. What I'm imagining is something like this:

      textBox(
          'DrawBot is great',
          (
              width()*0.2,
              height()*0.2,
              width()*0.6,
              height()*0.6
          ),
          align = 'center',
          verticalAlign = 'center'
      )
      

      This way you can come up with a random playing with that verticalAlign or something like that 😊

      posted in Feature Requests
      eduairet
      eduairet
    • Unknown Pleasures Tutorial

      Hey there I was playing trying to recreate the Unknown Pleasures cover art, and this is the result if you've ever done it before I would love to see how did you solve it.

      Cheers!!

      # Tribute for Joy Division's Unknown Pleasures album cover
      
      side = 1080
      
      def lsPts(num):
          points = []
          m = side*0.3
          for i in range(0, side, 12):
              if i <= side*0.2:
                  x = i
                  y = sin((i*(randint(1, 3))))
                  points.append((x, y))
              if i > side*0.2 and i <= side*0.4:
                  x = i
                  y = i*sin(radians(i*(randint(-100, 100))))/(10**1)
                  if y < 0:
                      points.append((x, y * -1))
                  else:
                      points.append((x, y))
              if i > side*0.4 and i <= side*0.6:
                  x = i
                  y = m*sin(radians(m*(randint(-100, 100))))/(10**1)
                  if y < 0:
                      points.append((x, y * -1))
                  else:
                      points.append((x, y))
                  m -= 1
              if i > side*0.6 and i <= side*0.8:
                  x = i
                  y = sin((i*(randint(1, 3))))
                  points.append((x, y))
          return points
      
      def lineGrid(steps):
          for j in range(steps):
              newPage(side, side)
              fill(0)
              rect(0, 0, side, side)
              m = 0
              for i in range(int(side*0.8/13.5)):
                  points = lsPts(1)
                  fill(None)
                  stroke(1)
                  strokeWidth(1)
                  path = BezierPath()
                  with savedState():
                      translate(side*0.1, side*0.1 + m)
                      path.moveTo((0, 0))
                      path.curveTo(*points)
                      drawPath(path)
                  m += 13.5
      
      for i in range(12):
          lineGrid(i)
      
      saveImage('~/Desktop/unknown_pleasures.gif')
      
      posted in Tutorials
      eduairet
      eduairet