Page 1 of 1

Re: view question

PostPosted: Sat Jul 03, 2010 8:14 pm
by Bee-Ant
I thought you've already ask this so many times...

Put this code on View -> Draw Actor -> Script Editor :
Code: Select all
x=max(Player.x-width/2-2,min(x,Player.x-width/2+2));
y=max(Player.y-width/2-2,min(y,Player.y-width/2+2));


*Note: Change "Player" to your player's name.

Re: view question

PostPosted: Sat Jul 03, 2010 8:36 pm
by Bee-Ant
sp1d3r wrote:is there any ways to keep the player always in the middle of the view no matter if u fall ,jump,jump down and across,jump up and across

sp1d3r wrote:i dont want it to be alway center on the y

It's quite confusing...I dunno which one you really need... :roll:

Re: view question

PostPosted: Sun Jul 04, 2010 7:05 am
by savvy
why dont u try and use the parent function, change the views parent to the actor you wish

Re: view question

PostPosted: Sun Jul 04, 2010 7:09 am
by savvy
or try this, its a bit long winded but it works. put all of these on your view in a draw actor function.
Code: Select all
if(player.x>x)
{
x+=5;
}

if(player.x<x)
{
x-=5;
}

if(player.y>y)
{
y-=5;
}

if(player.y<y)
{
y+=5;
}

Re: view question

PostPosted: Sun Jul 04, 2010 9:09 am
by Bee-Ant
savvy wrote:
Code: Select all
if(player.x>x)
{
x+=5;
}

if(player.x<x)
{
x-=5;
}

if(player.y>y)
{
y-=5;
}

if(player.y<y)
{
y+=5;
}


Bee-Ant wrote:
Code: Select all
x=max(Player.x-width/2-2,min(x,Player.x-width/2+2));
y=max(Player.y-width/2-2,min(y,Player.y-width/2+2));

This code do the samething...with much more shorter...