LibreOffice
LibreOffice 24.2 SDK API Reference
Public Member Functions | List of all members
XSprite Interface Reference

Interface to control a sprite object. More...

import"XSprite.idl";

Inheritance diagram for XSprite:
XInterface XAnimatedSprite XCustomSprite

Public Member Functions

void setAlpha ([in] double nAlpha) raises (com::sun::star::lang::IllegalArgumentException)
 Set overall transparency of the sprite. More...
 
void move ([in] ::com::sun::star::geometry::RealPoint2D aNewPos, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException)
 Move sprite to the specified position. More...
 
void transform ([in] com::sun::star::geometry::AffineMatrix2D aTransformation) raises (com::sun::star::lang::IllegalArgumentException)
 Apply a local transformation to the sprite. More...
 
void clip ([in] XPolyPolygon2D aClip)
 Apply a clipping to the shape output. More...
 
void setPriority ([in] double nPriority)
 Set sprite priority. More...
 
void show ()
 Make the sprite visible. More...
 
void hide ()
 Make the sprite invisible. More...
 
- Public Member Functions inherited from XInterface
any queryInterface ([in] type aType)
 queries for a new interface to an existing UNO object. More...
 
void acquire ()
 increases the reference counter by one. More...
 
void release ()
 decreases the reference counter by one. More...
 

Detailed Description

Interface to control a sprite object.

This is the basic interface to control a sprite object on a XSpriteCanvas. Sprites are moving, back-buffered objects.

Member Function Documentation

◆ clip()

void clip ( [in] XPolyPolygon2D  aClip)

Apply a clipping to the shape output.

The given clip poly-polygon is always interpreted in device coordinate space. As the sprite has its own local coordinate system, with its origin on screen being equal to its current position, the clip poly-polygon's origin will always coincide with the sprite's origin. Furthermore, if any sprite transformation is set via transform(), the clip is subject to this transformation, too. The implementation is free, if it has a cached representation of the sprite at hand, to clip-output only this cached representation (e.g. a bitmap), instead of re-rendering the sprite from first principles. This is usually the case for an implementation of a XCustomSprite interface, since it typically has no other cached pictorial information at hand.

Please note that if this sprite is not animated, the associated XSpriteCanvas does not update changed sprites automatically, but has to be told to do so via XSpriteCanvas::updateScreen().

Specifying an empty interface denotes no clipping, i.e. everything contained in the sprite will be visible (subject to device-dependent constraints, of course). Specifying an empty XPolyPolygon2D, i.e. a poly-polygon containing zero polygons, or an XPolyPolygon2D with any number of empty sub-polygons, denotes the NULL clip. That means, nothing from the sprite will be visible.

Parameters
aClipThe clip poly-polygon to apply.

◆ hide()

void hide ( )

Make the sprite invisible.

This method makes the sprite invisible.

◆ move()

void move ( [in] ::com::sun::star::geometry::RealPoint2D  aNewPos,
[in] ViewState  aViewState,
[in] RenderState  aRenderState 
)
raises (com::sun::star::lang::IllegalArgumentException
)

Move sprite to the specified position.

The position specified here is first transformed by the combined view and render transformation. The resulting position is then used as the output position (also in device coordinates) of the rendered sprite content.

Please note that if this sprite is not animated, the associated XSpriteCanvas does not update changed sprites automatically, but has to be told to do so via XSpriteCanvas::updateScreen().

Parameters
aNewPosThe new position, in user coordinate space, to move the sprite to.
aViewStateThe view state to be used when interpreting aNewPos.
aRenderStateThe render state to be used when interpreting aNewPos.
Exceptions
com::sun::star::lang::IllegalArgumentExceptionif one of the view and render state parameters are outside the specified range.

◆ setAlpha()

void setAlpha ( [in] double  nAlpha)
raises (com::sun::star::lang::IllegalArgumentException
)

Set overall transparency of the sprite.

This method is useful for e.g. fading in/out of animations.

Please note that if this sprite is not animated, the associated XSpriteCanvas does not update changed sprites automatically, but has to be told to do so via XSpriteCanvas::updateScreen().

Parameters
nAlphaNew global alpha value to composite this sprite with the background. Valid range is [0,1].
Exceptions
com::sun::star::lang::IllegalArgumentExceptionif nAlpha is not within the permissible range.

◆ setPriority()

void setPriority ( [in] double  nPriority)

Set sprite priority.

The sprite priority determines the order of rendering relative to all other sprites of the associated canvas. The higher the priority, the later will the sprite be rendered, or, in other words, the closer to the screen surface the sprite is shown.

Parameters
nPriorityNew sprite priority value to serve as the sort key when determining sprite rendering order. Avoid NaNs and other irregular floating point values here, the order position for sprites with such a priority value is undefined.

◆ show()

void show ( )

Make the sprite visible.

This method makes the sprite visible on the canvas it was created on.

◆ transform()

Apply a local transformation to the sprite.

The given transformation matrix locally transforms the sprite shape. If this transformation contains translational components, be aware that sprite content moved beyond the sprite area (a box from (0,0) to (spriteWidth,spriteHeight)) might (but need not) be clipped. Use XSprite::move() to change the sprite location on screen. The canvas implementations are free, if they have a cached representation of the sprite at hand, to transform only this cached representation (e.g. a bitmap), instead of re-rendering the sprite from first principles. This is usually the case for an implementation of a XCustomSprite interface, since it typically has no other cached pictorial information at hand.

Please note that if this sprite is not animated, the associated XSpriteCanvas does not update changed sprites automatically, but has to be told to do so via XSpriteCanvas::updateScreen().

Parameters
aTransformationThe transformation to apply to the sprite shape.
Exceptions
com::sun::star::lang::IllegalArgumentExceptionif the given transformation matrix is singular.

The documentation for this interface was generated from the following file: