コード例 #1
0
 public void update(double horizon)
 {
     position.X -= (1 - (position.Y / 700f)) * speed;
     if (position.X < -168 * 4f)
     {
         position.X = Game1.viewport.Width + (168 * 4f);
         position.Y = (float)(cloudRandom.NextDouble() * horizon);
         sprite     = cloudRandom.Next(5);
     }
     //Sun rising
     if (Game1.timeOfDay >= dawnTime && Game1.timeOfDay < dayTime)
     {
         c = DynamicSky.getRampedColor(dawnTint, dayTint, dawnTime, dayTime);
     }
     //Day time
     else if (Game1.timeOfDay >= dayTime && Game1.timeOfDay < eveningTime)
     {
         c = dayTint;
     }
     //Sun setting
     else if (Game1.timeOfDay >= eveningTime && Game1.timeOfDay < sunsetTime)
     {
         c = DynamicSky.getRampedColor(dayTint, sunsetTint, eveningTime, sunsetTime);
     }
     //Dusk
     else if (Game1.timeOfDay >= sunsetTime && Game1.timeOfDay < nightTime)
     {
         c = DynamicSky.getRampedColor(sunsetTint, nightTint, sunsetTime, nightTime);
     }
     //Night
     else
     {
         c = nightTint;
     }
 }
コード例 #2
0
ファイル: SkyHandler.cs プロジェクト: mjSurber/Map-Utilities
 public static void init()
 {
     sky = new DynamicSky((Texture2D)Loader.loader.Load <Texture2D>("Content/Sky/SkyGradient.png", StardewModdingAPI.ContentSource.ModFolder), (Texture2D)Loader.loader.Load <Texture2D>("Content/Sky/Stars.png", StardewModdingAPI.ContentSource.ModFolder));
 }