View Actor Refocusing

Game Editor comments and discussion.

View Actor Refocusing

Postby Turon » Tue Jul 02, 2013 8:09 pm

How do you refocus the view actor on the player after it has go out of vision,
But still have the view actor aline on the grids?
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: View Actor Refocusing

Postby skydereign » Tue Jul 02, 2013 9:46 pm

You can use the normal repositioning code, but add this after it.
Code: Select all
x = round(x/32)*32;
y = round(y/32)*32;

This code is set for the view actor, and 32 is the size of the grid.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: View Actor Refocusing

Postby Turon » Wed Jul 03, 2013 10:38 am

How do you move the view actor with the player even though the player is not the view actor parent actor?
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: View Actor Refocusing

Postby skydereign » Wed Jul 03, 2013 9:00 pm

Turon wrote:How do you move the view actor with the player even though the player is not the view actor parent actor?

Have you tried to figure this out by searching the forums? There are many examples of this already. Here is another one.
view -> Draw Actor -> Script Editor
Code: Select all
x = player.x - width/2;
y = player.y - height/2;

That is a very simple tracking, that acts like parenting.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: View Actor Refocusing

Postby Turon » Thu Jul 04, 2013 2:26 pm

Thank You Skydereign!
I am searching around existing topics to refine what I learned.
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest