tween the area 250px

  • when opening a map i would like the area to tween from the right hand side of the stage only 250px reguardless of screen size. i can tween it by % no problem but cannot figure out the math to make it only 250px. my plugin cannot be set via % or on large screen it is very distorted.

    tween(area.width, 90%); this tween is 10% how to modify to pixels?

    i have tried

    tween(area.width, sub(stagewidth,-250));
    dec(area.width, 250));

    any ideas?

  • ok that works but,

    when choosing to tween the width from 100%-90% is just slides back the needed 10%. when using the above solution it redraws the map starting from the left and then going right until it hits the 250px mark. is there a way to gain the same effect as % using PX? i just want the area to tween back from the right hand side 250px instead of having it grow from the left all the way back to the right.

    EDIT: after thinking about this i assume there is no way to do what i am asking. since the area is set in % at first changing to pixels it must HAVE to be redrawn as I am changing the unit of mesurement?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!