class GradientLayer(Layer) {
public:
import "common.ulb"
; <p>
; @param pparent typically 'this' from the parent or zero
func GradientLayer(Generic pparent)
Layer.Layer(pparent)
if @f_grad==0
m_Gradient = new @f_gradient(this)
endif
endfunc
; <p>
; @param clr the base color
; @param index the gradient index for the top colour
; @return layer merged color
color func GradientMerge(color clr,float index)
if @f_grad==0
return FullMerge(clr, m_Gradient.GetColour(index))
else
return FullMerge(clr, gradient(index))
endif
endfunc
private:
MMF_UserGradient m_Gradient
default:
int param v_gradientlayer
caption = "Version (GradientLayer)"
default = 100
hint = "This version parameter is used to detect when a change \
has been made to the formula that is incompatible with \
the previous version. When that happens, this field will \
reflect the old version number to alert you to the fact \
that an alternate rendering is being used."
visible = @v_gradientlayer < 100
endparam
int param f_grad
caption = "Gradient to use"
enum = "Custom Gradient" "UF's Gradient"
default = 0
endparam
MMF_UserGradient param f_gradient
caption = "Layer Gradient"
default = MMF_Gradient101
hint = "Allows you to customise the colours for this layer."
visible = @f_grad==0
endparam
}