Package totalcross.game
Class Animation
- java.lang.Object
-
- totalcross.ui.gfx.GfxSurface
-
- totalcross.ui.Control
-
- totalcross.game.Animation
-
- Direct Known Subclasses:
AnimatedButton
@Deprecated public class Animation extends Control
Deprecated.The Animation control class.
This control displays an animation that can be loaded from indexed BMP files (one frame per image) or by a multi-frames BMP. This kind of BMP file contains a list of images having all the same size and that lay side by side.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class totalcross.ui.Control
Control.TranslucentShape
-
-
Field Summary
Fields Modifier and Type Field Description protected ImagebackgroundDeprecated.Background image.protected intcurFrameDeprecated.The current frame.intdrawOpDeprecated.Dumb field to keep compilation compatibility with TC 1.static inteventFinishDeprecated.Notifies animation endings.static inteventFrameDeprecated.Notifies animation frames.static inteventLoopDeprecated.Notifies animation loops.static inteventNoneDeprecated.No notify at all.protected inteventsMaskDeprecated.Event notification mask, whose value iseventFinish, which means that an event is posted only when the animation finishes.intframePeriodDeprecated.Delay between two frames.ImageframesBufferDeprecated.Frames buffer.booleanisPausedDeprecated.Reflects the animation pause state.booleanisPlayingDeprecated.Reflects the animation play state.static intLOOPS_UNLIMITEDDeprecated.start()methodloopsargument special value to loop endlessly.booleanpauseIfNotVisibleDeprecated.Sets to true to stop the animation if its parent window is not the top most.-
Fields inherited from class totalcross.ui.Control
AFTER, alphaValue, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, BRIGHTER_BACKGROUND, callListenersOnAllTargets, CENTER, CENTER_OF, clearValueInt, clearValueStr, DARKER_BACKGROUND, DP, effect, enableUpdateScreen, esce, eventsEnabled, FILL, fillColor, FIT, floating, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, FONTSIZE, foreColor, height, ignoreInsets, isHighlighting, isTablet, KEEP, keepDisabled, keepEnabled, LEFT, next, nextTabControl, npParts, offscreen, offscreen0, onEventFirst, parent, PARENTSIZE, PARENTSIZEMAX, PARENTSIZEMIN, PREFERRED, prev, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, SCREENSIZE, SCREENSIZEMAX, SCREENSIZEMIN, setFont, setH, setRel, setW, setX, SETX_NOT_SET, setY, tempW, textShadowColor, TOP, translucentShape, transparentBackground, uiAdjustmentsBasedOnFontHeightIsSupported, uiAndroid, UICONST, uiFlat, uiHolo, uiMaterial, uiVista, visible, width, WILL_RESIZE, x, y
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidenableEvents(int mask)Deprecated.Enable the posting of events.intgetPreferredHeight()Deprecated.Returns the preferred height of this control.intgetPreferredWidth()Deprecated.Returns the preferred width of this control.voidonEvent(Event e)Deprecated.Process events for theAnimationclass.voidonPaint(Graphics gfx)Deprecated.Called by the system to draw the animation.voidpause()Deprecated.Pauses a running animation.voidresume()Deprecated.Resumes a paused animation.voidsetImage(Image frames, int frameCount, int framePeriod)Deprecated.Sets the image of anAnimationobject.intsize()Deprecated.Number of frames in the animation.voidstart(int loops)Deprecated.Starts the animation.voidstart(int sFrame, int eFrame, int step, int loops)Deprecated.Starts the animation with a frame range.voidstop()Deprecated.Stops the animation.-
Methods inherited from class totalcross.ui.Control
_onEvent, addEnabledStateListener, addFocusListener, addFontChangeHandler, addGridListener, addHandler, addHighlightListener, addKeyListener, addListContainerListener, addMouseListener, addMultiTouchListener, addPenListener, addPressListener, addPushNotificationListener, addSizeChangeHandler, addTimer, addTimer, addTimerListener, addValueChangeHandler, addWindowListener, bringToFront, changeHighlighted, clear, contains, drawTranslucentBackground, getAbsoluteRect, getBackColor, getDoEffect, getEffectH, getEffectW, getEffectX, getEffectY, getEventListeners, getFont, getForeColor, getGap, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPressedEvent, getPrev, getRect, getSize, getTextShadowColor, getWidth, getX, getX2, getY, getY2, hadParentScrolled, handleGeographicalFocusChangeKeys, hasFocus, internalSetEnabled, intXYWH, isActionEvent, isChildOf, isDisplayed, isEnabled, isFloating, isInsideOrNear, isObscured, isTopMost, isVisible, isVisibleAndInside, onBoundsChanged, onColorsChanged, onFontChanged, onWindowPaintFinished, post, postEvent, postPressedEvent, releaseScreenShot, removeEnabledStateListener, removeFocusListener, removeGridListener, removeHandler, removeHighlightListener, removeKeyListener, removeListContainerListener, removeMouseListener, removeMultiTouchListener, removePenListener, removePressListener, removePushNotificationListener, removeTimer, removeTimerListener, removeWindowListener, repaint, repaintNow, reposition, reposition, repositionChildren, requestFocus, resetSetPositions, resetStyle, safeRepaintNow, safeUpdateScreen, sendToBack, setBackColor, setBackForeColors, setDoEffect, setEnabled, setFloating, setFocusLess, setFont, setForeColor, setNinePatch, setNinePatch, setRect, setRect, setRect, setRect, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboard
-
-
-
-
Field Detail
-
pauseIfNotVisible
public boolean pauseIfNotVisible
Deprecated.Sets to true to stop the animation if its parent window is not the top most.
-
framePeriod
public int framePeriod
Deprecated.Delay between two frames.
-
isPlaying
public boolean isPlaying
Deprecated.Reflects the animation play state.
-
isPaused
public boolean isPaused
Deprecated.Reflects the animation pause state.
-
framesBuffer
public Image framesBuffer
Deprecated.Frames buffer.
-
eventsMask
protected int eventsMask
Deprecated.Event notification mask, whose value iseventFinish, which means that an event is posted only when the animation finishes.
-
eventNone
public static final int eventNone
Deprecated.No notify at all.- See Also:
- Constant Field Values
-
eventFinish
public static final int eventFinish
Deprecated.Notifies animation endings.- See Also:
- Constant Field Values
-
eventLoop
public static final int eventLoop
Deprecated.Notifies animation loops.- See Also:
- Constant Field Values
-
eventFrame
public static final int eventFrame
Deprecated.Notifies animation frames.- See Also:
- Constant Field Values
-
LOOPS_UNLIMITED
public static final int LOOPS_UNLIMITED
Deprecated.start()methodloopsargument special value to loop endlessly.- See Also:
- Constant Field Values
-
curFrame
protected int curFrame
Deprecated.The current frame.
-
drawOp
public int drawOp
Deprecated.Dumb field to keep compilation compatibility with TC 1.
-
background
protected Image background
Deprecated.Background image.
-
-
Constructor Detail
-
Animation
protected Animation()
Deprecated.Animation constructor. This constructor may be used by deriving classes.
-
Animation
public Animation(Image frames, int framePeriod) throws ImageException
Deprecated.Animation constructor.- Parameters:
frames- Single image containing all frames. The number of frames and the transparent colors are fetched from the image.framePeriod- Delay in milliseconds between two frames.- Throws:
ImageException- If an internal method throws it.
-
Animation
public Animation(Image frames, int frameCount, int framePeriod) throws ImageException
Deprecated.Animation constructor.- Parameters:
frames- single image containing all frames.frameCount- width in pixels of one frame.framePeriod- delay in milliseconds between two frames.- Throws:
ImageException- If an internal method throws it.
-
-
Method Detail
-
setImage
public void setImage(Image frames, int frameCount, int framePeriod) throws ImageException
Deprecated.Sets the image of anAnimationobject.- Parameters:
frames- single image containing all frames.frameCount- width in pixels of one frame.framePeriod- delay in milliseconds between two frames.- Throws:
ImageException- If an internal method throws it.
-
onEvent
public void onEvent(Event e)
Deprecated.Process events for theAnimationclass.
-
size
public int size()
Deprecated.Number of frames in the animation.- Returns:
- Frames amount
-
getPreferredWidth
public int getPreferredWidth()
Deprecated.Returns the preferred width of this control.- Overrides:
getPreferredWidthin classControl- Returns:
- The preferred width of this control.
-
getPreferredHeight
public int getPreferredHeight()
Deprecated.Returns the preferred height of this control.- Overrides:
getPreferredHeightin classControl- Returns:
- The preferred height of this control.
-
onPaint
public void onPaint(Graphics gfx)
Deprecated.Called by the system to draw the animation.
-
enableEvents
public void enableEvents(int mask)
Deprecated.Enable the posting of events. By default the posting of events are disabled.
-
pause
public void pause()
Deprecated.Pauses a running animation. If the animation is not playing, this call has no effect.
-
resume
public void resume()
Deprecated.Resumes a paused animation. If the animation is not playing, this call has no effect.
-
stop
public void stop()
Deprecated.Stops the animation. If the animation is not playing, this call has no effect.
-
start
public void start(int sFrame, int eFrame, int step, int loops)Deprecated.Starts the animation with a frame range. This method starts an animation by specifying the frame range and a loop flag. If the application is already playing, this call has no effect.- Parameters:
sFrame- The start frame.eFrame- The end frame.step- The frame increment.loops- The number of animation iterations.
-
start
public void start(int loops)
Deprecated.Starts the animation. This method starts the animation and loops the specified amount of time. If the application is already playing, this call has no effect.- Parameters:
loops- Integer value specifying the number of loops orLOOPS_UNLIMITEDfor an infinite loop.- See Also:
LOOPS_UNLIMITED
-
-