This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * takes a sprite frame, from stretched frames, and returns the image index for it | |
| * @param {Asset.GMSprite} sprite the sprite we're looking up | |
| * @param {Real} frame the frame to check | |
| * @return {Real} | |
| */ | |
| function sprite_get_index_from_frame(sprite, frame) { | |
| var all_frames_information = sprite_get_info(sprite).frame_info; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * creates a struct object for managing a JASC-PAL color palette | |
| * @param {Real} dot_pal_file the path to the .pal file | |
| */ | |
| function jasc_pal_pallette(dot_pal_file) constructor { | |
| /** | |
| * parses the .pal file | |
| * @param {string} dot_pal_file the path toe the .pal file | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //this is the vertex shader | |
| attribute vec3 in_Position; | |
| attribute vec4 in_Colour; | |
| attribute vec2 in_Texture_Coordinate; | |
| varying vec2 vertex_texture_coordinate; | |
| void main() { | |
| vec4 vertex_model_position = vec4(in_Position, 1.0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * converts a room region to a gpu scissor region | |
| * @param {real} x the x position of the region origin | |
| * @param {real} y the y position of the region origin | |
| * @param {real} width the width of the region | |
| * @param {real} height the height of the region | |
| * @return {struct} | |
| */ | |
| function room_region_to_scissor_region(x, y, width, height) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * remaps the values on a noise texture to fall between two new values | |
| * @param {asset.GMSprite} noise_sprite the sprite that needs to be remapped | |
| * @param {real} new_minimum the new minimum noise value | |
| * @param {real} new_maximum the new maximum noise value | |
| */ | |
| function noise_remap(noise_sprite, new_minimum, new_maximum) { | |
| var width = sprite_get_width(noise_sprite); | |
| var height = sprite_get_height(noise_sprite); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * creates a data uri out of a sprite | |
| * assumes rgba, 8bit | |
| * @param {Asset.GMSprite} sprite_asset which sprite to convert to url | |
| * @param {Real} [frame_number] which frame is being converted | |
| * @return {String} | |
| */ | |
| function sprite_create_data_url(sprite_asset, frame_number = 0) { | |
| static buffer_write_u32_backwards = function(buffer, value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function copy_game_path() { | |
| clipboard_set_text($"{parameter_string(0)} -game {parameter_string(2)}"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function threedee_write_buffer_to_crocotile_obj(raw_vbo_buffer, name) { | |
| static read_vertex = function(raw_buffer) { | |
| var x_position = buffer_read(raw_buffer, buffer_f32); | |
| var y_position = buffer_read(raw_buffer, buffer_f32); | |
| var z_position = buffer_read(raw_buffer, buffer_f32); | |
| var x_normal = buffer_read(raw_buffer, buffer_f32); | |
| var y_normal = buffer_read(raw_buffer, buffer_f32); | |
| var z_normal = buffer_read(raw_buffer, buffer_f32); | |
| var r_color = buffer_read(raw_buffer, buffer_u8) / 255; | |
| var g_color = buffer_read(raw_buffer, buffer_u8) / 255; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function lowkey_get_key_name(key) { | |
| static names = undefined; | |
| if (names == undefined) { | |
| names = {}; | |
| names[$ vk_lshift] = "left shift"; | |
| names[$ vk_rshift] = "right shift"; | |
| names[$ vk_backspace] = "backspace"; | |
| names[$ vk_tab] = "tab"; | |
| names[$ vk_enter] = "enter"; | |
| names[$ vk_shift] = "either shift"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * writes a tilemap to a buffer | |
| * @param {id.TileMapElement} map the tilemap source | |
| * @return {id.Buffer} | |
| */ | |
| function buffer_get_tilemap(map) { | |
| var width = tilemap_get_width(map); | |
| var height = tilemap_get_height(map); | |
| var buffer = buffer_create(width * height * buffer_sizeof(buffer_u32), buffer_fixed, 1); | |
| for (var i = 0; i < width; i++) { |
NewerOlder