Position of the images on the screen


(Andressa Rebeca Pinheiro) #1

Heys guys I need your help. I think this is easy but unfortunately I don’t know.

How can I set the images of the game on the screen? How can I know the exact localization?

I have a sky (background), a weapon and some ballons, but one is over the other.

this is my Entity class:

package { import net.flashpunk.Entity; import net.flashpunk.utils.Input; import net.flashpunk.graphics.Image; import net.flashpunk.FP;

public class MyEntity extends Entity
{
	
	//[Embed(source = 'Graphs/sky.png')] private const SKYY:Class;// the name sky can be differente
	[Embed(source = 'Graphs/arma.png')] private const ARMA:Class;				//arma constructor 					
	//[Embed(source = 'Graphs/ballon.png')] private const BALLON:Class;
	
	
	
	public function MyEntity()
	{
	
		//graphic = new Image(BALLON);
		graphic = new Image(ARMA);
		

	}
	
	override public function update():void
	{

		y = Input.mouseY; //get the mouse position

		y = FP.world.mouseY;// pega so as coordenadas verticais 
	}
}

}


(Alex Larioza) #2

I’m having a hard time understanding exactly what your question is, but I have a feeling its related to the render layer/depth of graphics. If that’s the case, you’re looking for the layer property of the Entity class.


(Andressa Rebeca Pinheiro) #3

Thank you ., I have found the answer. :slight_smile: