visual style question 

Hello,
How do I make adjustments so that the worldview's ground can be any texture
that I choose? I have tried making adjustments to the standard file so that
the niceground.png will always be used, but my skill at reading and
adjusting code is very limited. Any detailed explanations on exactly what
to adjust would be greatly appreciated.

Thanks for your time and assistance,
Kristian

Forums: 
Szymon Ulatowski's picture

Kristian Houghtling wrote:
> Hello,
> How do I make adjustments so that the worldview's ground can be any texture
> that I choose? I have tried making adjustments to the standard file so that
> the niceground.png will always be used, but my skill at reading and
> adjusting code is very limited. Any detailed explanations on exactly what
> to adjust would be greatly appreciated.

try the following:
1.copy the standard.style to your new custom.style
2.modify the buildFlatWorld() function in custom.style:
replace:
Material.disable(GL.TEXTURE_2D);
with:
Material.enable(GL.TEXTURE_2D);
Material.texture="niceground.png";
VertexBuilder.genTexCoordsXY(0.1,0.1); // this is the texture scale,
// you can adjust this value
3.that's all

you can even make the texture configurable!
1.add this at the end of custom.style:

property:
id:groundtex
name:Ground texture
type:s

2.replace all occurences of "niceground.png" with VisProperties.groundtex

3.define the default texture name in the onLoad() function:
VisProperties.groundtex="niceground.png";

happy hacking! :->

sz.