Android Question Flip sprite animation in libgdx?

Malky

Active Member
Licensed User
Longtime User
Is there a simple way to flip the animation sequence so that I can achieve a walking animation in libgdx?

I have the following which works walking right, but if I need to get the same effect when walking left?
B4X:
Batch.DrawRegion3(pandaFrames(0,(Frames/8) Mod 14),mypanda.x,mypanda.y,ScreenW*0.1,ScreenH*1,ScreenW*0.08,ScreenH*0.2,1,1,pandaAngle)
Flipping the sprite animation in an art package and using it only makes it animate backwards as expected.

Malky
 

Informatix

Expert
Licensed User
Longtime User
I still can't find an animated moving sprite example with Scene2D

You can animate with the lgAnimation class, and you have two examples: Scene2D_Buttons (alien button) and Scene2D_Interpolation (walking elf), or with the lgScn2DAction and lgScn2DActions classes (Scene2D_Interpolation, Scene2D_Lists).

Please feel free to offer the kick in any direction you want?


Also, is there a definitive list of the available classes anywhere?

Here's the list:
B4X:
    Dim lg As LibGDX
    Dim an As lgAnimation
    Dim ar As lgArray
    Dim asm As lgAssetManager
    Dim au As lgAudio
    Dim aud As lgAudioDevice
    Dim aur As lgAudioRecorder
    Dim bf As lgBitmapFont
    Dim bfc As lgBitmapFontCache
    Dim bft As lgBitmapFontTextBounds
    Dim b2db As lgBox2DBody
    Dim b2dbd As lgBox2DBodyDef
    Dim b2dbe As lgBox2DBodyEditorLoader
    Dim b2dcs As lgBox2DChainShape
    Dim b2dci As lgBox2DCircleShape
    Dim b2dco As lgBox2DContact
    Dim b2dcoi As lgBox2DContactImpulse
    Dim b2ddr As lgBox2DDebugRenderer
    Dim b2ddj As lgBox2DDistanceJoint
    Dim b2ddjd As lgBox2DDistanceJointDef
    Dim b2des As lgBox2DEdgeShape
    Dim b2df As lgBox2DFilter
    Dim b2dfx As lgBox2DFixture
    Dim b2dfxd As lgBox2DFixtureDef
    Dim b2dfj As lgBox2DFrictionJoint
    Dim b2dfjd As lgBox2DFrictionJointDef
    Dim b2dgj As lgBox2DGearJoint
    Dim b2dgjd As lgBox2DGearJointDef
    Dim b2dj As lgBox2DJoint
    Dim b2djd As lgBox2DJointDef
    Dim b2dje As lgBox2DJointEdge
    Dim b2dm As lgBox2DManifold
    Dim b2dmp As lgBox2DManifoldPoint
    Dim b2dmd As lgBox2DMassData
    Dim b2dmj As lgBox2DMouseJoint
    Dim b2dmjd As lgBox2DMouseJointDef
    Dim b2dpe As lgBox2DParticleEmitter
    Dim b2dps As lgBox2DPolygonShape
    Dim b2dpj As lgBox2DPrismaticJoint
    Dim b2dpjd As lgBox2DPrismaticJointDef
    Dim b2dpu As lgBox2DPulleyJoint
    Dim b2dpud As lgBox2DPulleyJointDef
    Dim b2dqc As lgBox2DQueryCallback
    Dim b2drc As lgBox2DRayCastCallback
    Dim b2drj As lgBox2DRevoluteJoint
    Dim b2drjd As lgBox2DRevoluteJointDef
    Dim b2dro As lgBox2DRopeJoint
    Dim b2drod As lgBox2DRopeJointDef
    Dim b2ds As lgBox2DShape
    Dim b2dt As lgBox2DTransform
    Dim b2dwj As lgBox2DWeldJoint
    Dim b2dwjd As lgBox2DWeldJointDef
    Dim b2dwh As lgBox2DWheelJoint
    Dim b2dwhd As lgBox2DWheelJointDef
    Dim b2dwo As lgBox2DWorld
    Dim b2dwm As lgBox2DWorldManifold
    Dim cgs As lgCameraGroupStrategy
    Dim c As lgClipboard
    Dim co As lgColor
    Dim cfg As lgConfiguration
    Dim dec As lgDecal
    Dim dcb As lgDecalBatch
    Dim dgs As lgDefaultGroupStrategy
    Dim etd As lgETC1TextureData
    Dim fh As lgFileHandle
    Dim f As lgFiles
    Dim ftd As lgFileTextureData
    Dim far As lgFloatArray
    Dim fg As lgFontGenerator
    Dim fb As lgFrameBuffer
    Dim gd As lgGestureDetector
    Dim gl As lgGL
    Dim gl20 As lgGL20
    Dim gr As lgGraphics
    Dim i As lgInput
    Dim ip As lgInputProcessor
    Dim iar As lgIntArray
    Dim lw As lgLiveWallpaper
    Dim matm As lgMapAnimatedTiledMapTile
    Dim mampl As lgMapAtlasTmxMapLoader
    Dim mco As lgMapCircleMapObject
    Dim meo As lgMapEllipseMapObject
    Dim mhr As lgMapHexagonalTiledMapRenderer
    Dim misr As lgMapIsometricStaggeredTiledMapRenderer
    Dim mir As lgMapIsometricTiledMapRenderer
    Dim ml As lgMapLayer
    Dim mls As lgMapLayers
    Dim mo As lgMapObject
    Dim mos As lgMapObjects
    Dim mor As lgMapOrthogonalTiledMapRenderer
    Dim mpgo As lgMapPolygonMapObject
    Dim mplo As lgMapPolylineMapObject
    Dim mp As lgMapProperties
    Dim mro As lgMapRectangleMapObject
    Dim ms As lgMapStaticTiledMapTile
    Dim mto As lgMapTextureMapObject
    Dim mtdml As lgMaptIDEMapLoader
    Dim mtm As lgMapTiledMap
    Dim mtml As lgMapTiledMapLayer
    Dim mtmlc As lgMapTiledMapLayerCell
    Dim mtmt As lgMapTiledMapSet
    Dim mtmts As lgMapTiledMapSets
    Dim mtxml As lgMapTmxMapLoader
    Dim mtxmp As lgMapTmxMapLoaderParameters
    Dim mbz As lgMathBezier
    Dim mbb As lgMathBoundingBox
    Dim mbr As lgMathBresenham2
    Dim mbs As lgMathBSpline
    Dim mc As lgMathCatmullRomSpline
    Dim mci As lgMathCircle
    Dim mch As lgMathConvexHull
    Dim mec As lgMathEarClippingTriangulator
    Dim mel As lgMathEllipse
    Dim mfc As lgMathFloatCounter
    Dim mf As lgMathFrustum
    Dim mgu As lgMathGeometryUtils
    Dim mg2 As lgMathGridPoint2
    Dim mg3 As lgMathGridPoint3
    Dim mint As lgMathInterpolation
    Dim mi As lgMathIntersector
    Dim mimtv As lgMathIntersectorMinimumTranslationVector
    Dim mist As lgMathIntersectorSplitTriangle
    Dim mm3 As lgMathMatrix3
    Dim mm4 As lgMathMatrix4
    Dim mpl As lgMathPlane
    Dim mpog As lgMathPolygon
    Dim mpol As lgMathPolyline
    Dim mry As lgMathRay
    Dim mre As lgMathRectangle
    Dim msg As lgMathSegment
    Dim msp As lgMathSphere
    Dim mu As lgMathUtils
    Dim mv2 As lgMathVector2
    Dim mv3 As lgMathVector3
    Dim mwm As lgMathWindowedMean
    Dim msh As lgMesh
    Dim mip As lgMipMapGenerator
    Dim mus As lgMusic
    Dim nt As lgNet
    Dim np As lgNinePatch
    Dim oc As lgOrthographicCamera
    Dim pef As lgParticleEffect
    Dim pep As lgParticleEffectPool
    Dim pem As lgParticleEmitter
    Dim pgc As lgParticleGradientColorValue
    Dim prn As lgParticleRangedNumericValue
    Dim psn As lgParticleScaledNumericValue
    Dim pss As lgParticleSpawnShapeValue
    Dim pc As lgPerspectiveCamera
    Dim px As lgPixmap
    Dim pxio As lgPixmapIO
    Dim pxpk As lgPixmapPacker
    Dim pxpkp As lgPixmapPackerPage
    Dim pxt As lgPixmapTextureData
    Dim por As lgPolygonRegion
    Dim pos As lgPolygonSprite
    Dim pob As lgPolygonSpriteBatch
    Dim scs As lgScissorStack
    Dim s2da As lgScn2DAction
    Dim s2dac As lgScn2DActions
    Dim s2daor As lgScn2DActor
    Dim s2db As lgScn2DButton
    Dim s2dbg As lgScn2DButtonGroup
    Dim s2dbs As lgScn2DButtonStyle
    Dim s2dcl As lgScn2DClickListener
    Dim s2ddd As lgScn2DDragAndDrop
    Dim s2dddp As lgScn2DDragAndDropPayload
    Dim s2de As lgScn2DEvent
    Dim s2dgl As lgScn2DGestureListener
    Dim s2dgp As lgScn2DGroup
    Dim s2di As lgScn2DImage
    Dim s2die As lgScn2DInputEvent
    Dim s2dil As lgScn2DInputListener
    Dim s2dl As lgScn2DLabel
    Dim s2dls As lgScn2DLabelStyle
    Dim s2dlst As lgScn2DList
    Dim s2dlsts As lgScn2DListStyle
    Dim s2d9p As lgScn2DNinePatchDrawable
    Dim s2dpb As lgScn2DProgressBar
    Dim s2dpbs As lgScn2DProgressBarStyle
    Dim s2dsp As lgScn2DScrollPane
    Dim s2dsps As lgScn2DScrollPaneStyle
    Dim s2dsb As lgScn2DSelectBox
    Dim s2dsbs As lgScn2DSelectBoxStyle
    Dim s2dsl As lgScn2DSlider
    Dim s2dsls As lgScn2DSliderStyle
    Dim s2dspl As lgScn2DSplitPane
    Dim s2dspls As lgScn2DSplitPaneStyle
    Dim s2dsd As lgScn2DSpriteDrawable
    Dim s2dst As lgScn2DStack
    Dim s2ds As lgScn2DStage
    Dim s2dta As lgScn2DTable
    Dim s2dtac As lgScn2DTableCell
    Dim s2dtb As lgScn2DTextButton
    Dim s2dtbs As lgScn2DTextButtonStyle
    Dim s2dtf As lgScn2DTextField
    Dim s2dtfs As lgScn2DTextFieldStyle
    Dim s2dtrd As lgScn2DTextureRegionDrawable
    Dim s2dtld As lgScn2DTiledDrawable
    Dim s2dtp As lgScn2DTouchpad
    Dim s2dtps As lgScn2DTouchpadStyle
    Dim s2dw As lgScn2DWindow
    Dim s2dws As lgScn2DWindowStyle
    Dim sc As lgScreen
    Dim scm As lgScreenManager
    Dim ssk As lgServerSocket
    Dim sskh As lgServerSocketHints
    Dim shpg As lgShaderProgram
    Dim shr As lgShapeRenderer
    Dim sar As lgShortArray
    Dim sogs As lgSimpleOrthoGroupStrategy
    Dim sk As lgSocket
    Dim skh As lgSocketHints
    Dim so As lgSound
    Dim sp As lgSprite
    Dim spb As lgSpriteBatch
    Dim spch As lgSpriteCache
    Dim tx As lgTexture
    Dim ta As lgTextureAtlas
    Dim tar As lgTextureAtlasRegion
    Dim td As lgTextureData
    Dim tr As lgTextureRegion
    Dim va As lgVertexAttribute
    Dim vat As lgVertexAttributes
    Dim vatu As lgVertexAttributesUsage
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Thanks Informatix, Neil, I will certainly look seriously into this as I wasn't aware of this tutorial.

Great community support, so can't thank you enough!

Malky
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…