|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alienfactory.javamappy.AnimBlock
public class AnimBlock
AnimBlock represents a sequence of frames (images) that will be played out
according to the animation type and a speed dictated by the frame delay.
The animation type names and sequence events are true to the Mappy code. (I
hope!)
Field Summary | |
---|---|
static int |
AN_LOOPF
Loop Forward. |
static int |
AN_LOOPR
Loop Reverse. |
static int |
AN_NONE
Do Not Animate. |
static int |
AN_ONCE
Animate Once. |
static int |
AN_ONCEH
Animate Once & Halt. |
static int |
AN_ONCES
Animate Once Finished. |
static int |
AN_PPFF
Ping Ping Forward - Outward Leg. |
static int |
AN_PPFR
Ping Ping Forward - Return Leg. |
static int |
AN_PPRF
Ping Ping Reverse - Outward Leg. |
static int |
AN_PPRR
Ping Ping Reverse - Return Leg. |
Constructor Summary | |
---|---|
AnimBlock()
|
Method Summary | |
---|---|
int |
getCurrentFrame()
Returns the current frame (image index). |
int |
getCurrentFrameIndex()
Returns the current frame index. |
int |
getDelay()
The delay is the number of times updateAnimation()
needs to be called before the currentFrameIndex changes. |
int |
getDelayCountdown()
Returns the number of times updateAnimation() has to be called
before the current frame is changed to the next in sequence. |
int[] |
getFrames()
Returns an array of frames (image indexs) that represent the animation sequence. |
int |
getType()
The type dictates how the animation sequence will be played
out. |
int |
getUserData()
Returns any user defined data. |
void |
setCurrentFrameIndex(int currentFrameIndex)
Sets the current frame index. |
void |
setDelay(int delay)
The delay is the number of times updateAnimation()
needs to be called before the currentFrameIndex changes. |
void |
setDelayCountdown(int count)
Sets the number of times updateAnimation() has to be called
before the current frame is changed to the next in sequence. |
void |
setFrames(int[] frames)
Sets the frames (image indexs) that represent the animation sequence. |
void |
setType(int type)
The type dictates how the animation sequence will be played
out. |
void |
setUserData(int userData)
Sets any user defined data. |
void |
updateAnimation()
Counts down the delay and updates the current frame to the next in the animation sequence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AN_NONE
AnimBlock
type. updateAnimation()
, getCurrentFrameIndex()
would
return: [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 . . . ]
0
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_LOOPF
AnimBlock
type. updateAnimation()
, getCurrentFrameIndex()
would
return: [ 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 3 . . . ]
1
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_LOOPR
AnimBlock
type. updateAnimation()
, getCurrentFrameIndex()
would
return: [ 4 3 2 1 0 4 3 2 1 0 4 3 2 1 0 4 3 2 . . . ]
2
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_ONCE
AnimBlock
type. AN_ONCES
. updateAnimation()
, getCurrentFrameIndex()
would
return: [ 0 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 . . . ]
3
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_ONCES
AnimBlock
type. AN_ONCE
sequence has finished. AN_ONCES
behaves the same as
AN_ONCES
. 9
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_ONCEH
AnimBlock
type. AN_ONCE
the animation type does not change.
updateAnimation()
, getCurrentFrameIndex()
would
return: [ 0 1 2 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 . . . ]
4
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_PPFF
AnimBlock
type. AN_PPFR
and the sequence begins it's
return journey. AN_PPFF
and AN_PPRR
. updateAnimation()
, getCurrentFrameIndex()
would
return: [ 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0 1 . . . ]
5
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_PPFR
AnimBlock
type. AN_PPFF
and the sequence starts all
over again. AN_PPFR
and AN_PPRF
. updateAnimation()
, getCurrentFrameIndex()
would
return: [ 4 3 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 . . . ]
6
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_PPRF
AnimBlock
type. AN_PPRR
and the sequence begins it's
return journey. AN_PPRF
and AN_PPFR
. updateAnimation()
, getCurrentFrameIndex()
would
return: [ 4 3 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 . . . ]
7
.
getType()
,
setType(int)
,
Constant Field Valuespublic static final int AN_PPRR
AnimBlock
type. AN_PPRR
and the sequence starts all
over again. AN_PPRR
and AN_PPFF
. updateAnimation()
, getCurrentFrameIndex()
would
return: [ 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0 1 . . . ]
8
.
getType()
,
setType(int)
,
Constant Field ValuesConstructor Detail |
---|
public AnimBlock()
Method Detail |
---|
public int getType()
type
dictates how the animation sequence will be played
out. Will it play once and stop or loop forever?
public void setType(int type) throws java.lang.IllegalArgumentException
type
dictates how the animation sequence will be played
out. Will it play once and stop or loop forever?
type
- the new animation type
java.lang.IllegalArgumentException
- if type
is out of boundspublic int getDelay()
delay
is the number of times updateAnimation()
needs to be called before the currentFrameIndex
changes. In
effect this controls the speed of the animation.
getDelayCountdown()
,
setDelayCountdown(int)
public void setDelay(int delay) throws java.lang.IllegalArgumentException
delay
is the number of times updateAnimation()
needs to be called before the currentFrameIndex
changes. In
effect this controls the speed of the animation.
delay
- the new frame delay
java.lang.IllegalArgumentException
- if delay is less than zerogetDelayCountdown()
,
setDelayCountdown(int)
public int getDelayCountdown()
updateAnimation()
has to be called
before the current frame is changed to the next in sequence. If
getCount() == 0
the current frame will change on the
next call to updateAnimation()
and count
will
reset to delay
.
getDelay()
public void setDelayCountdown(int count) throws java.lang.IllegalArgumentException
updateAnimation()
has to be called
before the current frame is changed to the next in sequence.
java.lang.IllegalArgumentException
- if count is less than zeropublic int getCurrentFrameIndex()
public void setCurrentFrameIndex(int currentFrameIndex)
public int getCurrentFrame()
public int[] getFrames()
public void setFrames(int[] frames) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- is frames
is null
public int getUserData()
public void setUserData(int userData)
public void updateAnimation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |