Bzil
%Europe/Berlin %597 %2005, 15:20
Heb al een tijd terug het volgende script gevonden op deze site:
scrollspeed = 20;
easing = 4;
// stel de easing-snelheid in.....
achtergrond_balk._height = Mask._height-1;
knop_init = (Mask._height/tekst._height)*Mask._height;
if (knop_init<=Mask._height) {
// tekst is langer dan venster
knop._height = (Mask._height/tekst._height)*Mask._height;
} else {
// tekst is korter dan venster; geen scrollbalk
knop._height = 0;
achtergrond_balk._height = 0;
}
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
if (delta<0) {
knop._y = Math.min(knop._y -= delta*scrollspeed, (Mask._height-knop._height));
} else {
knop._y = Math.max(knop._y -= delta*scrollspeed, 0);
}
};
Mouse.addListener(mouseListener);
//
knop.onPress = function() {
startDrag(this, false, this._x, 0, this._x, Mask._height-this._height);
};
knop.onRelease = knop.onReleaseOutside=function () { stopDrag();};
tekst.onEnterFrame = function() {
scrollAmount = (this._height-(Mask._height))/(Mask._height-knop._height);
targY = -knop._y*scrollAmount;
this._y -= (this._y-targY)/easing;
};
Hiermee scroll ik een mc met easing.
Nu heb ik in die mc een pixelfont gebruikt die er in eerste instantie crisp uitziet. Als ik ga scrollen blijft ie niet altijd crisp.
Hoe zorg ik er voor dat ie altijd crisp blijft en dus niet op halve pixels kan stoppen?
scrollspeed = 20;
easing = 4;
// stel de easing-snelheid in.....
achtergrond_balk._height = Mask._height-1;
knop_init = (Mask._height/tekst._height)*Mask._height;
if (knop_init<=Mask._height) {
// tekst is langer dan venster
knop._height = (Mask._height/tekst._height)*Mask._height;
} else {
// tekst is korter dan venster; geen scrollbalk
knop._height = 0;
achtergrond_balk._height = 0;
}
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
if (delta<0) {
knop._y = Math.min(knop._y -= delta*scrollspeed, (Mask._height-knop._height));
} else {
knop._y = Math.max(knop._y -= delta*scrollspeed, 0);
}
};
Mouse.addListener(mouseListener);
//
knop.onPress = function() {
startDrag(this, false, this._x, 0, this._x, Mask._height-this._height);
};
knop.onRelease = knop.onReleaseOutside=function () { stopDrag();};
tekst.onEnterFrame = function() {
scrollAmount = (this._height-(Mask._height))/(Mask._height-knop._height);
targY = -knop._y*scrollAmount;
this._y -= (this._y-targY)/easing;
};
Hiermee scroll ik een mc met easing.
Nu heb ik in die mc een pixelfont gebruikt die er in eerste instantie crisp uitziet. Als ik ga scrollen blijft ie niet altijd crisp.
Hoe zorg ik er voor dat ie altijd crisp blijft en dus niet op halve pixels kan stoppen?