Page 1 of 1

Click and Point-Adventure Game Helps

PostPosted: Mon Jun 27, 2011 3:36 am
by XclusiveGames
Click and Point-Adventure Game
1.Can some say me how to move the frame(view) to another frame when a button or an area is clicked :)

Re: Click and Point-Adventure Game Helps

PostPosted: Mon Jun 27, 2011 5:38 am
by skydereign
Well do you want it to be smooth or jump there? If you want it to just jump, have a filled region stretched over the view (same size), set its zdepth to 0, and add this code.
filled -> Mouse Button Down (left) -> Script Editor
Code: Select all
view.x=xmouse-width/2;
view.y=ymouse-height/2;


You could parent that actor to the view, but due to zdepth issues, I'd either use creator, or something like this.
filled -> Draw Actor -> Script Editor
Code: Select all
x=view.x;
y=view.y;


If you want it to be smooth movement, you should have this as your mouse button down event.
filled -> Mouse Button Down (left) -> Script Editor
Code: Select all
MoveTo("view", -width/2, -height/2, 10, "Mouse Position", "(none)");


Just to note since the view's and filled actor's width and height are the same you don't need to specify view.width or view.height.