The Daily Click ::. Forums ::. Klik Coding Help ::. Scrolling before transition
 

Post Reply  Post Oekaki 
 

Posted By Message

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
31st July, 2009 at 15:54:47 -

In my game the character is the bottom of the screen and I set the opening transition to fade. But when I start the frame it fades into the blank space where the dotted line showing the window size is. And once the transition is done it moves right back down to where the player is since I set it to center window position on the player. Is there any way to make it fade onto the player at the start?

 
n/a

nim



Registered
  17/05/2002
Points
  7234
31st July, 2009 at 16:40:33 -

If you're looking for a "Scroll before transition" checkbox, I don't think one exists. If you're looking for a simple solution, take a screen grab of the game right after the transition and paste this as an active at (0,0) in your game, then delete it immediately.

 
//

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
31st July, 2009 at 16:46:30 -

I just make a big black active and make my own fade engine. That way it can scroll while fading in and it doesn't start out in that corner and I can call on it multiple times during runtime and change the color.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
31st July, 2009 at 16:51:29 -

Thanks for the help. I think Jon's way is probably best as you can do different colors and such. All I had to do way to make an active the size of the window and tell it to be destroyed at the start of the frame.

 
n/a

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48488

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
1st August, 2009 at 15:09:17 -

As well as your standard scrolling events you need this event too.

Start Of Frame:
Set XFrame to X position of player
Set YFrame to Y position of player

That's all you need to do

Edited by an Administrator

 
n/a

nim



Registered
  17/05/2002
Points
  7234
1st August, 2009 at 15:28:40 -


Originally Posted by Chris Street
As well as your standard scrolling events you need this event too.

Start Of Frame:
Set XFrame to X position of player
Set YFrame to Y position of player

That's all you need to do



Does that centre the scrolling on the player sprite before the transition? I tried and it doesn't work for me.

 
//

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48488

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
1st August, 2009 at 15:36:27 -

That's exactly what it does, but you also need to check the "Create at Start" box in the objects properties - and position the event high up in the event listings - since MMF runs through them in order.

By the way, this works in MMF2, not sure if its applicable in earlier Clickteam products.

 
n/a

nim



Registered
  17/05/2002
Points
  7234
1st August, 2009 at 16:05:21 -

Heh, I tried again and still can't get it to work. MMF R247 here. It finished the transition then does the Start of Frame event.

 
//

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48488

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
1st August, 2009 at 16:07:12 -

Try Build248, that might make a difference

 
n/a

nim



Registered
  17/05/2002
Points
  7234
1st August, 2009 at 17:35:19 -

Ah, that reminds me. I should upgrade to 248!

edit: Still doesn't work. We must be thinking of different things here.

Edited by nim

 
//

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
1st August, 2009 at 23:30:14 -

little klik trick most people aren't aware of:

"Start of Game" events are executed *before* the normal events loop; the compiled game will run a single frame of all your immediate start of game events, including all the functions & stuff they are used to, before the rest. So an easy example is that if you had code like this, in this order:

"only repeat this event once: set counter to counter * 2"
"start of game: add 1 from counter"

the counter would display 2, instead of the logical 1, even though the "only once" event was higher in the code.
So you need to position the game's camera inside your "Start of Frame" events.

But like circy says, you must check "create at start, and create before fadein" if you want these objects to be visible in the transition in a different place than top left of the frame area.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
1st August, 2009 at 23:32:17 -

or in other words, imagine your "Start of Game" events as if they were in a fast loop, and the game runs this fast loop before rendering the first frame. Its a neat little trick


This always bugged me since TGF till I figured it out. I always assumed "Start of Frame" simply told the game to run this only on the very first read/eval loop of the code, and not on any further ones. It never occurred to me that the game actually runs it *before* the first frame of code, by rendering it as a special immediate action. This is why it is flagged in red in MMF2's event editor by default, I suppose. But unlike fast loops, it seems to work even if you put it *anywhere* in a piece of code instead of as the first one

Edited by Pixelthief

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

nim



Registered
  17/05/2002
Points
  7234
2nd August, 2009 at 04:17:39 -


Originally Posted by Pixelthief
"Start of Game" events are executed *before* the normal events loop; the compiled game will run a single frame of all your immediate start of game events, including all the functions & stuff they are used to, before the rest.



That's a nice tip, thanks. For some reason I always thought that Start of Frame events wre handled before everything else. Probably because I used Director a lot back in the day (the onStartFrame{} event handler works the same way)

As for the problem I was having, I couldn't figure out why it wasn't working because "Create at start" and "Visible at start" were both checked. You also need to make sure that "Inactive if too far from Window" is set to "No" (it's automatic by default)

 
//
   

Post Reply



 



Advertisement

Worth A Click