コード例 #1
0
ファイル: Player.cs プロジェクト: kjin/Ribbons
 public void Draw(Canvas canvas)
 {
     for(int i = 0; i+1 < boundingBox.Count; i++)
     {
         canvas.DrawLine(Color.OrangeRed, 5, boundingBox[i] + body.Position, boundingBox[i+1] + body.Position);
     }
     canvas.DrawLine(Color.OrangeRed, 5, boundingBox[boundingBox.Count-1] + body.Position, boundingBox[0] + body.Position);
 }
コード例 #2
0
ファイル: UnloopedRibbon.cs プロジェクト: kjin/Ribbons
 public override void Draw(Canvas canvas)
 {
     for (int i = 0; i + 1 < ribbonPoints.Count; i++)
     {
         canvas.DrawLine(Color.DarkRed, 5, ribbonPoints[i] + body.Position, ribbonPoints[i + 1] + body.Position);
     }
     canvas.DrawLine(Color.DarkRed, 5, ribbonPoints[ribbonPoints.Count - 1] + body.Position, ribbonPoints[0] + body.Position);
 }
コード例 #3
0
ファイル: Ground.cs プロジェクト: kjin/Ribbons
 public void Draw(Canvas canvas)
 {
     List<Vector2> vectors = shape.points;
     for (int i = 0; i + 1 < vectors.Count; i++)
     {
         canvas.DrawLine(Color.DarkOliveGreen, 5, vectors[i], vectors[i + 1]);
     }
     canvas.DrawLine(Color.DarkOliveGreen, 5, vectors[vectors.Count - 1], vectors[0]);
 }
コード例 #4
0
ファイル: ContextManager.cs プロジェクト: kjin/Ribbons
 public ContextManager(ContentManager content, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch)
 {
     assets = new AssetManager();
     assets.LoadContent(content, graphicsDevice);
     canvas = new Canvas(assets, graphicsDevice, spriteBatch);
     input = new InputController(assets);
     storage = new StorageManager();
     LayoutTree layoutTree = LayoutEngine.BuildLayout(content.Load<Text>("master"));
     Integrate(assets, layoutTree.Root);
     assets.GetLevel("Level1");
 }
コード例 #5
0
ファイル: GraphicsHelper.cs プロジェクト: kjin/Ribbons
 public static void DrawGrid(Canvas canvas, RectangleF bounds, float thickness, float lineEvery)
 {
     canvas.DrawLine(Color.Red, thickness, new Vector2(bounds.Left, 0), new Vector2(bounds.Right, 0));
     canvas.DrawLine(Color.Green, thickness, new Vector2(0, bounds.Bottom), new Vector2(0, bounds.Top));
     for (float x = -lineEvery; x >= bounds.Left; x -= lineEvery)
         canvas.DrawLine(Color.Gray, thickness, new Vector2(x, bounds.Bottom), new Vector2(x, bounds.Top));
     for (float x = lineEvery; x <= bounds.Right; x += lineEvery)
         canvas.DrawLine(Color.Gray, thickness, new Vector2(x, bounds.Bottom), new Vector2(x, bounds.Top));
     for (float y = -lineEvery; y >= bounds.Top; y -= lineEvery)
         canvas.DrawLine(Color.Gray, thickness, new Vector2(bounds.Left, y), new Vector2(bounds.Right, y));
     for (float y = lineEvery; y <= bounds.Bottom; y += lineEvery)
         canvas.DrawLine(Color.Gray, thickness, new Vector2(bounds.Left, y), new Vector2(bounds.Right, y));
 }
コード例 #6
0
ファイル: Ribbon.cs プロジェクト: kjin/Ribbons
 public abstract void Draw(Canvas c);