![]()
![]()
![]()
![]()
![]()
![]()
This is the car body, glass and the lights. The headlights and reversing lights are difficult to see as their working pixels are white.) I’ve checked and checked and can’t see anything wrong with either. I’ve even built a color map of the sprites when they’re created and checked pixel by pixel for any alpha problem.
I tried to update an MP4 showing the problem but it won’t allow me to.
I really can’t get my head around why showing a sprite on one layer should affect another. I have changed code since my first post and as a test earlier I moved the hazzards to layer 0.7 just to see what would happen. I still have the problem with the car body and glass changing color, and the objects on layer 0.4 draw in a different order, the hedges end up on top of the trees when the hazzards are drawn. What on earth could cause this?
Draw Code:
` GraphicsDevice.Clear(Color.Black)
SB.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.LinearClamp, Nothing, Nothing, Nothing, Cam.TranslationMatrix)
'// BACKGROUND
SB.Draw(BackgroundRender, New Rectangle(0, 0, WorldWidth, WorldHeight), Nothing, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0)
''// BRIDGES is car is on top
If Car.CarOnTop = True Then
Car.DrawLayer = 0.3
Else
Car.DrawLayer = 0.1
End If
'// CAR
SB.Draw(ShadowTexture, New Vector2(Car.Position.X + 4, Car.Position.Y + 4), Nothing, New Color(0, 0, 0, 100), Car.Rotation + Rotate, Car.Centre, Car.Scale, SpriteEffects.None, Car.DrawLayer)
SB.Draw(Car.Texture, Car.Position, Nothing, New Color(100, 100, 200, 255), Car.Rotation + Rotate, Car.Centre, Car.Scale, SpriteEffects.None, Car.DrawLayer)
SB.Draw(CarGlassTexture, Car.Position, Nothing, Color.White, Car.Rotation + Rotate, Car.Centre, Car.Scale, SpriteEffects.None, Car.DrawLayer)
If Car.LightsOn = True Then
SB.Draw(HeadLightsTexture, Car.Position, Nothing, Color.White, Car.Rotation + Rotate, Car.Centre, Car.Scale, SpriteEffects.None, Car.DrawLayer)
End If
If Car.BrakesOn = True Then
SB.Draw(BrakelightsTexture, Car.Position, Nothing, Color.White, Car.Rotation + Rotate, Car.Centre, Car.Scale, SpriteEffects.None, Car.DrawLayer)
End If
If Car.Reversing = True Then
SB.Draw(ReverseLightTexture, Car.Position, Nothing, Color.White, Car.Rotation + Rotate, Car.Centre, Car.Scale, SpriteEffects.None, Car.DrawLayer)
End If
If (Car.LeftIndOn Or Car.Hazzards) And Car.IndRelay Then
SB.Draw(LeftITexture, Car.Position, Nothing, Color.White, Car.Rotation + Rotate, Car.Centre, Car.Scale, SpriteEffects.None, Car.DrawLayer)
End If
If (Car.RightIndOn Or Car.Hazzards) And Car.IndRelay Then
SB.Draw(RightITexture, Car.Position, Nothing, Color.White, Car.Rotation + Rotate, Car.Centre, Car.Scale, SpriteEffects.None, Car.DrawLayer)
End If
SB.Draw(BridgeRender, Vector2.Zero, Nothing, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0.2)
'// HEDGE AND TREES
SB.Draw(TreesTexture, Vector2.Zero, Nothing, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0.4)
SB.Draw(HedgeTexture, Vector2.Zero, Nothing, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0.4)
'// BOOM after collision
If Boom.Visible = True Then
SB.Draw(BoomTexture, Car.Position, Nothing, New Color(Boom.ColorValue, Boom.ColorValue, Boom.ColorValue, Boom.ColorValue), Boom.Rotation, Boom.Centre, Car.Scale, SpriteEffects.None, 0.4)
End If
SB.End()`