コード例 #1
0
 /// <summary>Draws the given player with its sprites.</summary>
 /// <remarks>Draws the given player with its sprites.</remarks>
 /// <param name="player">Player to draw.</param>
 public virtual void draw(com.brashmonkey.spriter.player.SpriterAbstractPlayer player
                          )
 {
     com.brashmonkey.spriter.draw.DrawInstruction[] instructions = player.getDrawInstructions
                                                                       ();
     for (int i = 0; i < player.getObjectsToDraw(); i++)
     {
         if (instructions[i].obj.isVisible())
         {
             this.draw(instructions[i]);
         }
         foreach (com.brashmonkey.spriter.player.SpriterAbstractPlayer pl in player.getAttachedPlayers
                      ())
         {
             if (player.getZIndex() == i)
             {
                 draw(pl);
                 pl.drawn = true;
             }
         }
     }
     foreach (com.brashmonkey.spriter.player.SpriterAbstractPlayer pl_1 in player.getAttachedPlayers
                  ())
     {
         if (!player.drawn)
         {
             draw(pl_1);
         }
         player.drawn = false;
     }
 }
コード例 #2
0
 protected virtual void drawBoxes(com.brashmonkey.spriter.player.SpriterAbstractPlayer
                                  player)
 {
     this.setDrawColor(0f, .25f, 1f, 1f);
     this.drawRectangle(player.getBoundingBox().left, player.getBoundingBox().bottom,
                        player.getBoundingBox().width, player.getBoundingBox().height);
     for (int j = 0; j < player.getObjectsToDraw(); j++)
     {
         com.brashmonkey.spriter.SpriterPoint[] points = player.getRuntimeObjects()[j].getBoundingBox
                                                             ();
         this.drawLine(points[0].x, points[0].y, points[1].x, points[1].y);
         this.drawLine(points[1].x, points[1].y, points[3].x, points[3].y);
         this.drawLine(points[3].x, points[3].y, points[2].x, points[2].y);
         this.drawLine(points[2].x, points[2].y, points[0].x, points[0].y);
     }
 }