Animation fixes
This commit is contained in:
parent
a005b60ad9
commit
df992888a2
|
@ -26,7 +26,7 @@
|
|||
FadeOut
|
||||
End Enum
|
||||
|
||||
Public Sub New(ByVal Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Duration As Single, Optional ByVal AfterFadeInOpacity As Single = 1.0F, Optional ByVal FadeInSpeed As Single = 0.125F, Optional ByVal FadeOutSpeed As Single = 0.125F, Optional ByVal DoTile As Boolean = False, Optional ByVal AnimationWidth As Integer = -1, Optional ByVal AnimationLength As Integer = 1, Optional ByVal AnimationSpeed As Integer = 2, Optional TextureScale As Integer = 4)
|
||||
Public Sub New(ByVal Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Duration As Single, Optional ByVal AfterFadeInOpacity As Single = 1.0F, Optional ByVal FadeInSpeed As Single = 0.125F, Optional ByVal FadeOutSpeed As Single = 0.125F, Optional ByVal DoTile As Boolean = False, Optional ByVal AnimationLength As Integer = 1, Optional ByVal AnimationSpeed As Integer = 2, Optional TextureScale As Integer = 4)
|
||||
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
|
||||
Me.Texture = Texture
|
||||
Me.Duration = Duration
|
||||
|
@ -34,14 +34,14 @@
|
|||
Me.FadeInSpeed = FadeInSpeed
|
||||
Me.FadeOutSpeed = FadeOutSpeed
|
||||
Me.DoTile = DoTile
|
||||
Me.AnimationWidth = AnimationWidth
|
||||
Me.AnimationWidth = CInt(Texture.Width / AnimationLength)
|
||||
Me.AnimationLength = AnimationLength
|
||||
DurationWhole = CSng(Math.Truncate(CDbl(Duration)))
|
||||
DurationFraction = CSng((Duration - DurationWhole) * 1000)
|
||||
Me.TextureScale = TextureScale
|
||||
|
||||
If Me.AnimationWidth <> -1 OrElse Me.AnimationWidth <> Nothing Then
|
||||
BackgroundAnimation = New Animation(Me.Texture, 1, CInt(Me.Texture.Width / Me.AnimationWidth), Me.AnimationWidth, Me.Texture.Height, AnimationSpeed * 24, 0, 0)
|
||||
BackgroundAnimation = New Animation(Me.Texture, 1, AnimationLength, Me.AnimationWidth, Me.Texture.Height, AnimationSpeed * 24, 0, 0)
|
||||
CurrentRectangle = BackgroundAnimation.TextureRectangle
|
||||
Else
|
||||
Me.AnimationWidth = Texture.Width
|
||||
|
|
|
@ -194,6 +194,12 @@
|
|||
MoveEntity = Entity
|
||||
End If
|
||||
|
||||
If Not BattleFlipped = Nothing Then
|
||||
If BattleFlipped = True Then
|
||||
Distance.Z *= -1.0F
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim DurationWhole = CSng(Math.Truncate(CDbl(Duration)))
|
||||
Dim DurationFraction = CSng((Duration - DurationWhole) * 1000)
|
||||
Dim DurationTime As TimeSpan = New TimeSpan(0, 0, 0, CInt(DurationWhole), CInt(DurationFraction))
|
||||
|
@ -287,8 +293,8 @@
|
|||
AnimationSequence.Add(baSound)
|
||||
End Sub
|
||||
|
||||
Public Sub AnimationBackground(ByVal Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Duration As Single, Optional ByVal AfterFadeInOpacity As Single = 1.0F, Optional ByVal FadeInSpeed As Single = 0.125F, Optional ByVal FadeOutSpeed As Single = 0.125F, Optional ByVal DoTile As Boolean = False, Optional ByVal AnimationWidth As Integer = -1, Optional ByVal AnimationLength As Integer = 1, Optional ByVal AnimationSpeed As Integer = 4, Optional ByVal Scale As Integer = 4)
|
||||
Dim baBackground As BABackground = New BABackground(Texture, startDelay, endDelay, Duration, AfterFadeInOpacity, FadeInSpeed, FadeOutSpeed, DoTile, AnimationWidth, AnimationLength, AnimationSpeed, Scale)
|
||||
Public Sub AnimationBackground(ByVal Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Duration As Single, Optional ByVal AfterFadeInOpacity As Single = 1.0F, Optional ByVal FadeInSpeed As Single = 0.125F, Optional ByVal FadeOutSpeed As Single = 0.125F, Optional ByVal DoTile As Boolean = False, Optional ByVal AnimationLength As Integer = 1, Optional ByVal AnimationSpeed As Integer = 4, Optional ByVal Scale As Integer = 4)
|
||||
Dim baBackground As BABackground = New BABackground(Texture, startDelay, endDelay, Duration, AfterFadeInOpacity, FadeInSpeed, FadeOutSpeed, DoTile, AnimationLength, AnimationSpeed, Scale)
|
||||
AnimationSequence.Add(baBackground)
|
||||
End Sub
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC)
|
||||
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip, True)
|
||||
MoveAnimation.AnimationPlaySound("Battle\Attacks\Psychic\Psychic", 0.0F, 0)
|
||||
MoveAnimation.AnimationBackground(TextureManager.GetTexture("Textures\Battle\Psychic\PsychicBackground"), 0, 0, 1.5F, 0.6F, 0.075F, 0.075F, True, 32, 11, 2, 6)
|
||||
MoveAnimation.AnimationBackground(TextureManager.GetTexture("Textures\Battle\Psychic\PsychicBackground"), 0, 0, 1.5F, 0.6F, 0.075F, 0.075F, True, 11, 2, 6)
|
||||
|
||||
MoveAnimation.AnimationMove(Nothing, False, 0, 0, -0.1, 0.025, False, False, 1, 0.5)
|
||||
MoveAnimation.AnimationMove(Nothing, False, 0, 0, 0.1, 0.025, False, False, 1.75, 0.5)
|
||||
|
|
Loading…
Reference in New Issue