GameMaker (2.3)
Icon

MaxLos' Script Pack 1

MaxLos

You must be logged in to obtain assets

Description

A collection of 35 useful Gamemaker Studio 2 scripts:

//Arrays

• array_dereference_all - Dereferences all instance-scope arrays within an instance.

//Drawing

• draw_rectangle_color_outline - Draws a rectangle with an outline of a given size.

• draw_sprite_cropped - Draws a sprite that will be cropped if it exceeds the given x/y coordinates.

• draw_sprite_cropped_alternative - Draws a sprite that will be cropped if it's borders exceed given x/y coordinates.

• draw_sprites - Allows you to draw multiple sprites in descending rows, like a grid, from left to right, top to bottom. You can limit how many sprites should be drawn per row and make sprites be drawn on to another row if the right side of a sprite would exceed a given x coordinate. You can also set the vertical alignment of the drawn sprites.

• draw_tooltip - Draws a tooltip (a rectangle with some descriptive text describing an element.)

//DS Grids • ds_grid_add_to_end - Allows you to add multiple values to the end of an ds grid

• ds_grid_destroy_all - Destroys all instance-scope ds grids contained in an instance.

//DS Lists • ds_list_destroy_all - Destroys all instance-scope ds lists contained in an instance.

• ds_list_swap_values - Swaps the values found at two different positions in one or two different ds lists.

• ds_list_to_1d_array - Transforms a ds list into a 1d array.

• ds_list_destroy_all - Destroys all instance-scope ds lists contained in an instance.

//DS Maps • ds_map_destroy_all - Destroys all instance-scope ds maps contained in an instance.

//Miscellaneous • animation_speed_sprite - Allows you to easily set and change the animation speed of a instance's sprite at anytime during its animation.

• animation_pause_sprite - Allows you to briefly pause the animation of a sprite during a specific frame for a given amount of time.

• animation_loop_sprite - Allows you to loop a specific part of a sprite's animation a given amount of times, and then resuming the animation when the loop has finished.

• asset_get_list - Returns a ds list containing assets of a given type that exists in the asset browser, or just how many assets were found. You choose the asset type to search for (sprites, objects, etc) and can narrow the search to only return assets with or without certain sub-strings in their name.​

• code_get_preformance - Returns how long in miliseconds it took script or function to execute it's code.​​

• get_save_file_info - Works like the built-in function 'get_save_filename', but returns either only the directory the user chose for the file, or the name they want to give the file (your choice).

• instance_merge - 'Merges' two instances together, saving performance.

• screenshot - Takes and saves a screenshot of the screen (or just a portion of it), and allows you to let the user name and choose the directory to save the screenshot file to.

//Sprites • sprite_create_from_tilemap - Creates and returns a sprite of a layer's tilemap.​

• sprite_delete_all - Deletes all manually created sprites stored within instance-scope variables, arrays, and/or ds lists within an instance.

• sprite_duplicate_trimmed - Makes a duplicate of an existing sprite, trims it to remove as much empty space as possible, then returns that trimmed sprite to you.

• sprite_export - Let's you export any or all sprites that exist in the Asset Browser and sprites that have been created internally. You can also export sprites that have a specific sub-string in their name, or a specific set of sprites by passing an 1d array containing the indexes of those sprites.

• sprite_get_x - Returns the x coordinate of the left, center, or right side a sprite would be located at if it was drawn at a given x coordinate. You can also get the 'absolute' x coordinate the side of a sprite would be located at, i.e, if the sprite has empty space at that side, it will be ignored.

• sprite_get_y - Returns the y coordinate of the left, center, or right side a sprite would be located at if it was drawn at a given y coordinate. You can also get the 'absolute' y coordinate the side of a sprite would be located at, i.e, if the sprite has empty space at that side, it will be ignored.

• sprite_is_blank - Checks and returns whether or not a sprite is blank and has no drawn pixels.​

• sprite_resize - Makes a duplicate of a sprite, resizes it to a given size, then returns the index of the newly resized sprite. This does not change a sprites size by manipulating it's xscale or yscale, but works exactly like the 'Resize Canvas' option in the Sprite Editor; it either adds more transparent space to the canvas of the sprite or trims the sprite.

//Surfaces • surface_free_all - Frees all instance-scope surfaces contained in an instance.

//Views and Cameras • within_camera - Returns whether or not an instance is within the view of a camera.

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS2.3 - Version 2.2.1. Published May 31, 2022

See included changelog for full list of changes.

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait