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
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);
}
}
精彩评论