X% 5K.\X ( @ (//(  0/80@0?/8 0( ?G@POWOXOP?H0@/7@O_``h_hPX 0(P_oppxow_g@O/8'' 7p`o?G/7 0??H/8`/o?GOX@H0?/pOW?H/8 7OP?G/7( P0@PX@O0@ 0O @H/@' 00@@P0?'_OP@H( 7/7' ^^^^^^^^^^^^^^^^^^^^^^^^^^TeeBBBBeTT^^^^^^^eBDJ33333JJDBeZ^^^^TD33==#####==3JDBT^^^^eJ=###=3DeZ^^TB3# #=3JBZ^^T3#  #=JBT^^J# Sll #=JBZ^T# %,68??86,/@A*< ##45('.6787-9%:;*<=#$+&,--.,/01)2 3 $%&&'%($!)* ##  !"#     ??d q @ spr_textfield gxٱ QC ԙى͉E +w׺rX#,ϲ?,ϲ?,ϲ?,ϲ?o3|fnt_couriernew Courier New  obj_textfield [g//define any of these variables in each instance's creation code //which can be accesses by ctrl + right clicking the instance in the room //if you do not define them, this code will define them with default values if !variable_local_exists("label") label = "" //the label to the left of the textfield if !variable_local_exists("label_font") label_font = -1 //font for the label, does not have to be monospaced if !variable_local_exists("text") text = "" //at any time, you can simply retrieve the text variable if !variable_local_exists("font") font = fnt_couriernew //works best with monospaced font //if this is a password box, the font doesn't have to be monospaced if !variable_local_exists("width") width = sprite_width - 4 //the width that text is allowed within if !variable_local_exists("password") password = false //whether this is a password box or not if !variable_local_exists("selected") selected = false //whether this box starts out active or not //this stuff probably shouldn't be modified draw_set_font(font) //this is temporary, to determine character width cw = string_width("*") //the width of a single character click = false //whether the mouse button is being held down or not (selection) pos = 1 //the cursor position left = 1 //the display position (position of leftmost visible character) sel = 1 //selection position (same as pos if no text selected) cap = width div cw //maximum number of characters permitted in view //reads the cursor blink rate from the registry beam = "|" //the symbol used for the cursor - also in alarm event registry_set_root(3) if !registry_exists_ext( "Control Panel\Desktop","CursorBlinkRate" ) { blink = 700 } else { blink = registry_read_real_ext( "Control Panel\Desktop","CursorBlinkRate" ) } if blink != -1 { blink = blink/1200 blink = room_speed * blink alarm = blink }0000000[Eif beam != "|" { beam = "|" } else { beam = "" } alarm = blink0000000[if !selected { exit } if keyboard_string != "" { if sel != pos { text = string_delete(text,min(pos,sel),abs(pos-sel)) pos = min(pos,sel) sel = pos } text = string_insert(keyboard_string,text,pos) pos += string_length(keyboard_string) sel = pos if pos - left > cap { left = pos - cap } else if left + cap > string_length(text) { left = max(1,string_length(text) - cap + 1) } if pos < left { left = pos } keyboard_string = "" alarm = blink beam = "|" }0000000.[if !selected { exit } keyboard_clear(vk_delete) alarm = blink beam = "|" if (pos > string_length(text)) && (sel > string_length(text)) { exit } if sel = pos { text = string_delete(text,pos,1) } else { text = string_delete(text,min(pos,sel),abs(pos-sel)) pos = min(pos,sel) } sel = pos if left + cap > string_length(text) { left = max(1,string_length(text) - cap + 1) } if pos < left { left = pos }0000000'[if !selected { exit } keyboard_clear(vk_right) alarm = blink beam = "|" if !keyboard_check(vk_control) { if pos <= string_length(text) { pos += 1 } if pos - left > cap { left += 1 } } else if pos <= string_length(text) { do { pos += 1 if pos - left > cap { left += 1 } } until (pos > string_length(text) || string_char_at(text,pos-1) = " ") } if !keyboard_check(vk_shift) { sel = pos }0000000%[Sif !selected { exit } keyboard_clear(vk_left) alarm = blink beam = "|" if !keyboard_check(vk_control) { if pos > 1 { pos -= 1 } if pos < left { left -= 1 } } else if pos > 1 { do { pos -= 1 if pos < left { left -= 1 } } until (pos = 1 || string_char_at(text,pos-1) = " ") } if !keyboard_check(vk_shift) { sel = pos }0000000[if !selected { exit } keyboard_clear(vk_backspace) alarm = blink beam = "|" if (pos = 1) && (sel = 1) { exit } if pos = sel { text = string_delete(text,pos - 1, 1) pos -= 1 } else { text = string_delete(text,min(pos,sel),abs(pos-sel)) pos = min(pos,sel) } sel = pos if left + cap > string_length(text) { left = max(1,string_length(text) - cap + 1) } if pos < left { left = pos }00000008[ click = false00000005[ if position_meeting(mouse_x,mouse_y,self) { alarm = blink beam = "|" keyboard_string = "" selected = true click = true pos = min((mouse_x - x) div cw, string_length(text)) + left if !keyboard_check(vk_shift) { sel = pos } } else { selected = false }00000002[mif !selected { exit } if !click { exit } sel = max(min((mouse_x - x) div cw, string_length(text)) + left,1)0000000 [window_set_cursor(cr_default)0000000 [window_set_cursor(cr_beam)0000000[var d2,m,p,pl,pr; draw_set_color(c_black) draw_set_font(font) draw_sprite(sprite_index,0,x,y) draw_set_font(label_font) draw_text(x - string_width(label + " "), y, label) draw_set_font(font) if password { d2 = "" for (m = 0; m < string_length(text); m += 1) { d2 += "*" } } else { d2 = text } draw_text(x+4,y,string_copy(d2,left,cap)) if selected { draw_text(x+min(pos-left,cap)*cw,y,beam) if sel != pos { p = min(max(sel,left),left+cap) draw_rectangle( x+4+(p-left)*cw,y, x+4+min(pos-left,cap)*cw,y+sprite_height,false ) draw_set_color(c_white) pl = min(pos,p) pr = max(pos,p) draw_text(x+4+(pl-left)*cw,y,string_copy(d2,pl,pr-pl)) } }0000000X[if !selected || !keyboard_check(vk_control) || sel = pos { exit } var d2,m,pl,pr; if password { d2 = "" for (m = 0; m < string_length(text); m += 1) { d2 += "*" } } else { d2 = text } pl = min(pos,sel) pr = max(pos,sel) clipboard_set_text(string_copy(d2,pl,pr-pl)) text = string_delete(text,min(pos,sel),abs(pos-sel)) pos = min(pos,sel) sel = pos if left + cap > string_length(text) { left = max(1,string_length(text) - cap) } if pos < left { pos = left }0000000V[\if !selected || !keyboard_check(vk_control) { exit } keyboard_string = clipboard_get_text()0000000C[ if !selected || !keyboard_check(vk_control) || sel = pos { exit } var d2,m,pl,pr; if password { d2 = "" for (m = 0; m < string_length(text); m += 1) { d2 += "*" } } else { d2 = text } pl = min(pos,sel) pr = max(pos,sel) clipboard_set_text(string_copy(d2,pl,pr-pl))0000000A[if !selected || !keyboard_check(vk_control) { exit } sel = 1 pos = string_length(text) + 1 left = max(0,string_length(text) - cap + 1)0000000$[oif !selected { exit } alarm = blink beam = "|" pos = 1 left = 1 if !keyboard_check(vk_shift) { sel = pos }0000000#[if !selected { exit } alarm = blink beam = "|" pos = string_length(text) + 1 left = max(0,string_length(text) - cap + 1) if !keyboard_check(vk_shift) { sel = pos }0000000room0        P$label = "Username:" selected = true$label = "Password:" password = trueXGame InformationX{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil Arial;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\cf1\f0\fs24 \par } Sprites spr_textfieldSounds BackgroundsPathsScripts Fonts fnt_couriernew Time LinesObjects obj_textfieldRoomsroom0 Game Information Global Game Settings