Page 1 of 1

Problems with the view

PostPosted: Sat Jan 24, 2009 8:41 am
by metaknight22
I want to make the view follow the main character on the x axis and the background on the y axis.
This is the code I'm using.
Code: Select all
x = KirbyStarship.x-width/2;
y = background.y-height;

This follows the main character and the background but it is cutting out half the background.
Any ideas???

Re: Problems with the view

PostPosted: Sat Jan 24, 2009 9:50 am
by skydereign
I believe that you need to change it to,
Code: Select all
x = KirbyStarship.x-width/2;
y = background.y-height/2;

Re: Problems with the view

PostPosted: Sat Jan 24, 2009 11:16 am
by metaknight22
Nah I already tried that. It puts the middle of the background in the bottom of the screen.

Re: Problems with the view

PostPosted: Sat Jan 24, 2009 11:30 am
by skydereign
How do you mean, you want the view to follow the background? Can you post your game on, or at least that bit? It seems to work with me. The only mess up I can find is if you position your background wrong, because of the actual reference to the actors x or y. So if it is placed right I think it will work.

Re: Problems with the view

PostPosted: Sun Jan 25, 2009 1:40 am
by metaknight22
I want the bottom of the actor named Ground to be at the bottom of the screen without any of it being cut off.
Thanks for your help. :D

Re: Problems with the view

PostPosted: Sun Jan 25, 2009 2:11 am
by jimmynewguy
srry but you have to post the Data folder with the GED not just the GED :D

Re: Problems with the view

PostPosted: Sun Jan 25, 2009 3:32 am
by skydereign
I am shooting in the dark here, as your ged file does not have the data, but I believe this is what you want.
Code: Select all
y=Ground.y+Ground.height/2-height;

Re: Problems with the view

PostPosted: Sun Jan 25, 2009 5:23 am
by metaknight22
It worked!!! :D
Thanks for all your help.