A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Whole Pixel Movement

  1. #1
    I am using this actionscript to obtain a certain movement characteristic in flash 5.0. Howevrer, I use pixel fonts and need to know how to make the movie clip move only on WHOLE pixels so the text never blurs even during movement. Can anybody help me with this?

    this is the code (if it is even relevant):

    onClipEvent (load) {
    var valid = true;
    newY = _y;
    origY = _y;
    Yspeed = 0;
    a = 1.4;
    d = 1.2;
    }
    onClipEvent (enterFrame) {

    Yspeed = ((_y-newY)/a+Yspeed)/d;
    _y -= Yspeed;


    }
    onClipEvent (mouseDown) {

    if ((valid == true) and (_root._ymouse < 275)) {
    newY = Math.ceil(_root._ymouse);
    valid=false;
    }else{
    if ((valid == true) and (_root._ymouse > 275)) {
    newY = 275;
    valid=false;
    }
    }
    }

  2. #2
    Friendly fire ain't. skd's Avatar
    Join Date
    Mar 2002
    Location
    toronto.ca
    Posts
    389
    onClipEvent (enterFrame) {
    Yspeed = ((_y-newY)/a+Yspeed)/d;
    _y -= math.ceil(Yspeed);
    }


    given that the initial position is a whole pixel...

  3. #3
    Thank you very much for your help. I really feel better now.

  4. #4
    Hey, a minimalist web link thingy. its about time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center