Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
creating_an_environment_with_boo [2015/08/22 21:45]
chris
creating_an_environment_with_boo [2016/01/18 19:03]
chris
Line 104: Line 104:
  # This passes custom parameters to the OrbitalRevolutionBase that  # This passes custom parameters to the OrbitalRevolutionBase that
  # describes how fast and in what position the Sun is in the sky  # describes how fast and in what position the Sun is in the sky
- super(0.01f, 0f, Math.PI, Math.PI / 2f)+ super(300f, 0f, Math.PI, Math.PI / 2f)
  self.InjectDependencies()  self.InjectDependencies()
  
Line 124: Line 124:
  
 ## Creating a sky layer ## Creating a sky layer
 +
 +{{ ::​skyfire.png?​direct&​200|}}
 +
 +For the sky layer, we're going to create a simple pattern in the sky.  You can download the texture I used on the right. ​ Make sure to save this to the same directory as the rest of your environment files.
 +
 +First, we will make a new descriptor class to define the sky layer.
 +<file boo SkyFire.boo>​
 +#include "​macros"​
 +import pluginbase.Objects.World.Environment.Sky
 +
 +class SkyFire(SkyLayerBase):​
 + @Dependency IResourceResolver _resolver
 + @DefaultConstructor
 +
 + @Declare RenderMode SkyLayerRenderMode.SphereTexture
 + @Declare Resource _resolver.Resolve("​environment/​skyfire.png"​)
 + @Declare Layer 9
 +</​file>​
 +
 +Next, we will add `SkyFire` to your Environment by adding it to the sky layers. ​ Note, that order doesn'​t matter here, as they are drawn by the Layer ranking, not the ordering.
 +
 +```boo
 + def CreateLayers():​
 + # Return a list of layers to be drawn in the sky
 + return (StarLayer(),​ SkyFire(), CloudLayer(),​ AtmosphereLayer( _orbitals ), FogSkirt(_fog,​ 0.05f, 0.2f) )
 +```
 +
 +If all goes well, you should get something that looks like:
 +
 +{{ ::​2015-08-24_203913.446.png?​600 |}}