黑眼圈而不是电晕中的图像

时间:2015-05-13 20:46:52

标签: android image lua corona

我是Corona的新手和一般的编码,我现在正在玩app reskinning。我试图将自己的图像添加到游戏中,此时我正在获得黑色圆圈而不是我选择的图像,而游戏中的其他所有内容似乎都很好。这就是之前的代码:

Ball_Player = display.newCircle( PlayerX, PlayerY, (25 * ((GameScreen.width  * (_H / 1300))) / 600)) --(9 +((7 - PlayerSpeed) * 5 ))
Ball_Player:setFillColor(1, 1, 1, 1);
Ball_Player.alpha = 0;

Ball_Player1 = display.newCircle( PlayerX, PlayerY, (25 * ((GameScreen.width * (_H / 1300))) / 700)) --(9 +((7 - PlayerSpeed) * 5 ))
Ball_Player1:setFillColor(1, 1, 1, 1);
Ball_Player1.alpha = 0;

Ball_Player2 = display.newCircle( Player2X, Player2Y, (25 * ((GameScreen.width * (_H / 1300))) / 700)) --(9 +((7 - PlayerSpeed) * 5 ))
Ball_Player2:setFillColor(1, 1, 1, 1);
Ball_Player2.alpha = 0;

Ball_Enemy1 = display.newCircle( PlayerX, PlayerY, (35 * ((GameScreen.width * (_H / 1300))) / 600));
Ball_Enemy1:setFillColor(0.8, 0.2, 0.2);
Ball_Enemy1.alpha = 0;

Ball_Enemy2 = display.newCircle( PlayerX, PlayerY, (35 * ((GameScreen.width * (_H / 1300))) / 600));
Ball_Enemy2:setFillColor(0.8, 0.2, 0.2);
Ball_Enemy2.alpha = 0;

Ball_Enemy3 = display.newCircle( PlayerX, PlayerY, (35 * ((GameScreen.width * (_H / 1300))) / 600));
Ball_Enemy3:setFillColor(0.8, 0.2, 0.2);
Ball_Enemy3.alpha = 0;

Ball_Enemy4 = display.newCircle( PlayerX, PlayerY, (35 * ((GameScreen.width * (_H / 1300))) / 600));
Ball_Enemy4:setFillColor(0.8, 0.2, 0.2);
Ball_Enemy4.alpha = 0;

Ball_Enemy5 = display.newCircle( PlayerX, PlayerY, (35 * ((GameScreen.width * (_H / 1300))) / 600));
Ball_Enemy5:setFillColor(0.8, 0.2, 0.2);
Ball_Enemy5.alpha = 0;

这些是我所做的改变。在这一点上,我真的只是从在线教程拼凑的东西,所以欢迎任何和所有指导!谢谢!

Ball_Player = display.newCircle( 0, 0, 31.5)  
Ball_Player.x = display.contentCenterX
Ball_Player.y = display.contentCenterY
Ball_Player.fill = {"images/playerearth.png"}

Ball_Player1 = display.newCircle( 0, 0, 31.5 )
Ball_Player1.x = display.contentCenterX
Ball_Player1.y = display.contentCenterY
Ball_Player1.fill = {"images/playerearth.png"}

Ball_Player2 = display.newCircle( 0, 0, 31.5)
Ball_Player2.x = display.contentCenterX
Ball_Player2.x = display.contentCenterY
Ball_Player2.fill = {"images/playermoon.png"}

Ball_Enemy1 = display.newCircle( 0, 0, 31.5)
Ball_Enemy1.x = display.contentCenterX
Ball_Enemy1.y = display.contentCenterY
Ball_Enemy1.fill = {"images/enemy1.png"}

Ball_Enemy2 = display.newCircle( 0, 0, 31.5)
Ball_Enemy2.x = display.contentCenterX
Ball_Enemy2.y = display.contentCenterY
Ball_Enemy2.fill = {"images/enemy2.png"}

Ball_Enemy3 = display.newCircle( 0, 0, 31.5 )
Ball_Enemy3.x = display.contentCenterX
Ball_Enemy3.y = display.contentCenterY
Ball_Enemy3.fill = {"images/enemy3.png"}

Ball_Enemy4 = display.newCircle( 0, 0, 31.5 )
Ball_Enemy4.x = display.contentCenterX
Ball_Enemy4.y = display.contentCenterY
Ball_Enemy4.fill = {"images/enemy4.png"}

Ball_Enemy5 = display.newCircle( 0, 0, 31.5 )
Ball_Enemy5.x = display.contentCenterX
Ball_Enemy5.y = display.contentCenterY
Ball_Enemy5.fill = {"images/enemy5.png"}

1 个答案:

答案 0 :(得分:1)

您需要正确的填充参数。例如:

Ball_Enemy4.fill = {type="image", filename="images/enemy4.png"}