Obsolete Functions

Here you can find a list of all the functions that have been made obsolete when you compare GameMaker to legacy versions of the product. The functions listed here will be converted into compatibility scripts when you import a *.yyz made with a legacy version, and you can continue to work on the project as before. However, we recommend that you revise all the compatibility scripts created in a project, and ensure that future projects use the new functions/methods of working rather than depend on these scripts.

BackgroundsBackgrounds

In legacy GameMaker you had a separate background resource, where you could add images to be used as backgrounds. In GameMaker all images are considered sprites, and the use you put them too will depend on the layer they are assigned to in the room. This means that there is no longer a "background" resource, and it also means that the following functions are obsolete:

draw_backgrounddraw_background_extdraw_background_
stretched
draw_background_
stretched_ext
draw_background_
part
draw_background_
part_ext
draw_background_
general
draw_background_
tiled
draw_background_
tiled_ext
background_namebackground_existsbackground_get_
name
draw_backgrounddraw_background_extdraw_background_
stretched
draw_background_
stretched_ext
background_get_
width
background_get_
height
background_get_
transparent
background_get_
smooth
background_get_
preload
background_get_uvsbackground_get_
texture
background_set_alpha_
from_background
background_create_
from_surface
background_create_
color
background_create_
colour
background_create_
gradient
background_addbackground_replacebackground_add_
alpha
background_replace_
alpha
background_deletebackground_duplicatebackground_assignbackground_save
background_prefetchbackground_
prefetch_multi
background_flushbackground_flush_
multi
room_set_backgroundroom_set_
background_colour
 

Legacy GameMaker lso had a number of different background variables that accessed the global background array. These are no longer required in GameMaker:

background_
index[0..7]
background_
visible[0..7]
background_
alpha[0..7]
background_
blend[0..7]
background_x[0..7]background_y[0..7]background_
colour
background_
showcolour
background_
foreground[0..7]
background_
hspeed[0..7]
background_
vspeed[0..7]
background_
htiled[0..7]
background_
vtiled[0..7]
background_
width[0..7]
background_
height[0..7]
background_
xscale[0..7]
background_
yscale[0..7]

You can find out more about Background Layers from the section on the Room Editor, and for more information on the functions that control background layers using code see Background Layers.

 

TilesTiles

As with backgrounds (explained above) the tile resource from legacy GameMaker no longer exists, and instead we have Tile Sets in GameMaker. In legacy GameMaker, tiles used a background resource and were placed at different depths in the room editor or through code, however the method used was not terribly flexible and was also not that efficient. To address these issues, in GameMaker tilesets are now created from a sprite resource, and can have various different properties (like animation or auto-tiling). They are then placed on a tilemap layer within the room editor or through code. Due to these changes the following functions are now obsolete:

tile_get_xtile_get_ytile_get_lefttile_get_top
tile_get_widthtile_get_heighttile_get_depthtile_get_visible
tile_get_xscaletile_get_yscaletile_get_alphatile_get_background
tile_set_visibletile_set_backgroundtile_set_regiontile_set_position
tile_set_depthtile_set_scaletile_set_blendtile_set_alpha
tile_get_counttile_get_idtile_get_idstile_get_ids_at_depth
tile_addtile_existstile_deletetile_layer_hide
tile_layer_showtile_layer_deletetile_layer_shifttile_layer_find
tile_layer_delete_attile_layer_depthroom_tile_addroom_tile_add_ext
room_tile_clear

You can find out more about Tile Sets from the manual section on the Tile Set Editor and about how to use them in the room editor from the section on Tile Layers. For more information on the functions that control background layers using code see Tilemap Layers. It is also worth noting that the GameMaker Language has some specific funtions related to using legacy tiles in imported projects, and you can find information on those here.

 

ObjectsObjects

The way objects are treated in GameMaker has changed slightly due to the introduction of layers in the room editor. There still exists the "depth" variable, but it is now only really used for compatibility and you can no longer get or set the depth for objects, only instances. This makes the following functions obsolete:

object_get_depth
object_set_depth

You can find out more about object resources from the manual section on the Object Editor and on the functions that control objects using code from the section Objects.

 

SoundsSounds

Legacy GameMaker had two different sound API's, one which used the deprecated sound_ functions (that was only really valid for the HTML5 target platform), and the other which used the audio_ functions. The audio API has been improved and expanded in GameMaker, making the legacy functions listed below obsolete:

sound_namesound_existssound_get_namesound_get_kind
sound_get_preloadsound_existssound_restoresound_delete
sound_playsound_loopsound_stopsound_stop_all
sound_isplayingsound_volumesound_fadesound_global_volume
audio_music_gainaudio_music_is_playingaudio_new_systemaudio_old_system
audio_pause_musicaudio_play_musicaudio_resume_musicaudio_stop_music
audio_system

You can find out more about audio resources from the manual section on the Sound Editor and on the functions that control audio using code from the section on Audio

 

D3DD3D

When using 3D models or primitives in legacy GameMaker, you had to use the d3d_ functions. These used an obsolete API for drawing and in many cases were not related strictly to Direct 3D API, or even to using 3D itself. With the advent of vertex buffers, matrices and cameras in GameMaker, the following functions have been made obsolete:

d3d_startd3d_endd3d_set_perspectived3d_set_hidden
d3d_set_depthd3d_set_lightingd3d_set_shadingd3d_set_fog
d3d_set_cullingd3d_set_zwriteenabled3d_set_projectiond3d_set_projection_ext
d3d_set_projection_
ortho
d3d_set_projection_
perspective
d3d_transform_set_
identity
d3d_transform_
set_translation
d3d_transform_set_
scaling
d3d_transform_
set_rotation_x
d3d_transform_set_
rotation_y
d3d_transform_
set_rotation_z
d3d_transform_set_
rotation_axis
d3d_transform_
add_translation
d3d_transform_add_
scaling
d3d_transform_
add_rotation_x
d3d_transform_add_
rotation_y
d3d_transform_
add_rotation_z
d3d_transform_add_
rotation_axis
d3d_transform_
stack_clear
d3d_transform_stack_
empty
d3d_transform_
stack_push
d3d_transform_stack_
pop
d3d_transform_
stack_top
d3d_transform_stack_
discard
d3d_transform_vertexd3d_light_define_
ambient
d3d_light_define_
direction
d3d_light_define_pointd3d_light_enabled3d_primitive_begind3d_primitive_
begin_texture
d3d_primitive_endd3d_vertexd3d_vertex_colord3d_vertex_colour
d3d_vertex_textured3d_vertex_texture_
color
d3d_vertex_texture_
colour
d3d_vertex_normal
d3d_vertex_normal_
color
d3d_vertex_normal_
colour
d3d_vertex_normal_
texture
d3d_vertex_normal_
texture_color
d3d_vertex_normal_
texture_colour
d3d_draw_blockd3d_draw_cylinderd3d_draw_cone
d3d_draw_ellipsoidd3d_draw_walld3d_draw_floord3d_model_create
d3d_model_destroyd3d_model_cleard3d_model_loadd3d_model_save
d3d_model_drawd3d_model_primitive_
begin
d3d_model_
primitive_end
d3d_model_vertex
d3d_model_vertex_
color
d3d_model_vertex_
colour
d3d_model_
vertex_texture
d3d_model_vertex_
texture_color
d3d_model_vertex_
texture_colour
d3d_model_vertex_
normal
d3d_model_
vertex_normal_color
d3d_model_vertex_
normal_colour
d3d_model_vertex_
normal_texture
d3d_model_vertex_
normal_texture_color
d3d_model_vertex_
normal_texture_colour
d3d_model_block
d3d_model_cylinderd3d_model_coned3d_model_ellipsoidd3d_model_wall
d3d_model_floor

You can find out more about vertex buffers here, more about matrices here, more about cameras here, and more about the GPU functions here.

 

View Variables And Window FunctionsView Variables And Window Functions

With the advent of the camera functions in GameMaker, it means that a number of view variables are no longer required, specifically those referring to the view into the room rather than the view_port (which is still used). There are also a few functions for controlling how things are displayed that were available in legacy versions of GameMaker Studio which are also no longer appropriate. These variables and functions are listed below:

view_objectview_angleview_xviewview_yview
view_hviewview_wviewview_hborderview_vborder
view_hspeedview_vspeeddisplay_set_windows_
vertex_buffer_method
display_get_windows_
vertex_buffer_method
display_set_windows_
alternate_sync
display_get_windows_
alternate_sync
room_set_view

You can find out more about cameras from the manual section on Cameras And The Display.

 

3rd Party Support3rd Party Support

GameMaker moves a lot of built in functionality from previous versions into extensions, meaning that the following 3rd party support functions are considered obsolete:

ads_enableads_disableads_moveads_get_display_
width
ads_get_display_
height
ads_interstitial_
available
ads_interstitial_
display
ads_setup
ads_engagement_
available
ads_engagement_
launch
ads_engagement_
active
ads_event
ads_event_preloadads_set_reward_
callback
playhaven_add_
notification_badge
playhaven_hide_
notification_badge
playhaven_position_
notification_badge
playhaven_update_
notification_badge
pocketchange_display_
reward
pocketchange_display_
shop
analytics_eventanalytics_event_extfacebook_initfacebook_login
facebook_request_
publish_permissions
facebook_request_
read_permissions
facebook_check_
permission
facebook_status
facebook_accesstokenfacebook_user_idfacebook_graph_
request
facebook_dialog
facebook_send_invite  facebook_post_
message   
facebook_logout facebook_launch_
offerwall  
iap_event_queue iap_files_purchased iap_is_downloaded iap_product_files 
iap_product_status iap_store_status iap_dataiap_activate
iap_statusiap_enumerate_productsiap_restore_alliap_acquire
iap_consumeiap_product_detailsiap_purchase_details 
immersion_play_effectimmersion_stop
achievement_*win8_*uwp_appbar_*

You can get our official extensions for advertising and other APIs from the Marketplace Page.

 

GML Visual ActionsGML Visual Actions

Both legacy GameMaker and GameMaker have a visual scripting GML Visual interface for creating your games, however the way it is handled in GameMaker is quite different to the previous methods used. Previously, all GML Visual actions had their own corresponding function which worked "behind the scenes" to get the desired results, however this was not very transparent and added in extra overheads to the function calls, resulting in poorer performance. In GameMaker this has been changed, and now all actions compile to pure code (and can be shown as such if required), meaning that the following action functions are obsolete:

action_path_oldaction_set_spriteaction_draw_fontaction_draw_font_old
action_fill_coloraction_fill_colouraction_line_coloraction_line_colour
action_highscoreaction_set_relativeaction_moveaction_set_motion
action_set_hspeedaction_set_vspeedaction_set_gravityaction_set_friction
action_move_pointaction_move_toaction_move_startaction_move_random
action_snapaction_wrapaction_reverse_xdiraction_reverse_ydir
action_move_contactaction_bounceaction_pathaction_path_end
action_path_positionaction_path_speedaction_linear_stepaction_potential_step
action_kill_objectaction_create_objectaction_create_object_motionaction_create_object_random
action_change_objectaction_kill_positionaction_sprite_setaction_sprite_transform
action_sprite_coloraction_sprite_colouraction_soundaction_end_sound
action_if_soundaction_another_roomaction_current_roomaction_previous_room
action_next_roomaction_if_previous_roomaction_if_next_roomaction_set_alarm
action_sleepaction_set_timelineaction_timeline_setaction_timeline_start
action_timeline_stopaction_timeline_pauseaction_set_timeline_positionaction_set_timeline_speed
action_messageaction_show_infoaction_show_videoaction_end_game
action_restart_gameaction_save_gameaction_load_gameaction_replace_sprite
action_replace_soundaction_replace_
background
action_if_emptyaction_if_collision
action_ifaction_if_numberaction_if_objectaction_if_question
action_if_diceaction_if_mouseaction_if_alignedaction_execute_script
action_inheritedaction_if_variableaction_draw_variableaction_set_score
action_if_scoreaction_draw_scoreaction_highscore_showaction_highscore_clear
action_set_lifeaction_if_lifeaction_draw_lifeaction_draw_life_images
action_set_healthaction_if_healthaction_draw_healthaction_set_caption
action_partsyst_createaction_partsyst_destroyaction_partsyst_clearaction_parttype_create_old
action_parttype_createaction_parttype_coloraction_parttype_colouraction_parttype_life
action_parttype_speedaction_parttype_gravityaction_parttype_secondaryaction_partemit_create
action_partemit_destroyaction_partemit_burstaction_partemit_streamaction_cd_play
action_cd_stopaction_cd_pauseaction_cd_resumeaction_cd_present
action_cd_playingaction_set_cursoraction_webpageaction_splash_web
action_draw_spriteaction_draw_backgroundaction_draw_textaction_draw_text_transformed
action_draw_rectangleaction_draw_gradient_horaction_draw_gradient_vertaction_draw_ellipse
action_draw_
ellipse_gradient
action_draw_lineaction_draw_arrowaction_color
action_colouraction_fontaction_fullscreenaction_snapshot
action_effect

You can find out more about the new GML Visual from the manual section on GML Visual.

 

Vectors and MatricesVectors and Matrices

The data type used to store vectors and matrices in GameMaker are Arrays. Therefore, the following functions relating to working with vectors and matrices were removed: 

is_vec3is_vec4is_matrix

These functions appeared to check for a specific type, while the underlying type is always an array or a range of an array (of respectively length 3, 4 and 16). E.g. the functions matrix_build and matrix_build_identity return a matrix, of which the 16 elements are stored in an array datatype. To check the datatype you should use is_array instead and combine this with the length of the array given by array_length to work out the datatype.

NOTE Checking for an array datatype and its length doesn't mean the actual contents represent a valid vector or matrix.

Alternatively, to store vectors and matrices you can use other data structures provided by GameMaker, such as BuffersDS Grids a struct or even a surface to store the same information, instead of a dedicated data type.

 

The following built-in global variables are also obsolete, although they are still considered reserved variables in GML so that the IDE can recognise them and flag them for updating/removing when a legacy project that uses them is imported (as are the variables listed under the Views and the Backgrounds sections, above):

gamemaker_registeredgamemaker_progamemaker_
version
secure_mode
show_healthshow_scoreshow_lives
caption_scorecaption_livescaption_health
argument_relativeroom_captionroom_speed
transition_stepstransition_kindgame_guid
error_lasterror_occurredbuffer_surface_copy