Game Development Community

Animation on Splash Screen

by Aaron Scovel · in Torque X 2D · 03/18/2011 (7:48 pm) · 4 replies

I'm wanting to play some animations on the splash screen, I'm guessing I need to load up a .txscene to access the animations?

What do you guys suggest?

About the author

Previously a PHP/MySQL Programmer/Web Developer of 10 years. In Aug 2010 I decided to change careers, and this is were I landed! I also parent 3 kids full time. TopNotched.com


#1
03/19/2011 (6:35 am)
Yep - I always do splash screens as tx scenes. Although you can create animations without a tx scene I just find it's simpler and more consistent (but, then I do also use scenes for my UI overlays as well, so very little tx GUI usage in my stuff).
#2
03/20/2011 (10:17 pm)
Hey, thanks for the reassurance Duncan! Its always nice to get additional input when I'm not 100% sure :-) Got it working last night.
#3
04/20/2011 (7:24 am)
Hey guys, I'm running into the same thing. I've created a GUISceneview that loads up an XML file to display GUIBitmaps. I've tried to add an animation in the XML by adding the following:

<Materials>

      <SimpleMaterial name="BallExplosionBlue_spriteSheetMaterial" type="GarageGames.Torque.Materials.SimpleMaterial">
        <TextureFilename>data/images/Projectiles/Balls/BallExplosionBlue_spriteSheet.png</TextureFilename>
        <IsTranslucent>false</IsTranslucent>
        <IsAdditive>false</IsAdditive>
        <TextureDivider type="GarageGames.Torque.Materials.CellCountDivider">
          <CellCountX>12</CellCountX>
          <CellCountY>1</CellCountY>
        </TextureDivider>
      </SimpleMaterial>
      
    </Materials>
        
    <Objects>

      <AnimationData name="BallExplosionBlue">
        <Material nameRef="BallExplosionBlue_spriteSheetMaterial" />
        <AnimationFrames>0 1 2 3 4 5 6 7 8 9 10 11</AnimationFrames>
        <AnimationDuration>0.4</AnimationDuration>
        <AnimationCycle>false</AnimationCycle>
      </AnimationData>

      <AnimatedSprite name="GoldAnimation">
        <CreateWithPhysics>false</CreateWithPhysics>
        <CreateWithCollision>false</CreateWithCollision>
        <ObjectType>
          <object objTypeRef="t2dAnimatedSpriteType" />
        </ObjectType>
        <Pool>false</Pool>
        <PoolWithComponents>false</PoolWithComponents>
        <IsTemplate>false</IsTemplate>
        <IsPersistent>false</IsPersistent>
        <Layer>1</Layer>
        <Size>
          <X>64.000</X>
          <Y>64.000</Y>
        </Size>
        <Position>
          <X>1905.871</X>
          <Y>-720.393</Y>
        </Position>
        <Rotation>0</Rotation>
        <CollisionsEnabled>false</CollisionsEnabled>
        <Visible>true</Visible>
        <VisibilityLevel>1</VisibilityLevel>
        <FlipX>false</FlipX>
        <FlipY>false</FlipY>
        <SortPoint>
          <X>0.000000</X>
          <Y>0.000000</Y>
        </SortPoint>
        <AnimationData nameRef="BallExplosionBlue" />
        <StartFrame>0</StartFrame>
        <RandomStart>false</RandomStart>
        <PlayOnLoad>true</PlayOnLoad>
        <RemoveOnFinished>true</RemoveOnFinished>
      </AnimatedSprite>
      
      </Objects>

However, when I try to load the animation from my GUISceneview with the following line:

T2DAnimatedSprite GoldAnimation = TorqueObjectDatabase.Instance.FindObject<T2DAnimatedSprite>("GoldAnimation");

... the object returns as null.
Any idea what I am missing?
#4
04/28/2011 (7:37 pm)
@Arden: Originally I was having a similar issue. I ended up using a .txscene to handle the animations and made a "fader component" for the fade in/out. I also ran a basic GUISceneview in the background to handle some controls.