Drawing paths??

Home Forums General Programming Drawing paths??

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #5279
    dasfaker
    Keymaster
      • Topics: 80
      • Replies: 793
      • Total: 873
      • ★★★

      Hi Atom

      I’m interested in drawing paths. I’ve been looking at rawmaterialsoftware API and I think I got it, but I’m fighting with this:
      strokePath (const Path &path, const PathStrokeType &strokeType, const AffineTransform &transform=AffineTransform::identity) const

      Can you make a little example?

      #5293
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★
        drawPanelBg = function(canvas,g)
        	g:fillAll (Colour(0xff0000ff))
        	path		= Path()
        	stroke 		= PathStrokeType(2.0, PathStrokeType.curved, PathStrokeType.rounded)
        	transform	= AffineTransform()
        	path:addRectangle (0, 50, 100, 100)
        	path:addStar (Point (100.0, 0.0), 7, 30.0, 70.0, 0.1)
        	path:addStar (Point (0.0, 100.0), 6, 40.0, 70.0, 0.1)
         	path:addEllipse (0.0, 0.0, 120.0, 90.0)
        	g:strokePath (path, stroke, transform)
        end
        
        #5301
        dasfaker
        Keymaster
          • Topics: 80
          • Replies: 793
          • Total: 873
          • ★★★

          Many thanks

          You give us a new toy to play with.

          #5302
          atom
          Keymaster
            • Topics: 159
            • Replies: 2945
            • Total: 3104
            • ★★★★★

            Yeah but i need to bind more classes to make it fully functional. Image handling would be a good idea, some drawables, SVG format for vector graphics (other image format too ofcourse). It’s all to come, it just takes time.

            #5311
            dasfaker
            Keymaster
              • Topics: 80
              • Replies: 793
              • Total: 873
              • ★★★

              By now I just want to draw non-linear envelopes, so I have enough. But I’ve encounter a problem. Path’s coordinates deal with floating numbers and they don’t like an integer number (just what I get from a modulator value).

              Is there any way to convert integers to floating numbers?

              #5312
              dasfaker
              Keymaster
                • Topics: 80
                • Replies: 793
                • Total: 873
                • ★★★

                Forget what I just posted, there was a typo in my code.
                It works fine with the value of a modulator.

                #5313
                atom
                Keymaster
                  • Topics: 159
                  • Replies: 2945
                  • Total: 3104
                  • ★★★★★

                  yeah lua doesn’t have types.

                Viewing 7 posts - 1 through 7 (of 7 total)
                • The forum ‘Programming’ is closed to new topics and replies.
                There is currently 0 users and 113 guests online
                No users are currently active
                Forum Statistics
                Threads: 2,495, Posts: 17,374, Members: 77,605
                Most users ever online was 12 on January 22, 2019 3:47 pm
                Ctrlr