I am trying to use ogmo to place NPC entities and they have a value in OGMO called inputSprite, which points to an embedded source in an Assets class. The Problem is it is a string value in ogmo but in the spritemap constructor it is of type *.
Here is the basic adding part in the world.
for each (node in mapXML.Entities.NPC)
{
add(new NPC(int(node.@initY), int(node.@initX), String(node.@inputSprite)));
}
and here is the constructor for NPC
public function NPC(initX:Number, initY:Number, inputSprite:*)
{
this.x = initX;
this.y = initY;
layer = 5;
// inputSprite = Assets.EDDY;
this.spriteNPC = new Spritemap(inputSprite, 29, 35);
spriteNPC.add("Right", [0, 1, 2, 3], 15, true);
spriteNPC.add("Left", [4, 5, 6, 7], 15, true);
spriteNPC.add("StandR", [0], 15, false);
spriteNPC.add("StandL", [4], 15, false);
spriteNPC.add("JumpR", [8], 15, false);
spriteNPC.add("JumpL", [9], 15, false);
graphic = spriteNPC;
}
The string in the ogmo entity is exactly the same as the commented out Assets.EDDY but I keep getting an error invalid source image when trying to run the game. However if the line is uncommented it works fine even though both appear exactly the same.
Do I have to change the ogmo imported entity’s String(inputSprite) to a * or something?