public class MapUtility
extends java.lang.Object
Constructor and Description |
---|
MapUtility() |
Modifier and Type | Method and Description |
---|---|
static float[][] |
fillDefaultBGColorsFloat(float[][] packed,
char[][] map)
Fills an existing float[][] with packed float colors that correspond to appropriate default background colors for
the usual meanings of the chars in map.
|
static float[][] |
fillDefaultBGColorsFloat(float[][] packed,
char[][] map,
char deepChar,
float deepColor,
char shallowChar,
float shallowColor)
Fills an existing float[][] with packed float colors that correspond to appropriate default background colors for
the usual meanings of the chars in map.
|
static float[][] |
fillDefaultBGColorsFloat(float[][] packed,
char[][] map,
char deepChar,
float deepColor,
char shallowChar,
float shallowColor,
float hueChange,
float saturationChange,
float valueChange)
Fills an existing float[][] with packed float colors that correspond to appropriate default background colors for
the usual meanings of the chars in map.
|
static float[][] |
fillDefaultBGColorsFloat(float[][] packed,
char[][] map,
float hueChange,
float saturationChange,
float valueChange)
Fills an existing float[][] with packed float colors that correspond to appropriate default background colors for
the usual meanings of the chars in map.
|
static float[][] |
fillDefaultColorsFloat(float[][] packed,
char[][] map)
Fills an existing float[][] with packed float colors that correspond to appropriate default colors for the usual
meanings of the chars in map.
|
static float[][] |
fillDefaultColorsFloat(float[][] packed,
char[][] map,
char deepChar,
float deepColor,
char shallowChar,
float shallowColor)
Produces a float[][] that corresponds to appropriate default colors for the usual meanings of the chars in map.
|
static float[][] |
fillDefaultColorsFloat(float[][] packed,
char[][] map,
char deepChar,
float deepColor,
char shallowChar,
float shallowColor,
float hueChange,
float saturationChange,
float valueChange)
Produces a float[][] that corresponds to appropriate default colors for the usual meanings of the chars in map.
|
static float[][] |
fillDefaultColorsFloat(float[][] packed,
char[][] map,
float hueChange,
float saturationChange,
float valueChange)
Fills an existing float[][] with packed float colors that correspond to appropriate default colors for the usual
meanings of the chars in map.
|
static int[][] |
fillLightnessModifiers(int[][] lights,
char[][] map)
Fills an existing int[][] with lighting values that can be used with SquidLayers to alter the background colors.
|
static int[][] |
fillLightnessModifiers(int[][] lights,
char[][] map,
double frame)
Fills an existing int[][] with lighting values that can be used with SquidLayers to alter the background colors,
accepting a parameter for animation frame if rippling water and waving grass using SeededNoise are desired.
|
static int[][] |
fillLightnessModifiers(int[][] lights,
char[][] map,
double frame,
char deepLiquid,
char shallowLiquid)
Fills an existing int[][] with lighting values that can be used with SquidLayers to alter the background colors,
accepting a parameter for animation frame if rippling water and waving grass using SeededNoise are desired.
|
static float[][] |
fillLinesToBoxes(float[][] into,
char[][] map,
float[][] colors)
Meant to be used with
TextCellFactory.draw(Batch, float[][], float, float, int, int) , this finds the
box-drawing characters in map and fills 3x3 boxes in into with the matching color from
colors in the shape of that box-drawing character. |
static com.badlogic.gdx.graphics.Color[][] |
generateDefaultBGColors(char[][] map)
Produces a Color[][] that corresponds to appropriate default background colors for the usual meanings of the
chars in map.
|
static com.badlogic.gdx.graphics.Color[][] |
generateDefaultBGColors(char[][] map,
char deepChar,
com.badlogic.gdx.graphics.Color deepColor,
char shallowChar,
com.badlogic.gdx.graphics.Color shallowColor)
Produces a Color[][] that corresponds to appropriate default background colors for the usual meanings of the
chars in map.
|
static float[][] |
generateDefaultBGColorsFloat(char[][] map)
Produces a float[][] of packed float colors that corresponds to appropriate default background colors for the
usual meanings of the chars in map.
|
static float[][] |
generateDefaultBGColorsFloat(char[][] map,
char deepChar,
float deepColor,
char shallowChar,
float shallowColor)
Produces a float[][] of packed float colors that corresponds to appropriate default background colors for the
usual meanings of the chars in map.
|
static float[][] |
generateDefaultBGColorsFloat(char[][] map,
char deepChar,
float deepColor,
char shallowChar,
float shallowColor,
float hueChange,
float saturationChange,
float valueChange)
Produces a float[][] of packed float colors that corresponds to appropriate default background colors for the
usual meanings of the chars in map.
|
static float[][] |
generateDefaultBGColorsFloat(char[][] map,
float hueChange,
float saturationChange,
float valueChange)
Produces a float[][] of packed float colors that corresponds to appropriate default background colors for the
usual meanings of the chars in map.
|
static com.badlogic.gdx.graphics.Color[][] |
generateDefaultColors(char[][] map)
Produces a Color[][] that corresponds to appropriate default colors for the usual meanings of the chars in map.
|
static com.badlogic.gdx.graphics.Color[][] |
generateDefaultColors(char[][] map,
char deepChar,
com.badlogic.gdx.graphics.Color deepColor,
char shallowChar,
com.badlogic.gdx.graphics.Color shallowColor)
Produces a Color[][] that corresponds to appropriate default colors for the usual meanings of the chars in map.
|
static float[][] |
generateDefaultColorsFloat(char[][] map)
Produces a float[][] that corresponds to appropriate default colors for the usual meanings of the chars in map.
|
static float[][] |
generateDefaultColorsFloat(char[][] map,
char deepChar,
float deepColor,
char shallowChar,
float shallowColor)
Produces a float[][] that corresponds to appropriate default colors for the usual meanings of the chars in map.
|
static float[][] |
generateDefaultColorsFloat(char[][] map,
char deepChar,
float deepColor,
char shallowChar,
float shallowColor,
float hueChange,
float saturationChange,
float valueChange)
Produces a float[][] that corresponds to appropriate default colors for the usual meanings of the chars in map.
|
static float[][] |
generateDefaultColorsFloat(char[][] map,
float hueChange,
float saturationChange,
float valueChange)
Produces a float[][] that corresponds to appropriate default colors for the usual meanings of the chars in map.
|
static int[][] |
generateLightnessModifiers(char[][] map)
Produces an int[][] that can be used with SquidLayers to alter the background colors.
|
static int[][] |
generateLightnessModifiers(char[][] map,
double frame)
Produces an int[][] that can be used with SquidLayers to alter the background colors, accepting a parameter for
animation frame if rippling water and waving grass using SeededNoise are desired.
|
static int[][] |
generateLightnessModifiers(char[][] map,
double frame,
char deepLiquid,
char shallowLiquid)
Produces an int[][] that can be used with SquidLayers to alter the background colors, accepting a parameter for
animation frame if rippling water and waving grass using SeededNoise are desired.
|
static float[][] |
generateLinesToBoxes(char[][] map,
float[][] colors)
Meant to be used with
TextCellFactory.draw(Batch, float[][], float, float, int, int) , this produces a
triple-width, triple-height float color array by finding the box-drawing characters in map and placing
3x3 boxes into that triple-size array with the matching color from colors in the shape of that
box-drawing character. |
public static com.badlogic.gdx.graphics.Color[][] generateDefaultColors(char[][] map)
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
.map
- a char[][] containing foreground characterspublic static com.badlogic.gdx.graphics.Color[][] generateDefaultColors(char[][] map, char deepChar, com.badlogic.gdx.graphics.Color deepColor, char shallowChar, com.badlogic.gdx.graphics.Color shallowColor)
SectionDungeonGenerator
can produce) and a Color to use for that deep liquid, as well as a char for shallow lakes and a Color for that
shallow liquid.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
. Deep and shallow lakes of non-water will use the given
Color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you don't need
this overload, and generateDefaultColors(char[][])
will be fine.map
- a char[][] containing foreground charactersdeepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the Color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the Color to use for shallow parts of non-water lakespublic static float[][] generateDefaultColorsFloat(char[][] map)
SparseLayers
primarily uses this kind of packed float
to represent colors, and SquidPanel
uses it internally.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
.map
- a char[][] containing foreground characterspublic static float[][] fillDefaultColorsFloat(float[][] packed, char[][] map)
SparseLayers
primarily
uses this kind of packed float to represent colors, and SquidPanel
uses it internally.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
.packed
- a float[][] that will be modified, filled with packed float colors; must match map's sizemap
- a char[][] containing foreground characterspublic static float[][] generateDefaultColorsFloat(char[][] map, char deepChar, float deepColor, char shallowChar, float shallowColor)
SparseLayers
primarily uses this kind of packed float
to represent colors, and SquidPanel
uses it internally. This overload also takes a char that corresponds
to deep non-water lakes (which SectionDungeonGenerator
can produce) and a
packed float color to use for that deep liquid, as well as a char for shallow lakes and another packed float
color for that shallow liquid.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
. Deep and shallow lakes of non-water will use the given
packed float color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you
don't need this overload, and generateDefaultColorsFloat(char[][])
will be fine.map
- a char[][] containing foreground charactersdeepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the packed float color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the packed float color to use for shallow parts of non-water lakespublic static float[][] fillDefaultColorsFloat(float[][] packed, char[][] map, char deepChar, float deepColor, char shallowChar, float shallowColor)
SparseLayers
primarily uses this kind of packed float
to represent colors, and SquidPanel
uses it internally. This overload also takes a char that corresponds
to deep non-water lakes (which SectionDungeonGenerator
can produce) and a
packed float color to use for that deep liquid, as well as a char for shallow lakes and another packed float
color for that shallow liquid.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
. Deep and shallow lakes of non-water will use the given
packed float color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you
don't need this overload, and generateDefaultColorsFloat(char[][])
will be fine.packed
- a float[][] that will be modified, filled with packed float colors; must match map's sizemap
- a char[][] containing foreground charactersdeepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the packed float color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the packed float color to use for shallow parts of non-water lakespublic static float[][] generateDefaultColorsFloat(char[][] map, float hueChange, float saturationChange, float valueChange)
SparseLayers
primarily uses this kind of packed float to represent colors,
and SquidPanel
uses it internally.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
.map
- a char[][] containing foreground charactershueChange
- a float from -1f to 1f that will be added to the hues of colors this usessaturationChange
- a float from -1f to 1f that will be added to the saturation of colors this usesvalueChange
- a float from -1f to 1f that will be added to the values of colors this usespublic static float[][] fillDefaultColorsFloat(float[][] packed, char[][] map, float hueChange, float saturationChange, float valueChange)
SparseLayers
primarily uses this kind of
packed float to represent colors, and SquidPanel
uses it internally.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
.packed
- a float[][] that will be modified, filled with packed float colors; must match map's sizemap
- a char[][] containing foreground charactershueChange
- a float from -1f to 1f that will be added to the hues of colors this usessaturationChange
- a float from -1f to 1f that will be added to the saturation of colors this usesvalueChange
- a float from -1f to 1f that will be added to the values of colors this usespublic static float[][] generateDefaultColorsFloat(char[][] map, char deepChar, float deepColor, char shallowChar, float shallowColor, float hueChange, float saturationChange, float valueChange)
SparseLayers
primarily uses this kind of packed float
to represent colors, and SquidPanel
uses it internally. This overload also takes a char that corresponds
to deep non-water lakes (which SectionDungeonGenerator
can produce) and a
packed float color to use for that deep liquid, as well as a char for shallow lakes and another packed float
color for that shallow liquid.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
. Deep and shallow lakes of non-water will use the given
packed float color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you
don't need this overload, and generateDefaultColorsFloat(char[][])
will be fine.map
- a char[][] containing foreground charactersdeepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the packed float color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the packed float color to use for shallow parts of non-water lakeshueChange
- a float from -1f to 1f that will be added to the hues of colors this usessaturationChange
- a float from -1f to 1f that will be added to the saturation of colors this usesvalueChange
- a float from -1f to 1f that will be added to the values of colors this usespublic static float[][] fillDefaultColorsFloat(float[][] packed, char[][] map, char deepChar, float deepColor, char shallowChar, float shallowColor, float hueChange, float saturationChange, float valueChange)
SparseLayers
primarily uses this kind of packed float
to represent colors, and SquidPanel
uses it internally. This overload also takes a char that corresponds
to deep non-water lakes (which SectionDungeonGenerator
can produce) and a
packed float color to use for that deep liquid, as well as a char for shallow lakes and another packed float
color for that shallow liquid.
SColor.LIMITED_PALETTE
; if that field is changed then the colors this returns
will also change. Tiles containing nothing but a floor ('.') will be silver-gray; this can be changed by editing
SColor.LIMITED_PALETTE[3]
. Walls are brownish-black, and can be '#' marks or box-drawing lines; this can
be changed by editing SColor.LIMITED_PALETTE[2]
.Doors ('+' and '/' in the map) will be rust brown; this
can be changed by editing SColor.LIMITED_PALETTE[4]
. Both shallow and deep water (',' and '~') will be
gray-blue; this can be changed by editing SColor.LIMITED_PALETTE[5]
. Traps ('^') will be shown in bright
orange; this can be changed by editing SColor.LIMITED_PALETTE[6]
. Grass ('"') will be the expected green;
this can be changed by editing SColor.LIMITED_PALETTE[20]
. Anything else will use white; this can be
changed by editing SColor.LIMITED_PALETTE[1]
. Deep and shallow lakes of non-water will use the given
packed float color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you
don't need this overload, and generateDefaultColorsFloat(char[][])
will be fine.packed
- a float[][] that will be modified, filled with packed float colors; must match map's sizemap
- a char[][] containing foreground charactersdeepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the packed float color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the packed float color to use for shallow parts of non-water lakeshueChange
- a float from -1f to 1f that will be added to the hues of colors this usessaturationChange
- a float from -1f to 1f that will be added to the saturation of colors this usesvalueChange
- a float from -1f to 1f that will be added to the values of colors this usespublic static com.badlogic.gdx.graphics.Color[][] generateDefaultBGColors(char[][] map)
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black. but deep water ('~') will be dark
blue-green, shallow water (',') will be a lighter blue-green, and grass ('"') will be dark green.
You can adjust the brightness of the backgrounds using generateLightnessModifiers(char[][])
, or if you
want water and grass to ripple, you can use the overload generateLightnessModifiers(char[][], double)
with some rising frame count.map
- a char[][] containing foreground characters (this gets their background color)public static com.badlogic.gdx.graphics.Color[][] generateDefaultBGColors(char[][] map, char deepChar, com.badlogic.gdx.graphics.Color deepColor, char shallowChar, com.badlogic.gdx.graphics.Color shallowColor)
SectionDungeonGenerator
can produce) and a Color to use for that deep liquid,
as well as a char for shallow lakes and a Color for that shallow liquid.
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black, but deep water ('~') will be dark
blue-green, shallow water (',') will be a lighter blue-green, and grass ('"') will be dark green.
Deep and shallow lakes of non-water will use the given Colors. If you are using SectionDungeonGenerator to
produce normal water lakes, then you don't need this overload, and
generateDefaultBGColors(char[][])
will be fine.
You can adjust the brightness of the backgrounds using generateLightnessModifiers(char[][])
, or if you
want water, grass, and lakes to ripple, you can use the overload
generateLightnessModifiers(char[][], double, char, char)
with some rising frame count.map
- a char[][] containing foreground characters (this gets their background color)deepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the Color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the Color to use for shallow parts of non-water lakespublic static float[][] generateDefaultBGColorsFloat(char[][] map)
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black; this can be changed by editing
SColor.LIMITED_PALETTE[0]
. Deep water ('~') will be dark blue-green; this can be changed by editing
SColor.LIMITED_PALETTE[24]
. Shallow water (',') will be a lighter blue-green; this can be changed by
editing SColor.LIMITED_PALETTE[23]
. Grass ('"') will be dark green; this can be changed by editing
SColor.LIMITED_PALETTE[21]
. Bridges (':') will be a medium-dark beige color; this can be changed by
editing SColor.LIMITED_PALETTE[35]
. You can adjust the brightness of the backgrounds using
generateLightnessModifiers(char[][])
, or if you want water and grass to ripple, you can use the overload
generateLightnessModifiers(char[][], double, char, char)
with some rising frame or millisecond count.map
- a char[][] containing foreground characters (this gets their background color)public static float[][] fillDefaultBGColorsFloat(float[][] packed, char[][] map)
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black; this can be changed by editing
SColor.LIMITED_PALETTE[0]
. Deep water ('~') will be dark blue-green; this can be changed by editing
SColor.LIMITED_PALETTE[24]
. Shallow water (',') will be a lighter blue-green; this can be changed by
editing SColor.LIMITED_PALETTE[23]
. Grass ('"') will be dark green; this can be changed by editing
SColor.LIMITED_PALETTE[21]
. Bridges (':') will be a medium-dark beige color; this can be changed by
editing SColor.LIMITED_PALETTE[35]
. You can adjust the brightness of the backgrounds using
generateLightnessModifiers(char[][])
, or if you want water and grass to ripple, you can use the overload
generateLightnessModifiers(char[][], double, char, char)
with some rising frame or millisecond count.packed
- a float[][] that will be modified, filled with packed float colors; must match map's sizemap
- a char[][] containing foreground characters (this gets their background color)public static float[][] generateDefaultBGColorsFloat(char[][] map, char deepChar, float deepColor, char shallowChar, float shallowColor)
SectionDungeonGenerator
can produce) and a packed float color to use
for that deep liquid, as well as a char for shallow lakes and a packed float color for that shallow liquid.
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black; this can be changed by editing
SColor.LIMITED_PALETTE[0]
. Deep water ('~') will be dark blue-green; this can be changed by editing
SColor.LIMITED_PALETTE[24]
. Shallow water (',') will be a lighter blue-green; this can be changed by
editing SColor.LIMITED_PALETTE[23]
. Grass ('"') will be dark green; this can be changed by editing
SColor.LIMITED_PALETTE[21]
. Bridges (':') will be a medium-dark beige color; this can be changed by
editing SColor.LIMITED_PALETTE[35]
. Deep and shallow lakes of non-water will use the given packed float
color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you don't need
this overload, and generateDefaultBGColorsFloat(char[][])
will be fine. You can adjust the brightness of
the backgrounds using generateLightnessModifiers(char[][])
, or if you want water, grass, and lakes to
ripple, you can use the overload generateLightnessModifiers(char[][], double, char, char)
with some
rising frame or millisecond count.map
- a char[][] containing foreground characters (this gets their background color)deepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the packed float color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the packed float color to use for shallow parts of non-water lakespublic static float[][] fillDefaultBGColorsFloat(float[][] packed, char[][] map, char deepChar, float deepColor, char shallowChar, float shallowColor)
SectionDungeonGenerator
can produce) and a packed float color to use
for that deep liquid, as well as a char for shallow lakes and a packed float color for that shallow liquid. The
sizes of packed and map should be identical.
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black; this can be changed by editing
SColor.LIMITED_PALETTE[0]
. Deep water ('~') will be dark blue-green; this can be changed by editing
SColor.LIMITED_PALETTE[24]
. Shallow water (',') will be a lighter blue-green; this can be changed by
editing SColor.LIMITED_PALETTE[23]
. Grass ('"') will be dark green; this can be changed by editing
SColor.LIMITED_PALETTE[21]
. Bridges (':') will be a medium-dark beige color; this can be changed by
editing SColor.LIMITED_PALETTE[35]
. Deep and shallow lakes of non-water will use the given packed float
color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you don't need
this overload, and generateDefaultBGColorsFloat(char[][])
will be fine. You can adjust the brightness of
the backgrounds using generateLightnessModifiers(char[][])
, or if you want water, grass, and lakes to
ripple, you can use the overload generateLightnessModifiers(char[][], double, char, char)
with some
rising frame or millisecond count.packed
- a float[][] that will be modified, filled with packed float colors; must match map's sizemap
- a char[][] containing foreground characters (this gets their background color)deepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the packed float color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the packed float color to use for shallow parts of non-water lakespublic static float[][] generateDefaultBGColorsFloat(char[][] map, float hueChange, float saturationChange, float valueChange)
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black; this can be changed by editing
SColor.LIMITED_PALETTE[0]
. Deep water ('~') will be dark blue-green; this can be changed by editing
SColor.LIMITED_PALETTE[24]
. Shallow water (',') will be a lighter blue-green; this can be changed by
editing SColor.LIMITED_PALETTE[23]
. Grass ('"') will be dark green; this can be changed by editing
SColor.LIMITED_PALETTE[21]
. Bridges (':') will be a medium-dark beige color; this can be changed by
editing SColor.LIMITED_PALETTE[35]
. You can adjust the brightness of the backgrounds using
generateLightnessModifiers(char[][])
, or if you want water and grass to ripple, you can use the overload
generateLightnessModifiers(char[][], double, char, char)
with some rising frame or millisecond count.map
- a char[][] containing foreground characters (this gets their background color)public static float[][] fillDefaultBGColorsFloat(float[][] packed, char[][] map, float hueChange, float saturationChange, float valueChange)
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black; this can be changed by editing
SColor.LIMITED_PALETTE[0]
. Deep water ('~') will be dark blue-green; this can be changed by editing
SColor.LIMITED_PALETTE[24]
. Shallow water (',') will be a lighter blue-green; this can be changed by
editing SColor.LIMITED_PALETTE[23]
. Grass ('"') will be dark green; this can be changed by editing
SColor.LIMITED_PALETTE[21]
. Bridges (':') will be a medium-dark beige color; this can be changed by
editing SColor.LIMITED_PALETTE[35]
. You can adjust the brightness of the backgrounds using
generateLightnessModifiers(char[][])
, or if you want water and grass to ripple, you can use the overload
generateLightnessModifiers(char[][], double, char, char)
with some rising frame or millisecond count.packed
- a float[][] that will be modified, filled with packed float colors; must match map's sizemap
- a char[][] containing foreground characters (this gets their background color)hueChange
- a float from -1f to 1f that will be added to the hues of colors this usessaturationChange
- a float from -1f to 1f that will be added to the saturation of colors this usesvalueChange
- a float from -1f to 1f that will be added to the values of colors this usespublic static float[][] generateDefaultBGColorsFloat(char[][] map, char deepChar, float deepColor, char shallowChar, float shallowColor, float hueChange, float saturationChange, float valueChange)
SectionDungeonGenerator
can produce) and a packed float color to use
for that deep liquid, as well as a char for shallow lakes and a packed float color for that shallow liquid.
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black; this can be changed by editing
SColor.LIMITED_PALETTE[0]
. Deep water ('~') will be dark blue-green; this can be changed by editing
SColor.LIMITED_PALETTE[24]
. Shallow water (',') will be a lighter blue-green; this can be changed by
editing SColor.LIMITED_PALETTE[23]
. Grass ('"') will be dark green; this can be changed by editing
SColor.LIMITED_PALETTE[21]
. Bridges (':') will be a medium-dark beige color; this can be changed by
editing SColor.LIMITED_PALETTE[35]
. Deep and shallow lakes of non-water will use the given packed float
color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you don't need
this overload, and generateDefaultBGColorsFloat(char[][])
will be fine. You can adjust the brightness of
the backgrounds using generateLightnessModifiers(char[][])
, or if you want water, grass, and lakes to
ripple, you can use the overload generateLightnessModifiers(char[][], double, char, char)
with some
rising frame or millisecond count.map
- a char[][] containing foreground characters (this gets their background color)deepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the packed float color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the packed float color to use for shallow parts of non-water lakeshueChange
- a float from -1f to 1f that will be added to the hues of colors this usessaturationChange
- a float from -1f to 1f that will be added to the saturation of colors this usesvalueChange
- a float from -1f to 1f that will be added to the values of colors this usespublic static float[][] fillDefaultBGColorsFloat(float[][] packed, char[][] map, char deepChar, float deepColor, char shallowChar, float shallowColor, float hueChange, float saturationChange, float valueChange)
SectionDungeonGenerator
can produce) and a packed float color to use
for that deep liquid, as well as a char for shallow lakes and a packed float color for that shallow liquid. The
sizes of packed and map should be identical.
SColor.LIMITED_PALETTE
, and if that field is changed then the
colors this returns will also change. Most backgrounds will be black; this can be changed by editing
SColor.LIMITED_PALETTE[0]
. Deep water ('~') will be dark blue-green; this can be changed by editing
SColor.LIMITED_PALETTE[24]
. Shallow water (',') will be a lighter blue-green; this can be changed by
editing SColor.LIMITED_PALETTE[23]
. Grass ('"') will be dark green; this can be changed by editing
SColor.LIMITED_PALETTE[21]
. Bridges (':') will be a medium-dark beige color; this can be changed by
editing SColor.LIMITED_PALETTE[35]
. Deep and shallow lakes of non-water will use the given packed float
color parameters. If you are using SectionDungeonGenerator to produce normal water lakes, then you don't need
this overload, and generateDefaultBGColorsFloat(char[][])
will be fine. You can adjust the brightness of
the backgrounds using generateLightnessModifiers(char[][])
, or if you want water, grass, and lakes to
ripple, you can use the overload generateLightnessModifiers(char[][], double, char, char)
with some
rising frame or millisecond count.packed
- a float[][] that will be modified, filled with packed float colors; must match map's sizemap
- a char[][] containing foreground characters (this gets their background color)deepChar
- the char that represents deep parts of non-water lakes, from SectionDungeonGenerator
deepColor
- the packed float color to use for deep parts of non-water lakesshallowChar
- the char that represents shallow parts of non-water lakes, from SectionDungeonGenerator
shallowColor
- the packed float color to use for shallow parts of non-water lakeshueChange
- a float from -1f to 1f that will be added to the hues of colors this usessaturationChange
- a float from -1f to 1f that will be added to the saturation of colors this usesvalueChange
- a float from -1f to 1f that will be added to the values of colors this usespublic static int[][] generateLightnessModifiers(char[][] map)
map
- a char[][] that you want to be find background lightness modifiers forpublic static int[][] fillLightnessModifiers(int[][] lights, char[][] map)
map
- a char[][] that you want to be find background lightness modifiers forpublic static int[][] generateLightnessModifiers(char[][] map, double frame)
map
- a char[][] that you want to be find background lightness modifiers forframe
- a counter that typically should increase by between 10.0 and 20.0 each second; higher numbers make
water and grass move more, and 0.013 multiplied by the current time in milliseconds works well
as long as only the smaller digits of the time are used; this can be accomplished with
(System.currentTimeMillis() & 0xFFFFFF) * 0.013
.public static int[][] fillLightnessModifiers(int[][] lights, char[][] map, double frame)
lights
- an int[][] that will be modified, filled with lighting ints; must match map's sizemap
- a char[][] that you want to be find background lightness modifiers forframe
- a counter that typically should increase by between 10.0 and 20.0 each second; higher numbers make
water and grass move more, and 0.013 multiplied by the current time in milliseconds works well
as long as only the smaller digits of the time are used; this can be accomplished with
(System.currentTimeMillis() & 0xFFFFFF) * 0.013
.public static int[][] generateLightnessModifiers(char[][] map, double frame, char deepLiquid, char shallowLiquid)
map
- a char[][] that you want to be find background lightness modifiers forframe
- a counter that typically should increase by between 10.0 and 20.0 each second; higher numbers make
water and grass move more, and 0.013 multiplied by the current time in milliseconds works well
as long as only the smaller digits of the time are used; this can be accomplished with
(System.currentTimeMillis() & 0xFFFFFF) * 0.013
.deepLiquid
- a char that will be treated like deep water when animating ripplesshallowLiquid
- a char that will be treated like shallow water when animating ripplespublic static int[][] fillLightnessModifiers(int[][] lights, char[][] map, double frame, char deepLiquid, char shallowLiquid)
lights
- an int[][] that will be modified, filled with lighting ints; must match map's sizemap
- a char[][] that you want to be find background lightness modifiers forframe
- a counter that typically should increase by between 10.0 and 20.0 each second; higher numbers make
water and grass move more, and 0.013 multiplied by the current time in milliseconds works well
as long as only the smaller digits of the time are used; this can be accomplished with
(System.currentTimeMillis() & 0xFFFFFF) * 0.013
.deepLiquid
- a char that will be treated like deep water when animating ripplesshallowLiquid
- a char that will be treated like shallow water when animating ripplespublic static float[][] generateLinesToBoxes(char[][] map, float[][] colors)
TextCellFactory.draw(Batch, float[][], float, float, int, int)
, this produces a
triple-width, triple-height float color array by finding the box-drawing characters in map
and placing
3x3 boxes into that triple-size array with the matching color from colors
in the shape of that
box-drawing character. map
and colors
should be the same size. Will return a new 2D float array.
This should usually be passed to the aforementioned TextCellFactory draw method with 3 xSubCells and 3 ySubCells.
An intended purpose for this is to draw box-drawing-like blocks when the font doesn't support box-drawing
characters or those characters don't line up correctly for any reason.map
- a 2D char array that will not be modified; box drawing characters in this will be drawn in the returned arraycolors
- a 2D float array of packed float colors to use for drawing boxes (possibly produced by
fillDefaultColorsFloat(float[][], char[][])
or other methods in this class)TextCellFactory.draw(Batch, float[][], float, float, int, int)
with 3x3 subcellspublic static float[][] fillLinesToBoxes(float[][] into, char[][] map, float[][] colors)
TextCellFactory.draw(Batch, float[][], float, float, int, int)
, this finds the
box-drawing characters in map
and fills 3x3 boxes in into
with the matching color from
colors
in the shape of that box-drawing character. This means into
must have at least 3 times the
width and height of map
, and map
and colors
should be the same size. If into
is
appropriately-sized, then this will modify into
in-place; otherwise it will return a new 2D float array.
This should usually be passed to the aforementioned TextCellFactory draw method with 3 xSubCells and 3 ySubCells.
An intended purpose for this is to draw box-drawing-like blocks when the font doesn't support box-drawing
characters or those characters don't line up correctly for any reason.into
- a 2D float array that will be cleared, then modified in-place and returned; should be 3x the width
and 3x the height of map and colors, but if it is not (or is null) a new array will be allocatedmap
- a 2D char array that will not be modified; box drawing characters in this will be drawn in intocolors
- a 2D float array of packed float colors to use for drawing boxes (possibly produced by
fillDefaultColorsFloat(float[][], char[][])
or other methods in this class)into
, if modified, or a new 2D float array if into was null or incorrectly sizedCopyright © Eben Howard 2012–2022. All rights reserved.