# Packages

com.appaapps

## Classes in package: com.appaapps

Class | Description
--- | ---
Svg | Structured Vector Graphics. Svg elements occupy fractions of the canvas which is assumed to have the approximate aspect ratio specified when creating the Svg. The elements then try to fit themselves into their fractional areas as best they can.
Svg.AFewChars | Draw a path - typically to show a few chars for an alphabetic or numbers game
Svg.AngleTracker | Track angles
Svg.CenterToCenter | Animation which expands an element its center is over the centre of the canvas
Svg.Element | Common features
Svg.Image | Draw a bitmap image - move it around to show it all within the space available
Svg.LengthTracker | Track length
Svg.LowPassFilter | Low pass filter
Svg.OpacityTracker | Track opacity
Svg.RandomStep | Random step function (x=time, y=position) with each step chosen at random between -1 and 1, each step duration chosen at random between 0 and timeScale
Svg.Rectangle | Rectangle
Svg.Text | Text
Svg.Tracker | Generates random but smoothly varying numbers between -1 and +1 by filtering random shocks.

### Methods in class: Svg, package: com.appaapps

Structured Vector Graphics. Svg elements occupy fractions of the canvas which is assumed to have the approximate aspect ratio specified when creating the Svg. The elements then try to fit themselves into their fractional areas as best they can.

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
| Svg | void | public | A default square Svg
| Svg | float, float | public | Create an Svg with the specified aspect ratio.
float | getWidth | void | public | The width of the Svg
float | getHeight | void | public | The height of the Svg
float | aspectRatio | void | public | Aspect ratio
void | push | Element | public | Add an element to the stack of elements to be displayed
void | onShow | void | public | Called when this Svg is shown or reshown after some other Svg has been shown
void | draw | Canvas | public | Draw the Svg to cover an entire canvas
void | draw | Canvas, float, float, float, float | private | Draw the Svg on a canvas at a specified location
boolean | chooseDoubleMode | void |  | Choose either a single or a double gradient
float | chooseStartAngle | void |  | Choose a start angle between 0 and 180 degrees
PorterDuffXfermode | choosePorterDuffMode | void |  | Choose Porter=Duff blending method
Rectangle | Rectangle | float, float, float, float |  | Create and push a rectangle
Text | Text | String, float, float, float, float, int, int | public | Create and push a new text element

#### Svg :

A default square Svg

#### Svg :

Create an Svg with the specified aspect ratio.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
width | float | final | The width of the Svg
height | float | final | The height of the Svg

#### getWidth : float

The width of the Svg

#### getHeight : float

The height of the Svg

#### aspectRatio : float

Aspect ratio

#### push : void

Add an element to the stack of elements to be displayed

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
e | Element |  | the element to add

#### onShow : void

Called when this Svg is shown or reshown after some other Svg has been shown

#### draw : void

Draw the Svg to cover an entire canvas

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
canvas | Canvas | final | Canvas to draw on

#### draw : void

Draw the Svg on a canvas at a specified location

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
canvas | Canvas | final | Canvas to draw svg on
x | float | final | Left edge
y | float | final | Upper edge
w | float | final | Width
h | float | final | Height

#### chooseDoubleMode : boolean

Choose either a single or a double gradient

#### chooseStartAngle : float

Choose a start angle between 0 and 180 degrees

#### choosePorterDuffMode : PorterDuffXfermode

Choose Porter=Duff blending method

#### Rectangle : Rectangle

Create and push a rectangle

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
x | float | final | Fractional position - left
y | float | final | Fractional position - upper
𝘅 | float | final | Fractional position - right
𝘆 | float | final | Fractional position - lower

#### Text : Text

Create and push a new text element

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
text | String | final | The text to display
x | float | final | Fractional area in which to display the text - left
y | float | final | Fractional area in which to display the text - upper
𝘅 | float | final | Fractional area in which to display the text - right
𝘆 | float | final | Fractional area in which to display the text - lower
justifyX | int | final | Justification in x per: com.appaapps.LayoutText
justifyY | int | final | Justification in y per: com.appaapps.LayoutText

### Methods in class: Svg.AFewChars, package: com.appaapps

Draw a path - typically to show a few chars for an alphabetic or numbers game

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---

### Methods in class: Svg.AngleTracker, package: com.appaapps

Track angles

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
float | angle | void |  | Current value in degrees

#### angle : float

Current value in degrees

### Methods in class: Svg.CenterToCenter, package: com.appaapps

Animation which expands an element its center is over the centre of the canvas

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
CenterToCenter | CenterToCenter | double, double, double | public constructor | Create a center to center animation
CenterToCenter | CenterToCenter | CenterToCenter | public constructor | Clone a prior animation
Float | active | void | public | Get fraction of animation
void | scaleCanvas | Canvas, RectF | public | Apply scale to the canvas if scaling is active for this element
void | scaleRectangle | Canvas, RectF | public | Apply scale to the canvas if the element scale effect is active
void | onActivate | void | public | Called when this animation becomes active

#### CenterToCenter : CenterToCenter

Create a center to center animation

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
delay | double |  | Delay before animation starts
duration | double |  | Duration of animation
startAgain | double |  | Restart after animation after this time

#### CenterToCenter : CenterToCenter

Clone a prior animation

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
clone | CenterToCenter |  | Animation to clone

#### active : Float

Get fraction of animation

#### scaleCanvas : void

Apply scale to the canvas if scaling is active for this element

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
canvas | Canvas |  | Canvas to which s calling is to be applied
drawArea | RectF |  | Drawing area

#### scaleRectangle : void

Apply scale to the canvas if the element scale effect is active

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
canvas | Canvas |  | Canvas to be scaled
drawArea | RectF |  | Apply scale to the canvas if active

#### onActivate : void

Called when this animation becomes active

### Methods in class: Svg.Element, package: com.appaapps

Common features

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
Element | Element | void | constructor | Add the new element to the stack of elements - which means that elements must be created in draw order and that element grouping within an Svg is unavailable, we could of course have an Svg.Sub that references a sub svg.
Paint | getGradientPaint | float, float, int, int, float, AngleTracker, LengthTracker, OpacityTracker | private | Return a paint for a gradient
Paint | getHorizontalPaint | float | private | Return a paint for the horizontal gradient
Paint | getVerticalPaint | float | private | Return a paint for the vertical gradient
void | draw | Canvas, Paint | abstract | The element draws itself on the supplied canvas using the supplied paint
void | draw | Canvas |  | Draw the SVG on a canvas
boolean | contains | float, float | public | Does this element contain the point (x, y)?
void | setCenterToCenter | CenterToCenter | public | Set Center To Center animation for this element

#### Element : Element

Add the new element to the stack of elements - which means that elements must be created in draw order and that element grouping within an Svg is unavailable, we could of course have an Svg.Sub that references a sub svg.

#### getGradientPaint : Paint

Return a paint for a gradient

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
sizeX | float |  | Size in X of gradient
sizeY | float |  | Size in Y of gradient
c1 | int |  | First colour
c2 | int |  | Opposing second colour
startAngle | float |  | Start angle
angle | AngleTracker |  | Angle of gradient as time goes by
length | LengthTracker |  | Length of gradient as time goes by
opacity | OpacityTracker |  | Opacity of gradient as time goes by

#### getHorizontalPaint : Paint

Return a paint for the horizontal gradient

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
size | float |  | Size of gradient

#### getVerticalPaint : Paint

Return a paint for the vertical gradient

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
size | float |  | Size of gradient

#### draw : void

The element draws itself on the supplied canvas using the supplied paint

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
canvas | Canvas | final | Canvas on which the element would be drawn
paint | Paint |  | Paint to draw the element

#### draw : void

Draw the SVG on a canvas

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
canvas | Canvas | final | Canvas to draw on

#### contains : boolean

Does this element contain the point (x, y)?

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
x | float |  | Point.X
y | float |  | Point.Y

#### setCenterToCenter : void

Set Center To Center animation for this element

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
c | CenterToCenter |  | Animation to use

### Methods in class: Svg.Image, package: com.appaapps

Draw a bitmap image - move it around to show it all within the space available

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
Image | Image | Bitmap, float, float, float, float | public constructor | Fraction coordinates of corners of drawing area

#### Image : Image

Fraction coordinates of corners of drawing area

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
bitmap | Bitmap |  | Bitmap containing image
x | float |  | Fraction coordinates of left edge
y | float |  | Fraction coordinates of upper edge
𝘅 | float |  | Fraction coordinates of right edge
𝘆 | float |  | Fraction coordinates of lower edge

### Methods in class: Svg.LengthTracker, package: com.appaapps

Track length

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
float | length | void |  | Current value in pixels

#### length : float

Current value in pixels

### Methods in class: Svg.LowPassFilter, package: com.appaapps

Low pass filter

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
LowPassFilter | LowPassFilter | double | constructor | Create a low pass filter
double | value | double | public | Value of applied value after passing through low pass filter

#### LowPassFilter : LowPassFilter

Create a low pass filter

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
timeScale | double |  | Timescale of filter

#### value : double

Value of applied value after passing through low pass filter

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
applied | double |  | Applied signal

### Methods in class: Svg.OpacityTracker, package: com.appaapps

Track opacity

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
int | opacity | void | public | Current value as opacity

#### opacity : int

Current value as opacity

### Methods in class: Svg.RandomStep, package: com.appaapps

Random step function (x=time, y=position) with each step chosen at random between -1 and 1, each step duration chosen at random between 0 and timeScale

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
double | value | void | public | Value of random step

#### value : double

Value of random step

### Methods in class: Svg.Rectangle, package: com.appaapps

Rectangle

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
Rectangle | Rectangle | float, float, float, float | public constructor | Create a rectangle
void | draw | void |  | See Draw the rectangle

#### Rectangle : Rectangle

Create a rectangle

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
x | float | final | Fractional position - left
y | float | final | Fractional position - upper
𝘅 | float | final | Fractional position - right
𝘆 | float | final | Fractional position - lower

#### draw : void

See Draw the rectangle

### Methods in class: Svg.Text, package: com.appaapps

Text

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
Text | Text | String, float, float, float, float, int, int | public constructor | Create a text area
void | draw | void |  | See Draw the text

#### Text : Text

Create a text area

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
text | String | final | The text to display
x | float | final | Fractional area in which to display the text - left
y | float | final | Fractional area in which to display the text - upper
𝘅 | float | final | Fractional area in which to display the text - right
𝘆 | float | final | Fractional area in which to display the text - lower
justifyX | int | final | Justification in x per: com.appaapps.LayoutText
justifyY | int | final | Justification in y per: com.appaapps.LayoutText

#### draw : void

See Draw the text

### Methods in class: Svg.Tracker, package: com.appaapps

Generates random but smoothly varying numbers between -1 and +1 by filtering random shocks.

Returns | Method | Signature | Attributes | Description
--- | --- | --- | --- | ---
double | value | void |  | Value of tracker

#### value : double

Value of tracker