2014-02-14 87 views
0

我正在使用AndEngine,我想在頂部繪製一條線作爲我的屏幕的頂部..並且一個在底部作爲地面。AndEngine畫線的頂部和底部的屏幕

如何獲取座標?

   final Line line = new Line(StartX, StartY, lastX, 
         lastY, this.getVertexBufferObjectManager()); 

enter image description here

一張圖片展示了我的意思。黑線是我想要的,紅點是我需要繪製黑線的座標。

回答

2

我發現它,屋頂是

   line1 = new Line(0, 0, width, 
         0, getVertexBufferObjectManager()); 

和接地

   line1 = new Line(0, width, height, 
         width, getVertexBufferObjectManager()); 

通過使用UR屏幕比率。

+0

地面線實際上應該是:new Line(0,height,width,height,getVertexBufferObjectManager()); –

相關問題