-
Notifications
You must be signed in to change notification settings - Fork 0
RubikHelper API RubikCube
Fabio Bucci Di Monte edited this page May 2, 2015
·
4 revisions
RubikHelper.cube.RubikCubePrototype Base Class with useful methods to display a Rubik Cube and perform face/slice rotations.
Constructor | Params | Options | Properties | Methods
function RubikCube(ID, options)| name | type | notes |
|---|---|---|
ID |
String |
main container's ID attribute |
options |
Object |
custom option object |
| name | type | default | notes |
|---|---|---|---|
pieceSize |
Number |
30 |
|
showAxis |
Boolean |
false |
| name | type | notes |
|---|---|---|
$el |
jQuery |
|
_options |
Object |
|
_currentCube |
Object |
| name | returns | notes |
|---|---|---|
axisRotation(move) |
String |
|
didRender() |
void |
does nothing here: needs to be overridden |
execute(sequence, duration) |
void |
|
getCube() |
Object |
|
getPiece(piece) |
String |
calls getStickersFromPiece on RubikUtils.service. |
orientedPiece(target, move) |
String |
|
render(pieces) |
void |
does nothing here: needs to be overridden |
rotatedPieces(move) |
Object |
|
setCube(cube) |
void |
|
setPiece(piece, stickers) |
void |
|
updateColors(colors) |
void |
|
willRender() |
void |
does nothing here: needs to be overridden |
Params | Options | Properties | Methods
type String
Main container's ID attribute
type Object
Custom option object
type Number
default 30
type Boolean
default false
type jQuery
type Object
type Object
function axisRotation(move)Returns the axis rotation corresponding to the given move.
- params
-
{String}move
-
- returns
{String}
function didRender()Callback after render() calls.
- returns
void
function execute(sequence, duration)- params
-
{Array}sequence -
{Number}duration
-
- returns
void
function getCube()- returns
{Object}
function getPiece(piece)Calls RubikUtils.service.getStickersFromPiece to retrieve current stickers on given piece and returns them as string.
- params
-
{String}piece
-
- returns
{String}
function orientedPiece(target, move)- params
-
{String}target -
{String}move
-
- returns
{String}
function render(pieces)- params
-
{Array}pieces
-
- returns
void
function rotatedPieces(move)- params
-
{String}move
-
- returns
{Object}
function setCube(cube)- params
-
{Object}cube
-
- returns
void
function setPiece(piece, stickers)- params
-
{String}piece -
{String}stickers
-
- returns
void
function updateColors(colors)- params
-
{Object}colors
-
- returns
void
function willRender()Callback before render() calls.
- returns
void