[0.2.0]
Added
Data.read/1andData.parse/1for GameMaker data files from GameMaker: Studio 1 and GameMaker Studio 2 up to 2.3: the header, options, sprites with masks, texture pages and their regions, backgrounds and tilesets, objects with events and physics, rooms with views, instances, backdrops, tiles and layers, sounds and stored audio, fonts, paths and scripts.Data.index/3reads a table of names made when the file is read.Picturescuts regions, sprite frames, backgrounds and tiles from the decoded pages;Pictures.table/2cuts every glyph of a font as{:glyph, font, character}.Wave.read/1: stored WAVE sounds, the extensible format included, as 16-bit PCM.Event.handler_name/3names the compiled function of an object's event.mix gamemaker.info.- A runtime for a game's code written in Elixir:
World,Step,Rooms,Collide,Draw,Instanceand theCodebehaviour, withPictures.table/2andPictures.sprite_part/3for drawing its frames throughCauldron2D.DrawList. World.new/3takes:seedfor the world's random numbers,:picturesfor drawing onto surfaces, and:object_depths, the depths by object name at whichWorld.create/4makes instances (object_get_depth, for a GameMaker Studio 2 game converted from GameMaker: Studio 1).Worldkeeps the ids of instances that were outside the room last step in itsoutsideset, and its surfaces as%{rasters: %{id => raster}, next: id};Surfaces.rasters/1gives the rasters by id.World.instances_of/2reads an index of each object's instances and descendants, kept as instances are made and removed.- Draw order as the runtime has it: instances of equal depth draw newest first, the
earliest made in front; at equal depth, instances a GameMaker Studio 2 room places on
its own instance layer (
Instance.room_layer) draw in front of instances code made. Instances made by code are numbered after the highest id any room places. - Sprite masks are
Cauldron2D.Masks;Sprite.mask/2picks a frame's. TileLayers: a room's tile layer drawn as one picture,{:tile_layer, room, layer, blend}, whichDraw.run/1gives;raster/3draws it andSurfaces.lookup/2gives it.Text.items/5lays a string out in a game's fonts as GameMaker'sdraw_textanddraw_text_extdo (#line breaks, alignment, colour, wrapping, line separation), with:angle, the whole text turned about its position, and:mode, the blend mode of its glyphs;Text.width/4andText.height/4measure it, andDraw.text/5draws it from draw code.Shapes: GameMaker's ellipse (draw_ellipse) as a picture,{:ellipse, {width, height}, :filled | :outline}, whichSurfaces.lookup/2gives.Surfaces: surfaces made, drawn onto, cleared, freed and drawn as pictures ({:surface, id}). Drawing onto one blends as GameMaker does, its blend factors applied to the alpha channel too.Surfaces.draw/4takes:write, the colour channels drawing changes (draw_set_colour_write_enable);Surfaces.part_item/5draws part of a surface (draw_surface_part_ext);Surfaces.copy/4copies one surface's pixels exactly into another at a place (surface_copy).World.put_layer/3andWorld.layers/1: code changes a room's layers — shown or hidden, offset, speed, depth, a background layer's sprite, colour,:xscaleand:yscale, and an asset layer's:tile_blend(layer_tile_blend) — until the room is left. Room layers scroll by their speed every step (World'sscroll).World.add_tile/5: tiles added by code (tile_add), drawn as{:part, {:sprite, sprite, 0}, rectangle}until the room is left;Surfaces.lookup/2cuts{:part, key, rectangle}pictures.World.hide_tiles/3: a room's tiles at a depth hidden or shown again (tile_layer_hide,tile_layer_show) until the room is left.Path.position/2: a path's place at a fraction of its length (path_get_x,path_get_y), curved paths broken into points as GameMaker breaks them.Collide.bounce/4:move_bounce_solidandmove_bounce_all, simple and advanced.Random: GameMaker's random numbers — the runtime's WELL512a generator and its seeding,random,random_range,irandom,irandom_rangeandchooseas the runtime computes them.Particles: particles set loose by code, moving, animating and fading by themselves, drawn with the room and cleared on entering a room;Particles.take/2takes particles out of the world, picked by a function of each, and a particle may carry any:picturein place of a:sprite.PartSystems: GameMaker's particle systems, types and emitters as its runtime runs them — ranges, increments, wiggles, gravity, three alphas, HSV colours, death and step particles, region shapes and spreads, automatic or manual update and draw.Colour:hsv/3(make_color_hsv) andmerge/3(merge_color).Draw.item/2: draw code adds any picture of the game's own.