RenderableSkiaObject
Introduction
RenderableSkiaObject provides common implementation for rendering Skia graphics in the Gum rendering system. This class simplifies the implementation of interfaces necessary to render Skia objects. It also provides implementation for interfaces so it can be used as a renderable object by Gum objects (GraphicalUiElement). Custom classes can inherit from RenderableSkiaObject to provide custom Skia rendering code, which is useful for custom situations which are not supported by Gum.
Code Example - Rendering a Circle in Code
The following class provides an example of how to inherit from RenderableSkiaObject to provide custom rendering:
This object can be used as a standalone object or it can be added to a Gum GraphicalUiElement. Adding to a GraphicalUiElement is easier and provides more layout flexibility so we'll do that. The following code can be added to a Screen to draw the CustomRenderable:
This code results in an orange circle with width and height of 300 (radius of 150) being drawn at the top left of the screen.
Last updated