开发者

How to fill a box2d-qml polygon with a color?

开发者 https://www.devze.com 2023-03-25 04:12 出处:网络
I have box2d and qml working together nice. I am generating a polygon like this Polygon{ vertices: [ Qt.point(6, 22),

I have box2d and qml working together nice. I am generating a polygon like this

Polygon{
    vertices: [
                Qt.point(6, 22),
                Qt.point(10, 64),
                Qt.point(46, 89),
                Qt.point(82, 64),
                Qt.point(84, 21),
 开发者_开发技巧               Qt.point(45, 1)
            ]

}

but can not add

Polygon{
        ...
        ...
     **color: red**   
    }

it does not allow with a red line under "color".

should i do some javascript attraction?

thanks


you have to use hexadecimal colors. or using Common.b2Color object. you can see documentation here http://www.box2dflash.org/docs/2.1a/reference/

color : #FFFFFF;


or b2Color(rr:Number, gg:Number, bb:Number);
0

精彩评论

暂无评论...
验证码 换一张
取 消