Class Application

Base origo application class. Provides key and pointer input

Methods


draw to <canvas c>

Called when screen repaint has been requested with screen.repaint [ <rectangle> ].

Parameters

Example

main
  // Construct and run an origo application.
  system.run application new MyApplication


class MyApplication extends Application
                
  draw to <Canvas c>
    c.draw string "Hello World!" to 0, 0
                

key <int n> pressed

Called when a key has been pressed.

Parameters

Example

main
  // Construct and run an origo application.
  system.run application new MyApplication


class MyApplication extends Application
  
  key <int n> pressed
    if ( n == keys.right softkey )
      system.exit
                

key <int n> released

Called when a key has been released.

Parameters

Example

main
  // Construct and run an origo application.
  system.run application new MyApplication


class MyApplication extends Application
  
  key <int n> released
    if ( n == keys.right softkey )
      system.exit
                

pointer pressed at <position pos>

Called when the pointer has been pressed.

Parameters

Example

main
  // Construct and run an origo application.
  system.run application new MyApplication


class MyApplication extends Application
  
  pointer pressed at <position pos>
    if ( pos == 0, 0 )
      system.exit
                

pointer released at <position pos>

Called when the pointer has been released

Parameters

Example

main
  // Construct and run an origo application.
  system.run application new MyApplication


class MyApplication extends Application
  
  pointer released at <position pos>
    if ( pos == 0, 0 )
      system.exit
                

pointer dragged to <position pos>

Called when the pointer has been dragged.

Parameters

Example

main
  // Construct and run an origo application.
  system.run application new MyApplication


class MyApplication extends Application
  
  pointer dragged to <position pos>
    if ( pos == 0, 0 )
      system.exit