Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to put a particles(from ParticleSystem) in an custom user figure?
Forum Updated to NodeBB v4.3 + New Features

How to put a particles(from ParticleSystem) in an custom user figure?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 839 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stykit
    wrote on last edited by
    #1

    Hi everyone)
    Recently started learning Qt Quick and his type ParticleSystem.
    I have a code:
    @ParticleSystem {
    id: particlesystem
    anchors.fill: sky
    z:1000

        ImageParticle {
            id: stars
            source: "content/images/star.png"
            groups: ["stars"]
            opacity: .5
        }
    
        Emitter {
            id: starsemitter
            anchors.fill: parent
            emitRate: parent.width / 10
            lifeSpan: 5000
            group: "stars"
            //shape: ellipse
        }
    }@
    

    The question is: Can I put Particles in an custom user figure?
    Of course you can easily put in a rectangle using anchors.fill or in an ellipse using Emitter property shape, but I want do the same with a circle or triangle.

    1 Reply Last reply
    0
    • slettaS Offline
      slettaS Offline
      sletta
      wrote on last edited by
      #2

      You can use an emitter with an image mask: http://qt-project.org/doc/qt-5.1/qtquick/qml-qtquick-particles2-maskshape.html

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stykit
        wrote on last edited by
        #3

        [quote author="sletta" date="1393487129"][/quote]
        Thanks, but then I have to create a separate image for each screen resolution.. So, It's not suitable for me.
        Is there a way to create my own shape qml type(TriangleShape, PolygonShape)?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved