Wii Opera SDK v3.0
Easily add useful functionality to your games for the Wii's Internet Channel.
Classes:
1. Comm - Communication between players online
2. Drawing - Polygon mesh and image platting to a canvas
3. ThreeD - 3D matrix math for triangles and hidden surfaces
4. RayCast - Textured axis-aligned raycaster
5. Wiimote - Wii Remote input and motion interpretation
Comm
- Receive( )
Retrieves player data from the database
Inputs: none
Outputs: none
- Send( )
Stores player data to the database
Inputs: Array
Outputs: none
- getReceived( )
Moves retrieved data to an array
Inputs: none
Outputs: Array
- setGameID( )
Stores the current game's unique ID
Inputs: gameid
Outputs: none
- setPlayerID( )
Stores the current player's unique ID
Inputs: playerid
Outputs: none
- Constants
none
Drawing
- null = clear( x1,y1, x2,y2 )
Erases all contents of the given canvas section
- null = clipCircle( x,y,rad )
Sets a clip circle for upcoming commands
- null = clipRectangle( x1,y1, x2,y2 )
Sets a clip rectangle for upcoming commands
- null = drawCircle( x,y,rad, fillFlags )
Draws a filled or stroked circle
- null = drawFloor( x1,x2,y1, x3,x4,y2, Image )
Draws a textured floor
- null = drawImage( x1,y1, x2,y2, Image, angle )
Draws a degree rotated and scaled image
- null = drawLine( x1,y1, x2,y2 )
Draws a line segment
- null = drawRectangle( x1,y1, x2,y2, fillFlags )
Draws a rectangle
- null = drawScene( Array[ ][x1,y1, x2,y2, x3,y3, r,g,b], fillFlags )
Draws a scene of triangles
- null = drawTriangle( x1,y1, x2,y2, x3,y3, fillFlags )
Draws a triangle
- null = drawWall( x1,y1,y2, x2,y3,y4, Image )
Draws a textured wall
- null = initialize( Canvas )
Sets the current canvas object for drawing
- null = loadTextures( Image[ ] )
Stores an image array to be drawn
- null = setFillColor( r,g,b )
Sets the RGB value of all upcoming fills
- null = setFillColorA( r,g,b,a )
Sets the RGBA value of all upcoming fills
- null = setLineColor( r,g,b )
Sets the RGB value of all upcoming lines
- null = setLineColorA( r,g,b,a )
Sets the RGBA value of all upcoming lines
- null = textureScene( Array[ ][ x1,y1, x2,y2, x3,y3, texRef, (reserved), brightness ] )
Draws a scene of texture-mapped triangle
- null = unZoom( value )
Reverts the scene's zoom to default
- null = zoom( value )
Zooms the scene to a given value
- Constants
fillFlags: WIREFRAME,SHADE
ThreeD
- null = backface( )
Removes hidden triangles from the buffered object
- null = explode( x,y,z )
Shifts the buffered triangles along their normals a given distance
- null = fade( darkness )
Shifts the flat-shaded color toward total black
- Array[ ][x1,y1,z1, x2,y2,z2, x3,y3,z3, r,g,b] = getPoints( )
Retrieves the buffered mesh
- Array[ ][x1, y1, x2, y2, x3, y3, r, g, b] = getTranslation( )
Retrieves the 2D translation of the buffered triangles for display
- null = loadMesh( meshString )
Loads a pre-made 3D mesh into the triangle buffer
- null = move( x,y,z )
Shifts the buffered triangles
- null = reColor( r,g,b )
Changes the colors for every triangle in the mesh
- null = rotate( anglex, angley, anglez )
Rotates the buffered triangles
- null = scale( x,y,z )
Zooms the buffered triangles by a given factor
- null = setCenter( x,y )
Sets the perspective center for 3D to 2D translation
- null = setLight( x,y,z )
Sets the current light source for shading
- null = setPoints( Array[ ][x1,y1,z1, x2,y2,z2, x3,y3,z3, r,g,b] )
Places an array of polygons into the buffer
- null = shade( )
Flat shades the buffered triangles based on SetLight()
- null = shadeTexture( )
Shades the buffered texture-mapped triangles based on the lightsource
- null = shadow( )
Halves the brightness of hidden buffered triangles based on the lightsource
- null = zSort( )
Orders the buffered polygons for proper display
- Constants
none
RayCast
- null = checkTeleports( )
Relocates the player when on a teleport location
- null = duck( )
Crouches the player
- null = generateScene( )
Raycasts the scene
- null = initialize( Canvas )
Sets the drawing canvas
- boolean = isCollided( )
Toggles a flag when the player hits a wall
- null = loadScene( Array[ ][ ] )
Stores the map grid to a buffer
- null = moveBackward( )
Walks the player backward
- null = moveForward( )
Walks the player forward
- null = moveLeft( )
Strafes the player left
- null = moveRight( )
Strafes the player right
- null = rotateLeft( )
Rotates the player left (CCW)
- null = rotateRight( )
Rotates the player right (CW)
- null = setAltitude( alt )
Hovers the player at a given height
- null = setDirection( angle )
Changes the player's orientation
- null = setGroundColor( r,g,b )
Changes the lower background color
- null = setLocation( x,y )
Changes the player's map location
- null = setResolution( res )
Changes the texel width
- null = setShade( flag )
Toggles shading
- null = setSize( w,h )
Sets the canvas size
- null = setSkyColor( r,g,b )
Changes the upper background color
- null = setTeleports( Array[ sx,sy, dx,dy] )
Stores the teleport array
- null = setTextures( Image[ ] )
Stores the texture images
- null = setTurningSpeed( speed )
Sets the turning speed in radians
- null = setWalkingSpeed( speed )
Sets the walking speed in grid fractions
- null = setWalls( Array[ ][ ] )
Stores the map grid
- null = unDuck( )
Uncrouches the player
- Constants
lighting: FLASHLIGHT,GOURAUD,SHADOW
Wiimote
- GetDistance( )
Retrieves distance from the sensor bar for any Wii Remote
Inputs: key
Outputs: meters
- GetEnabled( )
Retrieves the on/off status for any Wii Remote
Inputs: none
Outputs: true/false
- GetKeyStatus( )
Retrieves status of specific button for Wii Remote 1
Inputs: key
Outputs: true/false
- GetRoll( )
Retrieves roll angle for any Wii Remote
Inputs: key
Outputs: degree
- GetX( )
Retrieves mouse cursor x coordinate for any Wii Remotes
Inputs: none
Outputs: x
- GetY( )
Retrieves mouse cursor y coordinate for any Wii Remotes
Inputs: none
Outputs: y
- SetActive( )
Enables roll, distance, and coordinate detection for a given Wii Remotes
Inputs: 0, 1, 2, or 3
Outputs: none
- DefaultActions( )
Enables/disables the Internet Channel's default button actions
Inputs: TRUE/FALSE
Outputs: none
- Constants
BUTTON_B, BUTTON_LEFT, BUTTON_UP, BUTTON_RIGHT, BUTTON_DOWN, BUTTON_PLUS, BUTTON_1, BUTTON_A, BUTTON_2, BUTTON_MINUS, BUTTON_C, BUTTON_Z