11# Nebula-Generator
22A nebula generator writted with libgdx
33
4+ Ensure that you have jitpack dependencies source in your ` build.gradle ` :
5+ ``` gradle
6+ allprojects {
7+ repositories {
8+ ...
9+ maven { url 'https://jitpack.io' }
10+ }
11+ }
12+ ```
13+ Then, add this dependencie:
14+ ``` gradle
15+ dependencies {
16+ implementation 'com.github.alyrow:Nebula-Generator:v1.0.0'
17+ }
18+ ```
19+
420## Basic usages
521A generator is defined by:
622``` java
@@ -75,6 +91,7 @@ nebulasGenerator.addGenerator(generator2);
7591
7692Pixmap nebula = nebulasGenerator. generatePixmapNebulasBlendedWithAPixmap(new Pixmap (Gdx . files. absolute(" path to stars background" )));
7793````
94+ ! [](https: // github.com/alyrow/Nebula-Generator/raw/master/screenshots/Without%20gamma%20correction%20and%20alpha%20%3D%201.png)
7895##### Without gamma correction and alpha = 3
7996```java
8097NebulaGenerator generator1 = new NebulaGenerator (Gdx . graphics. getWidth(), Gdx . graphics. getHeight(), NebulaGenerator . NoiseType . FOAM_NOISE , 283 , 12 ,
@@ -89,6 +106,7 @@ nebulasGenerator.addGenerator(generator2);
89106
90107Pixmap nebula = nebulasGenerator. generatePixmapNebulasBlendedWithAPixmap(new Pixmap (Gdx . files. absolute(" path to stars background" )));
91108````
109+ ! [](https: // github.com/alyrow/Nebula-Generator/raw/master/screenshots/Without%20gamma%20correction%20and%20alpha%20%3D%203.png)
92110##### With gamma correction and alpha = 1
93111```java
94112NebulaGenerator generator1 = new NebulaGenerator (Gdx . graphics. getWidth(), Gdx . graphics. getHeight(), NebulaGenerator . NoiseType . FOAM_NOISE , 283 , 12 ,
@@ -103,6 +121,7 @@ nebulasGenerator.addGenerator(generator2);
103121
104122Pixmap nebula = nebulasGenerator. generatePixmapNebulasBlendedWithAPixmapGammaCorrection(new Pixmap (Gdx . files. absolute(" path to stars background" )));
105123````
124+ ! [](https: // github.com/alyrow/Nebula-Generator/raw/master/screenshots/With%20gamma%20correction%20and%20alpha%20%3D%201.png)
106125##### With gamma correction and alpha = 3
107126```java
108127NebulaGenerator generator1 = new NebulaGenerator (Gdx . graphics. getWidth(), Gdx . graphics. getHeight(), NebulaGenerator . NoiseType . FOAM_NOISE , 283 , 12 ,
@@ -117,7 +136,7 @@ nebulasGenerator.addGenerator(generator2);
117136
118137Pixmap nebula = nebulasGenerator. generatePixmapNebulasBlendedWithAPixmapGammaCorrection(new Pixmap (Gdx . files. absolute(" path to stars background" )));
119138````
120-
139+ ! [](https : // github.com/alyrow/Nebula-Generator/raw/master/screenshots/With%20gamma%20correction%20and%20alpha%20%3D%203.png)
121140#### Fog :
122141Yes nebula can be used for other things than nebulas!
123142Not perfect but a good start.
@@ -135,5 +154,6 @@ nebulasGenerator.addGenerator(generator2);
135154Pixmap nebula = nebulasGenerator. generatePixmapNebulasBlendedWithAPixmapGammaCorrection(new Pixmap (Gdx . files. absolute(" path to forest.png" )));
136155```
137156##### Orgininal image:
138-
157+ ! [](https : // github.com/alyrow/Nebula-Generator/raw/master/screenshots/forest.png)
139158##### With fog:
159+ ! [](https: // github.com/alyrow/Nebula-Generator/raw/master/screenshots/fog.png)
0 commit comments