public void OnPaint(bool canvasDirty) { //Log.Debug ("{0} OnPaint: {1}", classname, this.mCube.UniqueId); //Paint Background Log.Debug (classname + " OnPaint"); mCube.FillScreen (bgColor); Cube[] connected = CubeHelper.FindConnected (mCube); //Get all the connected cubes if (connected.Length == 1) { StringPainter painter = new StringPainter (mCube, "=? ", mWrapper.mColor, mWrapper.mSize); painter = null; //Free the resource } else { StringPainter painter = new StringPainter (mCube, "=" + result.ToString (), mWrapper.mColor, mWrapper.mSize); painter = null; //Free the resource } /* if (result != 99) { StringPainter painter = new StringPainter (mCube, "= " + result.ToString ()); painter = null; //Free the resource } else { StringPainter painter = new StringPainter (mCube, "= ?"); painter = null; //Free the resource }*/ mCube.Paint (); }
//On on Neighbore removed event. return to default state private void OnNeighborRemove(Cube cube1, Cube.Side side1, Cube cube2, Cube.Side side2) { //Set the draw flag mWrapper.mNeedDraw = true; Cube[] connected = CubeHelper.FindConnected (mCube); if (connected.Length == 1) { //Draw the default state mCube.FillScreen (bgColor); StringPainter painter = new StringPainter (mCube, "Hint", mWrapper.mColor, 24); painter = null; //Free the resource lastNeighbor = null; } }
public void OnSetup(string trainsitionId) { Log.Debug (classname + " OnSetup"); mCube.FillScreen (bgColor); StringPainter painter = new StringPainter (mCube, "Hint", mWrapper.mColor, 24); mCube.Paint (); }
public void OnPaint(bool canvasDirty) { Log.Debug ("{0} OnPaint: {1}", classname, this.mCube.UniqueId); //Paint Background String operatorString = Constants.opQuestion; if (mWrapper.mValue == 1) { //Add operatorString = Constants.opAdd; } else if (mWrapper.mValue == 2) { //Subtract operatorString = Constants.opSub; } else if (mWrapper.mValue == 3) { //Multiply operatorString = Constants.opMul; } else if (mWrapper.mValue == 4) { //Divide operatorString = Constants.opDiv; } mCube.FillScreen (bgColor); StringPainter painter = new StringPainter (mCube, operatorString, mWrapper.mColor, mWrapper.mSize); painter = null; mCube.Paint (); }