Wii Opera SDK v2.0
Easily add useful functionality to your games for the Wii's Internet Channel.
Classes:
1. Comm - Allows communication between players online
2. Drawing - Plot polygons and images to a drawing canvas
3. ThreeD - 3D matrix math for triangles and hidden surfaces (General)
4. ThreeD - 3D matrix math for quadrilaterals and hidden surfaces (FPS optimized)
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
- Clear( )
Erases all contents of the given canvas section
Inputs: x1, y1, x2, y2
Outputs: none
- Initialize( )
Sets the current canvas object for drawing
Inputs: document.getElementByID(canvasname)
Outputs: none
- setFillColor( )
Sets the RGB value of all upcoming fills
Inputs: r, g, b
Outputs: none
- setFillColorA( )
Sets the RGBA value of all upcoming fills
Inputs: r, g, b, a
Outputs: none
- setLineColor( )
Sets the RGB value of all upcoming lines
Inputs: r, g, b
Outputs: none
- setLineColorA( )
Sets the RGBA value of all upcoming lines
Inputs: r, g, b, a
Outputs: none
- setLineStyle( )
Sets the cap style for all upcoming lines
Inputs: lineStyle
Outputs: none
- clipCircle( )
Sets a clip circle for upcoming commands
Inputs: centerx, centery, radius
Outputs: none
- clipRectangle( )
Sets a clip rectangle for upcoming commands
Inputs: z1, y1, x2, y2
Outputs: none
- drawCircle( )
Draws a circle
Inputs: centerx, centery, radius, fillToggle
Outputs: none
- drawFloor( )
Draws a textured floor
Inputs: x1, x2, y1, x3, x4, y2, image
Outputs: none
- drawImage( )
Draws a degree rotated and scaled image
Inputs: x1, y1, x2, y2, image, angle
Outputs: none
- drawLine( )
Draws a line
Inputs: x1, y1, x2, y2
Outputs: none
- drawQuad( )
Draws a quadrilateral
Inputs: x1, y1, x2, y2, x3, y3, x4, y4, fillToggle
Outputs: none
- drawRectangle( )
Draws a rectangle
Inputs: x1, y1, x2, y2, fillToggle
Outputs: none
- drawScene( )
Draws a scene of triangles
Inputs: TwoDPolygon[][x1, y1, x2, y2, x3, y3, r, g, b], fillMode
Outputs: none
- drawTriangle( )
Draws a triangle
Inputs: x1, y1, x2, y2, x3, y3, fillToggle
Outputs: none
- drawWall( )
Draws a textured wall
Inputs: x1, y1, y2, x2, y3, y4, image
Outputs: none
- Constants
BUTT=1, ROUND=2, SQUARE=3, WIREFRAME=1, SHADE=2
ThreeD (General)
- getPoints( )
Retrieves the buffered mesh
Inputs: none
Outputs: TwoDPolygon[x1, y1, x2, y2, x3, y3, r, g, b][]
- getTranslation( )
Retrieves the 2D translation of the buffered triangles for display
Inputs: none
Outputs: TwoDPolygon[][x1, y1, x2, y2, x3, y3, r, g, b]
- setCenter( )
Sets the perspective center for 3D to 2D translation
Inputs: x, y
Outputs: none
- setLight( )
Sets the current light source for shading
Inputs: x, y, z
Outputs: none
- setPoints( )
Places an array of polygons into the buffer
Inputs: ThreeDPolygon[][x1, y1, z1, x2, y2, z2, x3, y3, z3, r, g, b]
Outputs: none
- backface( )
Removes hidden triangles from the object
Inputs: none
Outputs: none
- explode( )
Shifts the buffered triangles along their normals a given distance
Inputs: distancex, distancey, distancez
Outputs: none
- fade( )
Shifts the flat-shaded color toward total black
Inputs: brightness
Outputs: none
- loadMesh( )
Loads a pre-made 3D mesh into the triangle buffer
Inputs: MeshArray
Outputs: none
- move( )
Shifts the buffered triangles based on SetOrigin()
Inputs: movex, movey, movez
Outputs: none
- rotate( )
Rotates the buffered triangles based on SetRotation()
Inputs: anglex, angley, anglez
Outputs: none
- scale( )
Zooms the buffered triangles by a given factor
Inputs: scalex, scaley, scalez
Outputs: none
- shade( )
Flat shades the buffered triangles based on SetLight()
Inputs: none
Outputs: none
- shadeTexture( )
Shades the buffered texture-mapped triangles based on SetLight()
Inputs: none
Outputs: none
- shadow( )
Halves the brightness of hidden buffered triangles based on SetLight()
Inputs: none
Outputs: none
- zSort( )
Orders the buffered polygons for proper display
Inputs: none
Outputs: none
- Constants
none
ThreeD (FPS Optimized)
- GetHidden( )
Determines the z-face direction of a wall
Inputs: TwoDPolygon[x1, y1, y2, x2, y3, y4, r, g, b]
Outputs: true/false
- GetTranslation( )
Translates buffered 3D coordinates into displayable 2D coordinates
Inputs: none
Outputs: TwoDPolygon[x1, y1, y2, x2, y3, y4, r, g, b][]
- SetCenter( )
Sets the perspective center for 3D to 2D translation
Inputs: x, y
Outputs: none
- SetPoints( )
Places an array of polygons into the buffer
Inputs: ThreeDPolygon[x1, y1, z1, x2, y2, z2, r, g, b][]
Outputs: none
- SetRotation( )
Sets the next degree rotation value
Inputs: anglex, angley, anglez
Outputs: none
- Move( )
Shifts a range of buffered polygons along all axes
Inputs: x, y, z, min, max
Outputs: none
- Rotate( )
Rotates a range of buffered polygons on a given axis
Inputs: axisx, axisy, axisz, min, max, scale
Outputs: none
- Scale( )
Zooms a range of buffered polygons on a given axis with the default of 1
Inputs: axisx, axisy, axisz, min, max
Outputs: none
- ZSort( )
Orders the buffered polygons for proper display
Inputs: min, max
Outputs: none
- Constants
none
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