Apollo
Developers
Modules
Vignette

Vignette Module

Overview

The vignette module gives the ability to apply a full-screen image overlay with transparency to the player's view.

  • Adds the ability to display a custom vignette for players

Integration

Sample Code

Explore each integration by cycling through each tab, to find the best fit for your requirements and needs.

Display Vignette

public void displayVignetteExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
 
    apolloPlayerOpt.ifPresent(apolloPlayer -> {
        this.vignetteModule.displayVignette(apolloPlayer, Vignette.builder()
            .resourceLocation("blocks/pumpkin.png")
            .opacity(0.75f)
            .build()
        );
    });
}

Reset Vignette

public void resetVignetteExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(this.vignetteModule::resetVignette);
}

Vignette Options

.resourceLocation(String) is the resource location of the vignette.

.resourceLocation("blocks/pumpkin.png")

.opacity(Float) is the opacity of the shown vignette.

.opacity(0.75f)