开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜