mwg API
    Preparing search index...

    Function parseRotateMode

    • The sampling ~ROTATE(degrees, mode) asks for, from its second argument: linear (or smooth, since either word is what an author reaches for) interpolates, anything else - including nothing at all - takes the fast nearest-neighbour path. Exported beside the other path parsers for the same reason they are: a game that renders ~ROTATE through its own canvas pipeline still wants the same two names to mean the same two things.

      Parameters

      • argument: string | undefined

      Returns RotateMode

      import { parseImagePath, imageModifier, parseRotateMode } from '@datamoc/mw_games/two-d/render';

      const rotate = imageModifier(parseImagePath('tile.png~ROTATE(60,linear)'), 'ROTATE');
      parseRotateMode(rotate?.args[1]); // 'linear'
      parseRotateMode(undefined); // 'nearest'