Help me ! (camera problem)
by Alexandre Fredenucci · in Torque X 2D · 04/21/2009 (3:43 pm) · 3 replies
Hi all !
I have a little problem of camera with the platform kit for xna, i have replace the player example by my player sprite (who's little more tall) I can not refocus the camera in my player, i try with Camera tool in torque x builder but it doesn't work :/ what line of code i must change in xna ? (sorry for my bad english ! i hope it's understandable ^^;)
my problem :

I have a little problem of camera with the platform kit for xna, i have replace the player example by my player sprite (who's little more tall) I can not refocus the camera in my player, i try with Camera tool in torque x builder but it doesn't work :/ what line of code i must change in xna ? (sorry for my bad english ! i hope it's understandable ^^;)
my problem :

About the author
#2
If you are using the platformer demo then you will find a method called _mountCamera() in the file PlayerDragonActorComponent.cs
Look for this line: camera.Mount(_actor, String.Empty, new Vector2(0, -1), 0.0f, true);
The Vector2 is the amount to offset the camera from the player character it is following. You can change this so that your taller character will fit on the screen.
04/27/2009 (6:36 am)
It sounds like the problem is the size of the new player character rather than mounting the camera to the player.If you are using the platformer demo then you will find a method called _mountCamera() in the file PlayerDragonActorComponent.cs
Look for this line: camera.Mount(_actor, String.Empty, new Vector2(0, -1), 0.0f, true);
The Vector2 is the amount to offset the camera from the player character it is following. You can change this so that your taller character will fit on the screen.
Associate John Kanalakis
EnvyGames
John K.
www.envygames.com