當前位置: 首頁>>代碼示例>>C#>>正文


C# Cube.Paint方法代碼示例

本文整理匯總了C#中Sifteo.Cube.Paint方法的典型用法代碼示例。如果您正苦於以下問題:C# Cube.Paint方法的具體用法?C# Cube.Paint怎麽用?C# Cube.Paint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sifteo.Cube的用法示例。


在下文中一共展示了Cube.Paint方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddCubeToArray

 void AddCubeToArray(Cube c, int index)
 {
     if (index < 0 || index >= cubes.Length)
         return;
     RemoveCubeFromArray (c);
     if (cubes[index] != null)
         RemoveCubeFromArray (cubes[index]);
     c.FillScreen(Color.Black);
     c.Image("heart_"+heartChar+"_"+index, 0, 0, 0, 0, 128, 128, 1, 0);
     c.Paint();
     cubes[index] = c;
 }
開發者ID:quinkennedy,項目名稱:YouCompleteMe,代碼行數:12,代碼來源:YouCompleteMe.cs

示例2: OnTilt

        private void OnTilt(Cube cube, Cube.Side direction)
        {
            switch (direction)
            {
                case Cube.Side.TOP:
                    cube.FillRect(new Color(0, 200, 0), 54, 54, 20, 20); // increasingly dark green
                    break;

                case Cube.Side.BOTTOM:
                    cube.FillRect(new Color(0, 150, 0), 54, 54, 20, 20);
                    break;

                case Cube.Side.LEFT:
                    cube.FillRect(new Color(0, 100, 0), 54, 54, 20, 20);
                    break;

                case Cube.Side.RIGHT:
                    cube.FillRect(new Color(0, 50, 0), 54, 54, 20, 20);
                    break;
                default:
                    cube.FillRect(Color.White, 54, 54, 20, 20); // extremely light green
                    break;
            }

            cube.Paint();
        }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:26,代碼來源:CubeTestApp.cs

示例3: OnShake

 private void OnShake(Cube cube)
 {
     Random rand = new Random();
     cube.FillRect(new Color(rand.Next(0, 256), rand.Next(0, 256), rand.Next(0, 256)), 54, 54, 20, 20);
     cube.Paint();
 }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:6,代碼來源:CubeTestApp.cs

示例4: OnPress

 private void OnPress(Cube cube)
 {
     cube.FillScreen(new Color(255, 0, 0)); // red
     cube.Paint();
 }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:5,代碼來源:CubeTestApp.cs

示例5: OnFlip

 private void OnFlip(Cube cube, bool newOrientationIsUp)
 {
     cube.FillRect(new Color(0, 0, 255), 54, 54, 20, 20); // blue
     cube.Paint();
 }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:5,代碼來源:CubeTestApp.cs

示例6: OffShake

 private void OffShake(Cube cube, int duration)
 {
     cube.FillScreen(Color.White);
     cube.Paint();
 }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:5,代碼來源:CubeTestApp.cs

示例7: DrawFace

 private static void DrawFace(Cube c, int X, int Y, int PicX, int PicY, int PicW, int PicH)
 {
     //               Log.Debug("drawing on " + c.UniqueId + " at " + X.ToString() + "." + Y.ToString() + ", " + PicW.ToString() + "x" + PicH.ToString()  + ", from " + PicX.ToString() + "." + PicY.ToString());
       c.Image("doomfaces", X, Y, PicX, PicY, PicW, PicH, 1, 0);
       c.Paint();
 }
開發者ID:otakup0pe,項目名稱:sifteo4devops,代碼行數:6,代碼來源:Util.cs

示例8: HighlightSuccessCube

 private void HighlightSuccessCube(Cube cube)
 {
     cube.FillRect(new Color(153, 255, 0), 0, 0, Cube.SCREEN_WIDTH, _cubeHighlightWidth); // top green
     cube.FillRect(new Color(153, 255, 0), 0, Cube.SCREEN_HEIGHT - _cubeHighlightWidth, Cube.SCREEN_WIDTH,
                   _cubeHighlightWidth); // bottom green
     cube.FillRect(new Color(153, 255, 0), 0, 0, _cubeHighlightWidth, Cube.SCREEN_HEIGHT); // left green
     cube.FillRect(new Color(153, 255, 0), Cube.SCREEN_WIDTH - _cubeHighlightWidth, 0, _cubeHighlightWidth,
                   Cube.SCREEN_HEIGHT); // right green
     cube.Paint();
 }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:10,代碼來源:SimonSaysApp.cs

示例9: RemoveCubeFromArray

 /// <summary>
 /// Removes the Cube from the Array. Also clears Cube's screen.
 /// </summary>
 /// <returns>
 /// <c>true</c> iff the Cube was previously in the Array
 /// </returns>
 /// <param name='c'>
 /// The specific Cube object to remove from the Array
 /// </param>
 bool RemoveCubeFromArray(Cube c)
 {
     int index = IsCubeInArray (c);
     if (index >= 0){
         cubes[index] = null;
         c.FillScreen(Color.White);
         c.Paint();
         return true;
     }
     return false;
 }
開發者ID:quinkennedy,項目名稱:YouCompleteMe,代碼行數:20,代碼來源:YouCompleteMe.cs

示例10: DrawTo

        /// <summary>
        /// Draws to the supplied cube.
        /// </summary>
        /// <param name='cube'>
        /// The cube to which the room should be drawn.
        /// </param>
        public void DrawTo(Cube cube)
        {
            // draw the background
            cube.FillScreen(bgColor);

            // draw the center
            cube.FillRect(passageColor, segmentSize, segmentSize, segmentSize, segmentSize);

            // draw open passages
            for (int i=0; i<entryStates.Length; i++)
            {
                if (entryStates[i] == EntryState.Closed) continue;
                int x=segmentSize, y=segmentSize;
                switch ((Cube.Side)i)
                {
                case Cube.Side.BOTTOM:
                    y = 2*segmentSize;
                    break;
                case Cube.Side.LEFT:
                    x = 0;
                    break;
                case Cube.Side.RIGHT:
                    x = 2*segmentSize;
                    break;
                case Cube.Side.TOP:
                    y = 0;
                    break;
                }
                cube.FillRect(passageColor, x, y, segmentSize, segmentSize);
            }

            // paint the cube
            cube.Paint();
        }
開發者ID:dennispr,項目名稱:Reunion,代碼行數:40,代碼來源:MazeRoom.cs

示例11: DrawTo

        /// <summary>
        /// Draws to the supplied cube.
        /// </summary>
        /// <param name='cube'>
        /// The cube to which the room should be drawn.
        /// </param>
        public void DrawTo(Cube cube)
        {
            // determine row and column to use in the atlas
            GraphicRow row = GraphicRow.Neither;
            GraphicCol col = GraphicCol.Neither;
            if (entryStates[(int)Cube.Side.BOTTOM] == EntryState.Open &&
                entryStates[(int)Cube.Side.TOP] == EntryState.Open)
                row = GraphicRow.TopAndBottom;
            else if (entryStates[(int)Cube.Side.BOTTOM] == EntryState.Open)
                row = GraphicRow.Bottom;
            else if (entryStates[(int)Cube.Side.TOP] == EntryState.Open)
                row = GraphicRow.Top;
            if (entryStates[(int)Cube.Side.LEFT] == EntryState.Open &&
                entryStates[(int)Cube.Side.RIGHT] == EntryState.Open)
                col = GraphicCol.LeftAndRight;
            else if (entryStates[(int)Cube.Side.LEFT] == EntryState.Open)
                col = GraphicCol.Left;
            else if (entryStates[(int)Cube.Side.RIGHT] == EntryState.Open)
                col = GraphicCol.Right;

            // select the proper portion of the atlas
            cube.Image(graphic, 0, 0, (int)col*Cube.SCREEN_WIDTH, (int)row*Cube.SCREEN_HEIGHT);

            // paint the cube
            cube.Paint();
        }
開發者ID:amechtley,項目名稱:Reunion,代碼行數:32,代碼來源:MazeRoom.cs

示例12: ShowImage

 public void ShowImage(Cube cube, String name)
 {
     cube.FillScreen(Color.Black);
     cube.Image(name, 0, 0, 0, 0, 128, 128, 1, 0);
     cube.Paint();
 }
開發者ID:gertjana,項目名稱:AnimalMatch,代碼行數:6,代碼來源:AnimalMatchApp.cs

示例13: ChangeCubeImage

        private static void ChangeCubeImage(Cube cube, Color color)
        {
            cube.FillScreen(color);
            string cubeChar = ((CubeData) cube.userData).CubeChar;
            string imageSource;

            if ("" != cubeChar)
                imageSource = cubeChar + ".png";
            else
                imageSource = "wat.png";

            cube.Image(imageSource, x: _cubeX, y: _cubeY, sourceX: _sourceX, sourceY: _sourceY, w: _width, h: _height,
                       scale: _scale, rotation: _rotation);
            cube.Paint();
        }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:15,代碼來源:WordApp.cs

示例14: ChangeCubeImg

        private void ChangeCubeImg(Cube cube, Fraction fraction, Color color)
        {
            cube.FillScreen(color);

            //            _imageSourceNum = fraction.GetNumerator() + ".png";
            //            _imageSourceDen = fraction.GetDenominator() + ".png";
            switch (fraction.GetNumerator())
            {
                case 1:
                    _imageSourceNum = "1.png";
                    break;
                case 2:
                    _imageSourceNum = "2.png";
                    break;
                case 3:
                    _imageSourceNum = "3.png";
                    break;
                case 4:
                    _imageSourceNum = "4.png";
                    break;
                case 5:
                    _imageSourceNum = "5.png";
                    break;
                case 6:
                    _imageSourceNum = "6.png";
                    break;
                case 7:
                    _imageSourceNum = "7.png";
                    break;
                case 8:
                    _imageSourceNum = "8.png";
                    break;
                case 9:
                    _imageSourceNum = "9.png";
                    break;
                case 10:
                    _imageSourceNum = "10.png";
                    break;
            }

            switch (fraction.GetDenominator())
            {
                case 1:
                    _imageSourceDen = "1.png";
                    break;
                case 2:
                    _imageSourceDen = "2.png";
                    break;
                case 3:
                    _imageSourceDen = "3.png";
                    break;
                case 4:
                    _imageSourceDen = "4.png";
                    break;
                case 5:
                    _imageSourceDen = "5.png";
                    break;
                case 6:
                    _imageSourceDen = "6.png";
                    break;
                case 7:
                    _imageSourceDen = "7.png";
                    break;
                case 8:
                    _imageSourceDen = "8.png";
                    break;
                case 9:
                    _imageSourceDen = "9.png";
                    break;
                case 10:
                    _imageSourceDen = "10.png";
                    break;
            }

            cube.Image(_imageSourceNum, _cubeX, _cubeYNum, _sourceX, _sourceY, _width, _height, _scale,
                       _rotation);
            cube.Image(_imageSourceDen, _cubeX, _cubeYDen, _sourceX, _sourceY, _width, _height, _scale,
                       _rotation);
            cube.FillRect(Color.Black, _cubeX, _cubeYDen - 10, 65, 10);
            cube.Paint();
        }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:81,代碼來源:FractionOrderingApp.cs

示例15: HighlightCube

        private void HighlightCube(Cube cube)
        {
            Color highlight = Color.White;

            cube.FillRect(highlight, 0, 0, Cube.SCREEN_WIDTH, _cubeHighlightWidth); // top red
            cube.FillRect(highlight, 0, Cube.SCREEN_HEIGHT - _cubeHighlightWidth, Cube.SCREEN_WIDTH,
                          _cubeHighlightWidth); // bottom red
            cube.FillRect(highlight, 0, 0, _cubeHighlightWidth, Cube.SCREEN_HEIGHT); // left red
            cube.FillRect(highlight, Cube.SCREEN_WIDTH - _cubeHighlightWidth, 0, _cubeHighlightWidth,
                          Cube.SCREEN_HEIGHT); // right red
            cube.Paint();
        }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:12,代碼來源:SimonSaysApp.cs


注:本文中的Sifteo.Cube.Paint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。