www.gmindo.web.id/forum
Forum ini sudah tidak dipakai lagi. Silakan ke forum baru di www.gmindo.web.id/forum Very Happy

Terima kasih

Join the forum, it's quick and easy

www.gmindo.web.id/forum
Forum ini sudah tidak dipakai lagi. Silakan ke forum baru di www.gmindo.web.id/forum Very Happy

Terima kasih
www.gmindo.web.id/forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Membuat Room Transisi Sendiri

+2
Riza_Farhandi
Kevin Blaze Coolerz
6 posters

Go down

Membuat Room Transisi Sendiri Empty Membuat Room Transisi Sendiri

Post by Kevin Blaze Coolerz Fri 10 May 2013, 09:42

-Title: Creating your own room transition with GM7 Pro
-Description: Describes how to define your own room transition script. The example file contains a number of sample scripts for basic and advanced effects.
-GM Version: GM7
-Registered: Yes
-File Type: .zip (containing three .gmk)
-File Size: 313K
-File Link: [You must be registered and logged in to see this link.]
-Link ke forum: [You must be registered and logged in to see this link.]

Introduction
Game Maker 7 provides a way to define your own room transition effect. However, the explanation of the mechanism is very condensed (stuffed into the description of one function) and hard to get. This tutorial describes how to define a script and register it to be used on room transitions.

The first example contains scripts to emulate all of in-built room transitions (plus a few in the Room Transitions extension.) Not so impressive, but you can take basic expressions out of the code to implement your own effects. The second one contains a number of advanced sample scripts those also can be used as a base of your own one. The third example demonstrates other possibility of custom room transitions, such as keeping HUD and player on the screen during the transition. Useful on implementing so-called Zelda-style and Metroid-style room transitions.

Defining a script
At first, you have to define a transition script which is meant to be repeatedly called from Game Maker during the transition. The script is called with five arguments:
argument0 is the surface with the image of the previous room.
argument1 is the surface with the image of the next room.
argument2 and argument3 are the width and height of the surface, respectively. (It is also the size of the drawing region.)
argument4 is fraction of the transition. This takes a value between 0 and 1.
No need to afraid of "surface"; as to creating room transitions, you can simply think it as a sort of large sprite. The only difference is that you use functions like draw_surface instead of draw_sprite to draw it on the screen.

The last parameter, fraction, is the most important one. Your responsibility is to mix and draw those two images of rooms onto the screen according to the fraction. At the beginning (when fraction is 0) the first image should occupy the entire screen. As the transition goes on, the script is called over and over with gradually increasing fraction, to mix/interpolate/blend two images accordingly.


Using the room transition
Next, you have to register the transition to the system, using the function transition_define.
Code:
transition_define(100, "scr_squeeze_right");

Note that the second argument is the name of your script, which is a string. You usually have to put quotation marks around the name, as in the example above.

The first argument is the index which is to be assigned to the transition. You can use an arbitrary number unless it overlaps with an existing one. It is a good idea to define a constant for each kind of transition if you plan to make it an extension package.

Although it is harmless to register the same transition with the same index multiple times, you'd better ensure it to be registered only once throughout the game. (For example, execute the code in the game start event of a controller object.)

Once the transition is registered, you can use it by setting the index to transition_kind in prior to changing the room.
Code:
transition_kind = 100; // Squeeze from right
room_goto_next();

Additionally, you can change the speed of the transition with setting transition_steps. It controls how many times the script is called during transition. The larger the number is, the slower the transition gets and takes longer to complete. (With the default value of 80, it takes about 1.2 seconds.)
Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by Riza_Farhandi Fri 10 May 2013, 14:28

ak dah pernah download sih... Very Happy
but Nice Share... Very Happy
Riza_Farhandi
Riza_Farhandi
GM Beginner
GM Beginner

100%
Jumlah posting : 393
Points : 356
Join date : 24.01.13
Age : 25
Lokasi : Tangerang Selatan

http://mrizaf.mywapblog.com/

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by zebrakelabu Tue 14 May 2013, 14:20

mestinya bisa dipakai di gm studio .... kalau ada waktu Neutral
zebrakelabu
zebrakelabu
Admin
Admin

100%
Jumlah posting : 933
Points : 960
Join date : 06.01.13
Lokasi : Jakarta

http://www.project25games.com

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by Kevin Blaze Coolerz Tue 14 May 2013, 14:55

@riza:
seep Very Happy

@zebrakelabu:
gk bisa kyk ny om Very Happy
cz pke function transition_kind (kalo gk salah sih, ak cma lihat sbentar script ny Very Happy )


Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by Asuna Tue 14 May 2013, 15:26

@zebrakelabu
fungsi transisi di GM studio obsolete, berarti kalo mau bikin musti pake extension (klo g salah), atau langsung pake script from scratch yang lebih rumit dan justru bisa aja bikin lag Pacman
Asuna
Asuna
Global Moderator
Global Moderator

100%
Jumlah posting : 1711
Points : 1901
Join date : 10.01.13

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by Agan Wed 15 May 2013, 12:33

Nice share..

lebih sering pake transition_kind = 21

fade effect..
Agan
Agan
GM Beginner
GM Beginner

100%
Jumlah posting : 115
Points : 120
Join date : 06.05.13
Age : 31
Lokasi : Jakarta Barat

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by Kevin Blaze Coolerz Wed 15 May 2013, 18:07

@agan:
sama gan Very Happy
hmpir smua game pke fade efek Very Happy

Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by UNK_ Wed 15 May 2013, 18:18

script ny pedes gan Hammer

gw nggak ngerti cara bikin transisi ny
UNK_
UNK_
Newbie
Newbie

100%
Jumlah posting : 17
Points : 15
Join date : 04.05.13
Lokasi : Unidentified

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by Kevin Blaze Coolerz Wed 15 May 2013, 19:30

@unk:
emg sulit gan Very Happy
hrus kuat skill "draw event" ny Very Happy


Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

Membuat Room Transisi Sendiri Empty Re: Membuat Room Transisi Sendiri

Post by Sponsored content


Sponsored content


Kembali Ke Atas Go down

Kembali Ke Atas

- Similar topics

 
Permissions in this forum:
Anda tidak dapat menjawab topik