Class: $.AccelMagView
- Inherits:
-
WatchUi.View
-
WatchUi.View
-
Overview
View class for the AccelMag. This class also implements the business logic
Constant Summary
Constant Variables
| Type | Name | Value | Since | Description |
|---|---|---|---|---|
| Type | _arrowLen | 25.0 | ||
| Type | _hitForce | 50.0 | ||
| Type | _incrFrict | 15 | ||
| Type | _pcntFrict | 99 | ||
| Type | _r | 10 | ||
| Type | _velocityToPix | 0.004 | ||
| Type | _wallLoss | 80 |
Instance Member Summary collapse
- _accel as Lang.Array<Lang.Float>
- _dataTimer as Timer.Timer or Null
- _height as Lang.Numeric
- _mag as Lang.Array<Lang.Float>
- _width as Lang.Numeric
- _x as Lang.Numeric
- _xMult as Lang.Numeric
- _xVelocity as Lang.Numeric
- _y as Lang.Numeric
- _yMult as Lang.Numeric
- _yVelocity as Lang.Numeric
Instance Method Summary collapse
-
initialize()
Constructor.
-
kickBall() as Void
Kick the ball.
-
onHide() as Void
Called when this View is removed from the screen.
-
onLayout(dc as Graphics.Dc)
Initialize members based on the screen resolution.
-
onShow() as Void
Restore the state of the app and prepare the view to be shown.
-
onUpdate(dc as Graphics.Dc) as Void
Update the view.
-
timerCallback() as Void
On a timer interval, read the accelerometer and update the ball position.
Instance Attribute Details
var _accel as Lang.Array<Lang.Float>
var _dataTimer as Timer.Timer or Null
var _height as Lang.Numeric
var _mag as Lang.Array<Lang.Float>
var _width as Lang.Numeric
var _x as Lang.Numeric
var _xMult as Lang.Numeric
var _xVelocity as Lang.Numeric
var _y as Lang.Numeric
var _yMult as Lang.Numeric
var _yVelocity as Lang.Numeric
Instance Method Details
initialize()
Constructor
kickBall() as Void
Kick the ball
onHide() as Void
Called when this View is removed from the screen. Save the state of your app here.
onLayout(dc as Graphics.Dc)
Initialize members based on the screen resolution
onShow() as Void
Restore the state of the app and prepare the view to be shown
onUpdate(dc as Graphics.Dc) as Void
Update the view
timerCallback() as Void
On a timer interval, read the accelerometer and update the ball position