Interface IMapModeColorizer
- Namespace
- Map.MapModes.Colorization
- Assembly
- MapAssembly.dll
ENGINE: Interface for pluggable map mode colorization strategies.
Pattern 20: Pluggable Implementation Pattern
- ENGINE provides interface + default implementation (gradient-based)
- GAME registers custom implementations via MapRendererRegistry
- VisualStyleConfiguration references by string ID
Default: GradientMapModeColorizer (3-color linear interpolation) Custom examples: DiscreteColorBands, MultiGradient, PatternOverlay, AnimatedEffects
public interface IMapModeColorizer
Properties
ColorizerId
Unique identifier for this colorizer (e.g., "Gradient", "DiscreteBands", "MultiColor")
string ColorizerId { get; }
Property Value
- string
DisplayName
Human-readable name for UI/debugging
string DisplayName { get; }
Property Value
- string
RequiresPerFrameUpdate
Whether this colorizer needs per-frame updates (e.g., animated effects)
bool RequiresPerFrameUpdate { get; }
Property Value
- bool
Methods
Colorize(RenderTexture, RenderTexture, float[], ColorizationStyleParams)
Apply colorization to generate output texture. Core operation: province values + style params → colored texture
void Colorize(RenderTexture provinceIDTexture, RenderTexture outputTexture, float[] provinceValues, ColorizationStyleParams styleParams)
Parameters
provinceIDTextureRenderTextureInput: Province ID texture (RG16 encoded)
outputTextureRenderTextureOutput: Colorized RGBA texture
provinceValuesfloat[]Per-province normalized values (0-1), negative = skip
styleParamsColorizationStyleParamsColorization style parameters
Dispose()
Release GPU resources.
void Dispose()
Initialize(MapModeColorizerContext)
Initialize the colorizer with required resources. Called once when colorizer is first activated.
void Initialize(MapModeColorizerContext context)
Parameters
contextMapModeColorizerContext
OnRenderFrame()
Called each frame if RequiresPerFrameUpdate is true. Use for animated effects, pulsing, etc.
void OnRenderFrame()