CurlMesh

class CurlMesh

Class implementing actual curl page rendering. This class is based on https://github.com/harism/android-pagecurl

Constructors

Link copied to clipboard
constructor(maxCurlSplits: Int, drawCurlPosition: Boolean = DRAW_CURL_POSITION, drawPolygonOutlines: Boolean = DRAW_POLYGON_OUTLINES, drawShadow: Boolean = DRAW_SHADOW, drawTexture: Boolean = DRAW_TEXTURE, shadowInnerColor: FloatArray = SHADOW_INNER_COLOR, shadowOuterColor: FloatArray = SHADOW_OUTER_COLOR, colorFactorOffset: Float = DEFAULT_COLOR_FACTOR_OFFSET)

Constructor for mesh object.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Flag for rendering some lines used for development. Shows curl position and one for the direction from the given position. Comes handy one playing around with different ways for following pointer.

Link copied to clipboard

Flag for drawing polygon outlines. Seeing polygon outlines gives good insight on how original rectangle is divided.

Link copied to clipboard

Flag for enabling shadow rendering.

Link copied to clipboard

Flag for texture rendering.

Link copied to clipboard

Inner color for shadow. Inner color is the color drawn next to surface where shadowed area starts.

Link copied to clipboard

Outer color for shadow. Outer color is the color the shadow ends to.

Link copied to clipboard

Contains texture and blend colors for a page.

Functions

Link copied to clipboard
fun curl(curlPos: PointF, curlDir: PointF, radius: Double)

Sets curl for this mesh.

Link copied to clipboard

Renders out page curl mesh

Link copied to clipboard

Resets mesh to 'initial' state. Meaning this mesh will draw a plain textured rectangle after call to this method.

Link copied to clipboard

Resets allocated texture id forcing creation of new one. After calling this method you most likely want to set bitmap too as it's lost. This method should be called only once e.g GL context is re-created as this method does not release previous texture id, only makes sure new one is requested on next render.

Link copied to clipboard

If true, flips texture sideways.

Link copied to clipboard
fun setRect(r: RectF?)

Update mesh bounds.