gml_starfield_generator
A script to generate starfields in GameMaker’s GML language.
Overview
Since I found drawing starfields in Photoshop and importing them into GM a waste of texture-page space, I created this little script that creates starfields from scratch onto a transparent surface which can be drawn onto any background. The script is highly customizable and extensively commented so it should be fairly easy to use and modify.
Usage
- Download the two provided GML files
- Import the two files as scripts into your Game Maker project
- Create a new object
- Add a Creation event with an "Execute Script" action and select
scr_fx_starfield_init - Add a Draw event, also with an "Execute Script" action and select
scr_fx_starfield_draw - Modify the values in
scr_fx_starfield_initto your needs.
To create a new starfield, just create an instance of the object at any coordinates.
Notes
Since the starfield is drawn onto a surface that is inherently volatile, it’s good practice to check whether it still exists and re-draw it, if necessary. Surfaces get destroyed when switching to/from full screen, for example.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
