开发者

To Draw a measuring scale like UI in actionscript

开发者 https://www.devze.com 2023-03-08 10:17 出处:网络
Hi how to draw a line with numbers and the tick interv开发者_如何学Pythonals as in a measuring scale. some thing like this image This should give you a good start:

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

精彩评论

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