GF4J 0.9.4 Beta

gameframe.graphics
Class ScaleEffect

java.lang.Object
  |
  +--gameframe.graphics.BitmapEffect
        |
        +--gameframe.graphics.ScaleEffect

public class ScaleEffect
extends BitmapEffect

Scales the image the given amount. The new image will have its size set accordingly.

Since:
GameFrame for Java 0.9.4
Version:
GameFrame for Java 0.9.4

Field Summary
protected  float m_flScale
          The scale factor to be applied.
 
Constructor Summary
ScaleEffect()
           
 
Method Summary
 float getScale()
          Returns the amount of scaling applied to the image.
 BitmapData processData(BitmapData data)
          Scales the image the given amount.
 void reset()
          Resets the effect settings to default values (no scaling is applied).
 void setScale(float scale)
          Sets the amount of scaling applied to the image.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_flScale

protected float m_flScale
The scale factor to be applied.
Constructor Detail

ScaleEffect

public ScaleEffect()
Method Detail

setScale

public void setScale(float scale)
Sets the amount of scaling applied to the image. Values of ]0.0, 1.0[ will make the resulting image smaller and values above 1.0 will make the resulting image larger. Value of 1.0 will not change the image at all. Values of ]-infinity, 0] or above 100.0 are not accepted.
Parameters:
scale - The scale to be applied.

getScale

public float getScale()
Returns the amount of scaling applied to the image.
Returns:
The scale to be applied on the image.

reset

public void reset()
Resets the effect settings to default values (no scaling is applied).
Overrides:
reset in class BitmapEffect

processData

public BitmapData processData(BitmapData data)
Scales the image the given amount.
Overrides:
processData in class BitmapEffect
Parameters:
data - The raw bitmap data that is to be processed.
Returns:
The processed data.

GF4J 0.9.4 Beta