【发布时间】:2018-07-27 12:17:23
【问题描述】:
我已使用此代码在 CCLayer 中添加背景图像,但它不起作用:
public class GameLayer : CCLayerColor
{
private CCSprite background;
public GameLayer() : base(CCColor4B.Transparent)
{
background = new CCSprite("cbg")
{
AnchorPoint = new CCPoint(0, 0),
IsAntialiased = true,
Position = new CCPoint(0, 0),
};
this.AddChild(background);
}
}
我的问题是图像正在显示但不是屏幕大小作为背景图像,它只是显示在屏幕的左下角。
编辑:
已解决:
为了解决这个问题,我将 Contnetsize 添加到与屏幕尺寸相同的图像中。
【问题讨论】:
标签: xamarin xamarin.forms xamarin.android game-development cocossharp