Wii Opera SDK
Easily add useful functionality to your Web applications for the Wii.
Classes:
1. Comm - Allows communication between players online
2. Drawing - Plot polygons and images to a drawing canvas
3. ThreeD - 3D matrix math for polygons and hidden surfaces (General)
4. ThreeD - 3D matrix math for polygons 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
- drawArc( )
Draws an arc, given in degrees
Inputs: centerx, centery, radius, angle1, angle2
Outputs: none
- drawBezier( )
Draws a bezier curve
Inputs: controlx1, controly1, controlx2, controly2, x, y, fillToggle
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: x1, y1, x2, y2, x3, y3, fillToggle
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
- textureSphere( ) WARNING: This function is very slow and cannot be used in games at the moment.
Maps a Mercator projection of an image to a sphere
Inputs: centerx, centery, radiusx, radiusy, image, blockSize
Outputs: none
- Constants
BUTT, ROUND, SQUARE, OUTLINE, FILL
ThreeD (General)
- GetTranslation( )
Translates buffered 3D coordinates into displayable 2D coordinates
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
- 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
- SetRotation( )
Sets the next degree rotation value
Inputs: anglex, angley, anglez
Outputs: none
- Hidden( )
Determines the z-face direction of a polygon
Inputs: TwoDPolygon[x1, y1, x2, y2, x3, y3, r, g, b]
Outputs: true/false
- 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
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
- Controller( )
Activates game controller mode, treating [A] as the [ENTER] key
Inputs: none
Outputs: none
- Remote( )
Activates remote pointer mode, treating [A] as a left mouse click
Inputs: none
Outputs: none
- 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
- 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