自定义Slider,滑块变形的问题

var _lifeSlider:GSlider = new GSlider();
//设置滑块大小。由于默认滑块大小为13X13的。若想设置的滑块小于默认的时,会被拉大。
var thumbSprite:Sprite = new Sprite();
var thumb:Bitmap = GlobalClass.getBitmap("ControlBarBig");
thumbSprite.graphics.beginFill(0xFFFFFF, 0);
thumbSprite.graphics.drawRect(0,0,13,13);
thumbSprite.addChild(thumb);
_lifeSlider.setStyle("sliderTrackSkin",new Bitmap());
_lifeSlider.setStyle("sliderTrackDisabledSkin",new Bitmap());
_lifeSlider.setStyle("thumbDisabledSkin",thumbSprite);
_lifeSlider.setStyle("thumbDownSkin",thumbSprite);
_lifeSlider.setStyle("thumbOverSkin",thumbSprite);
_lifeSlider.setStyle("thumbUpSkin",thumbSprite);
_lifeSlider.width = 100;
_lifeSlider.height = 10;
_lifeSlider.maximum = 100;
_lifeSlider.minimum = 1;
_lifeSlider.value = 50;
_lifeSlider.snapInterval = 1;
_lifeSlider.liveDragging = true;
_lifeSlider.addEventListener(SliderEvent.CHANGE, onLifeSetChangeHandler);
this.addChild(_lifeSlider);

你可能感兴趣的:(AS3)