| • Science | • People | • Locations | • Timeline |
Being based on the multimedia standard, MHEG allows for much more than simple page display of teletext, for example MHEG-3 covers scripting and MHEG-6 interactive applications. It is an object orientated language with visible objects, groups, inheritance, links and programs. A MHEG-5 presentation is initialised by an application which loads a scene which includes the ingredients list of visibles and also the non-visible links, programs and variables.
// 'Hello world' written in MHEG-5 // Originally from http://www.digvid.info {:Application ( '/startup' 0 ) // Application content reference :Items ( {:Link 1 :EventSource 0 // Check this application... :EventType IsRunning // ... for the IsRunning event :LinkEffect ( // Load the scene :TransitionTo (( '~/hello.mhg' 0 ) ) ) } ) :BackgroundColour '=FF=FF=FF=00' // White :TextCHook 10 // Default text content hook :TextColour '=00=00=00=00' // Black :Font "rec://font/uk1" // Font to use for text rendering :FontAttributes "plain.26.32.0" // Default font attributes :BitmapCHook 4 // Default bitmap content hook } {:Scene ( "~/hello.mhg" 0 ) :Items ( // Declare a background Rectangle that covers the screen. {:Rectangle 1 :OrigBoxSize 720 576 // Size of rectangle :OrigPosition 0 0 // Position at top left :OrigRefLineColour '=ff=ff=ff=00' // White :OrigRefFillColour '=ff=ff=ff=00' // White } // Place a Text box on the screen {:Text 2 :OrigContent "Hello World!" // Text to display :OrigBoxSize 300 50 // Size of text box :OrigPosition 200 100 // X,Y position :FontAttributes "plain.36.42.0" // Use large characters :TextColour '=ff=00=00=00' // Red } // Define a Link that triggers when the user presses the Blue key to // Quit the application. {:Link 3 :EventSource 0 // Source is this scene :EventType UserInput // Event type that we are looking for :EventData 103 // 103 for the blue key :LinkEffect ( :Quit ( ( '~/startup' 0 ) ) ) } ) :InputEventReg 3 :SceneCS 720 576 }