[ASk] event draw
3 posters
Halaman 1 dari 1
[ASk] event draw
mau nanya nih, bedanya "draw" sama "draw GUI" di GMS itu apa ?
sama event "Resize" nya juga ya
sama event "Resize" nya juga ya
L.M Afrizal R- GM Beginner
-
Jumlah posting : 165
Points : 125
Join date : 15.07.13
Age : 25
Re: [ASk] event draw
di GMS, tekan F1 gan
secara garis besar:
-Draw GUI itu utk draw HUD, jdi posisi (x,y) nya otomatis mengikuti posisi view (bisa di lakukan di Draw event biasa juga, namun utk draw biasa, musti kasih view_xview+X,view_yview+Y ). juga depth ny rendah, memungkinkan HUD ny terlihat paling atas.
-Resize: lebih di tujukan ke windows 8. ya ak kurang tau bnyk soal ini, cz ak gk pke win8 tpi dri kata2 di dalam spoiler, ini utk attach game kita di samping layar, dan hal ini membuat game kita ter-resize.
-kalo draw event biasa ya kyk biasa
- Draw GUI:
This is a sub-event of the Draw Event and is specifically designed for drawing GUI (Graphical User Interface) elements that are not affected by the view scale or rotation. This means that you can have an instance draw all the elements for your HUD without having to base all the positioning on the position within the room of the instance and the position of the current view either.
When drawing in this event it is important that you understand that the draw coordinates do not change even when views are active and 0,0 is always the top left hand corner with the width and height of the display being your maximum drawing width and height. Depth ordering is still maintained between different instances (so an instance at a low depth will draw over one at a higher depth) and also within the event itself (the first things drawn will appear underneath the later things being drawn) and it can also be used in conjunction with the normal Draw Event (which will be affected by the view position, scale and rotation as normal). If you have no Draw Event but you do have Draw GUI Event, then GameMaker:Studio will still default draw the sprite for the instance (if it has one) as normal.
You may notice depth issues when using this event due to the fact that it is not dealt with the same was as the traditional draw event. What happens is that the normal draw event for all instances is resolved first and then the draw GUI event for all instances is resolved. So the depth order between instances with draw GUI events is always respected, as is the depth order between instances with normal draw events, but the draw GUI event will always draw over anything drawn in the normal draw event, even if the instance doing the drawing it is at a higher depth than other instances.
NOTE: This event will, by default, draw 1:1 with the background canvas size, which can make things a little complicated, and perhaps unexpected in places, on those target platforms that permit a fullscreen mode (HTML5, Windows, Ubuntu (Linux) and MacOS). For example on HTML5, going fullscreen the GUI draws pretty small when everything else gets bigger because the background surface is now the size of the screen. However, on Windows, Ubuntu (Linux) and MacOS when you go fullscreen it doesn't always change the size of the background canvas, meaning that whatever is drawn in this event can be scaled up like everything else, but you can get around this if you use the window_set_size to force it to be the same as the client area, then it will be small, just like the HTML5 one. You may also lock the GUI event to a specific size and this will then be scaled to fit the display dimensions automatically by using the function display_set_gui_size.
- Resize Event:
This is a sub-event of the Draw Event and is specifically designed for reacting to the change in the Windows 8 canvas size when the game window is "snapped".
On the Windows 8 target platform it is important that you catch any resizing of the game canvas from the "snapping" of the game window (when the user drags the window to the side of the display, for example). This event will do just that and is triggered every time the canvas is changed, permitting you to add custom code here that will resize the view or reposition HUD elements as necessary. This function is provided as a convenient way to avoid having step event code that checks for these things all the time.
NOTE: You cannot draw in this event! It is triggered by resizing the canvas and is only for catching this change... any drawing that should be done still must be in one of the other two draw events.
secara garis besar:
-Draw GUI itu utk draw HUD, jdi posisi (x,y) nya otomatis mengikuti posisi view (bisa di lakukan di Draw event biasa juga, namun utk draw biasa, musti kasih view_xview+X,view_yview+Y ). juga depth ny rendah, memungkinkan HUD ny terlihat paling atas.
-Resize: lebih di tujukan ke windows 8. ya ak kurang tau bnyk soal ini, cz ak gk pke win8 tpi dri kata2 di dalam spoiler, ini utk attach game kita di samping layar, dan hal ini membuat game kita ter-resize.
-kalo draw event biasa ya kyk biasa
Terakhir diubah oleh Kevin Blaze Coolerz tanggal Mon 20 Jan 2014, 20:50, total 1 kali diubah (Reason for editing : ralat dikit)
Re: [ASk] event draw
Kevin Blaze Coolerz wrote:di GMS, tekan F1 gan
secara garis besar:
-Draw GUI itu utk draw HUD, jdi posisi (x,y) nya otomatis mengikuti posisi view (bisa di lakukan di Draw event biasa juga, namun utk draw gui, musti kasih view_xview+X,view_yview+Y ). juga depth ny rendah, memungkinkan HUD ny terlihat paling atas.
Elu yakin tu kev
DrawGUI itu sudah ga pakai view_xview atay view_yview, langsung aja 0,0 atau 5,5, Studio akan langsung menggambar di koordinat screen tanpa menghiraukan view ataupun port. Dan tidak terpengaruh pada depth, karena depth untuk draw diresolve dulu baru depth di DrawGUI di resolve, jadi walaupun depth nya besar tapi karena DrawGUI tetap digambar diatas draw. Coba deh cek
Re: [ASk] event draw
^wah, salah ketik kyk ny
bukan "draw gui" tpi "draw biasa".
kan udh ak tulis di kalimat sebelum ny, "Draw GUI itu utk draw HUD, jdi posisi (x,y) nya otomatis mengikuti posisi view"
utk depth ak tau ny sih draw gui itu rendah, tpi emg bner sih, yg nama ny GUI pasti selalu dibuat paling rendah
thx utk ralat ny om
bukan "draw gui" tpi "draw biasa".
kan udh ak tulis di kalimat sebelum ny, "Draw GUI itu utk draw HUD, jdi posisi (x,y) nya otomatis mengikuti posisi view"
utk depth ak tau ny sih draw gui itu rendah, tpi emg bner sih, yg nama ny GUI pasti selalu dibuat paling rendah
thx utk ralat ny om
Similar topics
» [ASK] Lebih dari 1 Font dlm 1 "Event Draw"
» [ASK] Draw destkop
» Perubahan Besar di Draw GUI!
» Draw Object di Room Lain
» [ASK] script dept draw sprite
» [ASK] Draw destkop
» Perubahan Besar di Draw GUI!
» Draw Object di Room Lain
» [ASK] script dept draw sprite
Halaman 1 dari 1
Permissions in this forum:
Anda tidak dapat menjawab topik