【发布时间】:2015-09-30 20:25:48
【问题描述】:
获取此代码:
function createGUIHud():Void
{
this.screen.gameHud = new NormalGameHud(10, 0, this.screen.getTextureAtlas());
this.screen.gameHud.x = FlxG.width - (this.screen.gameHud.width + GameSize.getPositionByPlatform(10));
this.screen.gameHud.y = GameSize.getPositionByPlatform(10);
}
// NormalGameHud.hx
public function new(lives:Int = 10, corn:Int = 0, textureAtlas:SparrowData)
{
super(0, 0, 30);
this.lives = lives;
this.cornCount = corn;
this.textureAtlas = textureAtlas;
this.createScoreboard();
this.createLivesCount();
this.createCornCounter();
}
textureAtlas 是通过引用传递还是被复制?
我知道 PHP 通过引用传递对象,除非另有说明(以 & 为前缀),否则会复制诸如数组之类的内容。 Haxe 也一样吗?
【问题讨论】:
标签: haxe