Types
GradientDrawableObj = object of DrawableObj corners*: array[4, ColorRef]
GradientDrawableRef = ref GradientDrawableObj
Procs
proc GradientDrawable(): GradientDrawableRef {...}{.raises: [], tags: [].}
Methods
method draw(self: GradientDrawableRef; x1, y1, width, height: float) {...}{. raises: [GLerror], tags: [].}
method setCornerColors(self: GradientDrawableRef; c0, c1, c2, c3: ColorRef) {...}{.base, raises: [], tags: [].}
-
Changes corners colors
Arguments:
- c0 is left-top color.
- c1 is right-top color.
- c2 is right-bottom color.
- c3 is left-bottom color.
method setCornerColors(self: GradientDrawableRef; corners: array[4, ColorRef]) {...}{.base, raises: [], tags: [].}
-
Changes corners colors
See also:
method setCornerColors(self: GradientDrawableRef; clr: ColorRef) {...}{.base, raises: [], tags: [].}
-
Changes corners colors
See also:
method setStyle(self: GradientDrawableRef; s: StyleSheetRef) {...}{. raises: [ValueError, RegexError, ResourceError, GLerror], tags: [].}
- Sets a new stylesheet.
Templates
template draw_template(drawtype, color, function, secondfunc: untyped; is_gradient: bool = true): untyped
-
Draws colorized vertexes
Arguments:
- drawtype - draw type, like GL_POLYGON
- color - color for border drawing.
- function - function called before glBegin
- secondfunc - function called after glEnd
- is_gradient - true when drawtype is GL_POLYGON.