开发者

To Draw a measuring scale like UI in actionscript

Hi how to draw a line with numbers and the tick interv开发者_如何学Pythonals as in a measuring scale. some thing like this image

To Draw a measuring scale like UI in actionscript


This should give you a good start:

graphics.lineStyle(1,0);

for(var i:int=0; i<10; i++){
    //Draw the big strokes
    graphics.moveTo(i*50, 0);
    graphics.lineTo(i*50, 40);
    //Draw the smaller ones
    for(var u:int=1+i*10; u<10+i*10; u++){
        var smallHeight:int = 15;
        if (u%5==0) smallHeight = 25;//Make the centered one higher
        graphics.moveTo(u*5, 40-smallHeight);
        graphics.lineTo(u*5, 40);
    }
 }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜