public void attachSprite(Sprite sprite,HorizontalAlignment xAlign,VerticalAlignment yAlign,int xOffset,int yOffset){
  int x=xOffset;
switch (xAlign) {
case LEFT:
    break;
case RIGHT:
  x+=getWidth() - sprite.getWidth();
break;
case CENTER:
x+=(getWidth() - sprite.getWidth()) / 2;
break;
}
int y=yOffset;
switch (yAlign) {
case TOP:
break;
case MIDDLE:
y+=(getHeight() - sprite.getHeight()) / 2;
break;
case BOTTOM:
y+=getHeight() - sprite.getHeight();
break;
}
synchronized (this) {
if (attachedSprites == null) {
attachedSprites=new ConcurrentLinkedQueue<AttachedSprite>();
}
}
attachedSprites.add(new AttachedSprite(sprite,x,y));
}

public void attachSprite ( Sprite sprite , HorizontalAlignment xAlign , VerticalAlignment yAlign , int xOffset , int yOffset ) { int x = xOffset ; switch ( xAlign ) { case LEFT : break ; case RIGHT : x += getWidth ( ) - sprite . getWidth ( ) ; break ; case CENTER : x += ( getWidth ( ) - sprite . getWidth ( ) ) / 2 ; break ; } int y = yOffset ; switch ( yAlign ) { case TOP : break ; case MIDDLE : y += ( getHeight ( ) - sprite . getHeight ( ) ) / 2 ; break ; case BOTTOM : y += getHeight ( ) - sprite . getHeight ( ) ; break ; } synchronized ( this ) { if ( attachedSprites == null ) { attachedSprites = new ConcurrentLinkedQueue < AttachedSprite > ( ) ; } } attachedSprites . add ( new AttachedSprite ( sprite , x , y ) ) ; }
attach a sprite to the view . these are drawn on top of the main view sprite .
