Imiglikos
Member
After pressing the enter button and over the full screen options, my image changes to a windowed one ... when I press enter again, it returns to the full screen.
I would like the text to become windowed .. and when I press this option again the enter key will turn the text to full screen
Thank you for your help
obj_options
create
step
draw
I would like the text to become windowed .. and when I press this option again the enter key will turn the text to full screen
Thank you for your help
obj_options
create
GML:
options=ds_list_create()
options[|0]=("Controlls")
options[|1]=("Sound")
options[|2]=("Fullscreen")
options[|3]=("Back")
selected=0
animation_speed=room_speed/2
for(var i=0; i<ds_list_size(options); i++) {
animation[i]=0
}
step
GML:
if(keyboard_check_pressed(vk_down)) {
selected++
if(selected>=ds_list_size(options)) {
selected=ds_list_size(options)-1
}
}
if(keyboard_check_pressed(vk_up)) {
selected--
if(selected<0) {
selected=0
}
}
if(keyboard_check_pressed(vk_enter)) {
if(selected=0) {
room_goto(room_setup)
} else if(selected=1) {
room_goto(room_sound)
} else if(selected=2) {
window_set_fullscreen(!window_get_fullscreen());
if (!window_get_fullscreen()) {
window_set_size(obj_display.ideal_width, obj_display.ideal_height);
}
} else if(selected=3) {
room_goto(room_game_menu)
}
}
draw
GML:
draw_set_valign(1)
draw_set_halign(1)
draw_set_font(font_menu)
var line_height=ceil(string_height("M")*1.1)
for(var i=0; i<ds_list_size(options); i++) {
if(i=selected) {
animation[i]=clamp(animation[i]+(1/animation_speed),0,2)
} else {
animation[i]=clamp(animation[i]-(1/animation_speed),0,2)
}
var color=merge_colour(c_black,c_white,animation[i])
var s=options[|i]
draw_text_transformed_color(x,y+(line_height*i),s,1+animation[i]/4,1+animation[i]/4,0,color,color,color,color,1)
}