h6. [[OS SWI Calls]] h6(. » [[OS_SpriteOp]] h6((. » OS_SpriteOp 16 - Get sprite from user coords h2. OS_SpriteOp 16 - Get sprite from user coords h5. (SWI &2E) |_<^{width:4em}. Entry | | |<^. R0 |<^. 16 (Reason code) + [[OS_SpriteOp|Area value]]| |<^. R1 |<^. Unused/[[Format Of Sprite Area|Sprite area]] (as defined by area value in R0) | |<^. R2 |<^. Sprite name | |<^. R3 |<^. 1 to create palette, 0 to exclude palette | |<^. R4 |<^. X0 coordinate | |<^. R5 |<^. Y0 coordinate | |<^. R6 |<^. X1 coordinate | |<^. R7 |<^. Y1 coordinate | |_<^{width:4em}. Exit | | |\2<^. All registers preserved| h4. Use This call creates a new sprite with the given name, by copying a rectangle of pixels from the screen. The [[Sprite Mode Word]] will be chosen such that the underlying pixel format of the sprite and the screen are identical. This allows for easy creation of sprites which can be blitted directly to screen memory via the fast [[OS_SpriteOp 34]] call. If a palette is requested then the palette will be initialised to a copy of the current screen palette. For 256 colour modes with a full 256 entry palette this will result in the sprite having the full 256 entries. h4. Notes If a sprite with the given name already exists, it will first be deleted before the new sprite is created. The coordinates must be specified in OS units. There is no defined order for the coordinates (i.e. X0 can either be the left or right edge of the sprite). Coordinates are inclusive. After the sprite has been created, it will be set as the active sprite, as if [[OS_SpriteOp 24]] had been called. See also [[OS_SpriteOp 14]], to create a sprite from the area defined by the graphics cursor position h4. See also * [[Format Of Sprite]] * [[Format Of Sprite Area]] * [[OS_SpriteOp]] * [[OS_SpriteOp 14]] * [[OS_SpriteOp 24]] * [[OS_SpriteOp 34]] * [[Sprite Mode Word]]