[Select]

Sprites


Index

 

Translucent sprite operation

Translucent - partially transparent - sprite rendering has been provided within the SpriteExtend module. This relies on certain other modules being present (suitable InverseTable and BlendTable modules) and requires application support before it will be visible to the user. All non-translucent graphic operations remain as before.

Translucent operations apply to all sprite depths *, rendered in all output depths *.

Translucency

Translucency is measured as a value from 0 to 255. At 0 no translucency is applied and the image is rendered as previously. At 128 the sprite is blended half and half with the background. At 255 the image is almost totally transparent.

API changes

Sprite operations through the SpriteExtend entry points for PutSpriteScaled, and the JPEG operations JPEG_PlotScaled, JPEG_PlotFileScaled, JPEG_PlotTransformed and JPEG_PlotFileTransformed have updated APIs to handle the translucent operations.

OS_SpriteOp 52 (PutSpriteScaled)
OS_SpriteOp 56 (PutSpriteTransformed)

The plot action has been extended :

      bits 8-15 = translucency to render the image at (0-255)
JPEG_PlotScaled JPEG_PlotFileScaled

The plot flag bits have been extended :

      bits 4-11 = translucency to render the image at (0-255)
JPEG_PlotTransformed JPEG_PlotFileTransformed

The transformation flag bits have been extended :

      bits 5-12 = translucency to render the image at (0-255)

* Except CMYK.

Transformed sprite plotting

Rendering translucent sprites transformed is not presently supported by SpriteExtend.


This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holders permission. RISC OS is subject to continuous development and improvement as such all information is reproduced by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.

HTML document version 1.03 3rd November 2015