/* Relatively positioned textured background 1.0, by Violet CLM http://www.jazz2online.com/snippets/140/relatively-positioned-textured-background/ */ //you may customize these four values const float FadePosXMin = 0.0; const float FadePosXMax = 1.0; const float FadePosYMin = 0.0; const float FadePosYMax = 1.0; const int LevelWidth = jjLayers[4].width * 32; const int LevelHeight = jjLayers[4].height * 32; const float LevelWidthF = float(LevelWidth); const float LevelHeightF = float(LevelHeight); const float FadePosXRange = FadePosXMax - FadePosXMin; const float FadePosYRange = FadePosYMax - FadePosYMin; void onDrawLayer4(jjPLAYER@ play, jjCANVAS@) { const jjPLAYER@ nextPlayer = jjLocalPlayers[(play.localPlayerID + 1) % jjLocalPlayerCount]; if (LevelWidth != jjSubscreenWidth) jjTexturedBGFadePositionX = (1.0 - float(nextPlayer.cameraX) / (LevelWidthF - jjSubscreenWidth)) * FadePosXRange + FadePosXMin; else jjTexturedBGFadePositionX = 0.5; //don't divide by zero! if (LevelHeight != jjSubscreenHeight) jjTexturedBGFadePositionY = (1.0 - float(nextPlayer.cameraY) / (LevelHeightF - jjSubscreenHeight)) * FadePosYRange + FadePosYMin; else jjTexturedBGFadePositionY = 0.5; //don't divide by zero! }