QUICK NAVIGATOR
PRODUCTS
TECHNOLOGIES
DEVELOPMENT TOOLS
* News
* Java Media Framework
* Intel Animation for Java
* Intel Spatial Audio for Java
* Runtime Software License
* SDK Software License
* System Requirements
* Download Area
* Documentation Online
* Gallery
* General FAQ
* Support Information

[INTEL NAVIGATION HEADER]

Intel Animation for Java* Package Tutorial

Lesson 6: Using Effects



This applet shows effects. Click on the buttons to apply different effects to the Intel logo.

The following needs to be done to apply an effect to a sprite:

1. Create an EffectParameter (in this example we'll apply a RotateXEffect. The steps are similar for the other effects)

RotateXParam rotateparam = new RotateXParam(DEGREES, AXIS_COORDINATE);

2. Create an Effect

RotateXEffect rotatefx = new RotateXEffect(rotateparam);

3. Apply the Effect to a sprite

sprite.applyEffect(rotatefx);

After applyEffect() is called, the Effect is automatically activated (the effect is performed). Activate/deactivate an effect with Effect.activate(boolean)

rotatefx.activate(false);

Modify EffectParmeter using Effect.getParams and Effect.setParams

rotateparam = rotatefx.getParams();

rotateparam.Angle = rotateparam.Angle + 5;

rotatefx.setParams(rotateparam);

(don't forget to make the new image visible with repaint())

The Effect can be removed from the sprite with

sprite.removeEffect(rotatefx);

Previous Lesson Tutorial Contents Next Lesson

View Source

 

This page was last updated on Feb 11th, 1997.

Legal Stuff

Free Web Hosting