DragASprite

Introduction and Overview

The DragASprite module was updated in RISC OS 4 to add a number to ease the use of the module. The rendering of the dragged object was updated in Select 2 to take advantage of the transparent rendering of sprites, making it easier to see where the object dragged was being placed.

Technical Details

Flags

The full bit flag set as used by R0 on entry to SWI DragASprite_Start is as follows :

Bit(s)Meaning
0-1Horizontal location of sprite in box (see PRM 3-301):
ValueMeaning
0Left
1Centre
2Right
3Undefined
2-3Vertical location of sprite in box (see PRM 3-301):
ValueMeaning
0Bottom
1Centre
2Top
3Undefined
4-5Drag bounding box is (see PRM 3-301):
ValueMeaning
0Whole screen
1Display area of window that the pointer's over
2User specified
3Undefined
6Bounding box applies to (see PRM 3-301):
ValueMeaning
0The box
1The pointer
7Control of drop-shadow (see PRM 3-301):
ValueMeaning
0Don't do a drop-shadow
1Make a drop shadow when copying the sprite
8Sprite transparency (see PRM 5a-493):
ValueMeaning
0Sprite should be see-through
1Sprite should be solid
9Sprite positioning (new to RISC OS 4):
ValueMeaning
0Sprite's position is determined by bits 0-3
1Sprite is centred on pointer position
10-31Reserved for future use, should be set to 0

Rendering of the dragged sprite

The meaning of bit 8 changed slightly in Select 2. Under RISC OS 3.5 this bit was added to force the dragged image to be dithered with alternate masked pixels in a chequer-board pattern. Whilst this allowed the background to be dragged, it lost detail from the dragged sprite. This caused visual problems with sprites which used a dither pattern to make up their colours, such as the standard RISC OS sprite set.

Under Select 2 this behaviour was modified to use a true translucent sprite. However this effect is less effective as the number of colours in the display mode is reduced. At its extreme (2 colour modes) the sprite becomes solid. However, it is not expected that such low depths be used by many clients and so this is not a serious problem.