Qt Quick Particles 예제 - 이미지 파티클
QML 파티클 시스템에서 어펙터를 사용한 예제 모음입니다.
파티클 시스템에서 어펙터를 사용하는 것과 관련된 작은 QML 예제 모음입니다. 각 예제는 특정 유형이나 기능을 강조하는 작은 QML 파일입니다.
ImageParticle 의 여러 기능을 한꺼번에 보여줍니다.
sprites: [ Sprite { name: "bear" source: "images/bear_tiles.png" frameCount: 13 frameDuration: 120 } ] colorVariation: 0.5 rotationVelocityVariation: 360 colorTable: "images/colortable.png"
색상은 약간의 색상 변화가 있는 간단한 ImageParticle 을 보여줍니다.
ImageParticle { anchors.fill: parent source: "qrc:///particleresources/star.png" alpha: 0 alphaVariation: 0.2 colorVariation: 1.0 }
컬러 테이블은 파티클의 수명에 따라 색상을 설정하여 고정된 무지개 효과를 제공합니다.
source: "qrc:///particleresources/glowdot.png" colorTable: "images/colortable.png" sizeTable: "images/colortable.png"
변형은 불가사리 파티클을 회전시키고 찌그러뜨립니다.
ImageParticle { system: sys groups: ["goingLeft", "goingRight"] source: "images/starfish_4.png" rotation: 90 rotationVelocity: 90 autoRotation: true } ImageParticle { system: sys groups: ["goingDown"] source: "images/starfish_0.png" rotation: 180 yVector: PointDirection { y: 0.5; yVariation: 0.25; xVariation: 0.25; } }
회전은 파티클이 이동하는 방향으로 회전하도록 자동 회전 속성을 보여줍니다.
공유는 여러 이미지 파티클이 동일한 파티클을 렌더링하려고 할 때 어떤 일이 발생하는지 보여줍니다. 다음 ImageParticle 은 ListView 안에 있는 파티클을 렌더링합니다:
ImageParticle { anchors.fill: parent system: particles source: "images/flower.png" alpha: 0.1 color: "white" rotationVariation: 180 z: -1 }
다음 ImageParticle 은 목록 하이라이트 내부에 배치되어 다른 ImageParticle 위에 파티클을 렌더링합니다.
ImageParticle { anchors.fill: parent system: particles source: "images/flower.png" color: "red" clip: true alpha: 1.0 }
이 ImageParticle 에서 색상과 알파를 설정하기 때문에 파티클을 다른 색상으로 렌더링한다는 점에 유의하세요. 회전과 관련하여 아무것도 지정하지 않았기 때문에 다른 ImageParticle 과 회전을 공유하여 꽃이 둘 다 같은 방식으로 회전합니다. 다른 ImageParticle 에서 회전을 취소할 수 있으며, 회전Variation을 0으로 명시적으로 설정하기만 하면 됩니다.
스프라이트는 이미지 파티클을 사용하여 각 파티클에 대해 정적 이미지 대신 애니메이션 스프라이트를 렌더링하는 데모를 보여줍니다.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.