【发布时间】:2018-05-24 09:38:38
【问题描述】:
我不知道在此处的坐标示例中哪些数字起到什么作用。我想他们的意思是把左上角放在这个位置,把右下角放在这个位置,但我不知道哪个数字对应哪个位置。
我一直在尝试使用数字来获得一个小的绿色矩形,但不断得到如下奇怪的结果,并且不知道哪些数字需要是什么顺序才能使矩形对称并且在底部
矩形应该是这样的
矩形的高度是50,屏幕的高度是1000,屏幕的宽度是1700。
这是我的绘图功能
function love.draw()
love.graphics.setColor(0.28, 0.63, 0.05) -- set the drawing color to green for the ground
love.graphics.polygon("fill", objects.ground.body:getWorldPoints(objects.ground.shape:getPoints())) -- draw a "filled in" polygon using the ground's coordinates
-- These are the grounds coordinates. -11650 950 13350 950 13350 1000 -11650 1000
love.graphics.setColor(0.76, 0.18, 0.05) --set the drawing color to red for the ball
love.graphics.circle("fill", objects.ball.body:getX(), objects.ball.body:getY(), objects.ball.shape:getRadius())
love.graphics.setColor(0.20, 0.20, 0.20) -- set the drawing color to grey for the blocks
love.graphics.polygon("fill", objects.block1.body:getWorldPoints(objects.block1.shape:getPoints()))
love.graphics.polygon("fill", objects.block2.body:getWorldPoints(objects.block2.shape:getPoints()))
print(objects.block1.body:getWorldPoints(objects.block1.shape:getPoints()))
end
【问题讨论】: