- Create a class that extends
RenderLayer
- This class must have a constructor that takes a
String
and callssuper(String)
with it. No other constructors will be called.
- This class must have a constructor that takes a
- Call
Layers.registerLayer()
with that class and a unique key for it in client preinit - Add a lang entry for the button's tooltip and icons for displaying the button
- The tooltip lang entry will also be used for the layer's entry in the controls list
For example:
// FooRenderLayer.java
public class FooRenderLayer extends RenderLayer {
public FooRenderLayer(String key) {
super(key);
}
// implement render() and updateVisibleArea()
// override other methods of RenderLayer as needed
}
// in client FMLPreInitializationEvent handler
Layer.registerLayer(FooRenderLayer.class, "bar");
In a lang file:
visualores.button.bar=Toggle foo overlay
In assets/
:
journeymap/theme/flat/icon/bar.png
- Should be a single square icon with padding
- See the included icons and Journeymap's own icons for reference
visualores/textures/buttons/bar.png
- Should have two equal-sized square icons next to each other, left is deactivated state, right is activated state
- See the included icons for reference
For saving files in VisualOres' client-side cache directory.
- Create a class that implements
IClientCache
or either of its child interfaces - Call
ClientCacheManager.registerClientCache()
with an instance of that class in client preinit
If you're writing a renderer that uses fluids' colors, use DrawUtils#getFluidColor(Fluid)
to use the fluid color override list. No more white-colored water and lava!
If your integration requires VisualOres to be on both the server and client, call VisualOres#addModRequiringServer(String)
to require that.