Giter Club home page Giter Club logo

dugmanjr's Introduction

prettylight

Pretty lights for GameMaker

Version 2.0

prettylight is a powerful lighting engine for use with GameMaker: Studio. It makes use of surfaces and shaders to give you a simple to use yet optimal solution to your problems in need of lighting up!

Now available on the GameMaker marketplace!

Screenshots

Credits

Lots of lighting help by FatalSleep, gaussian blur shaders written by xygthop3.

Usage

Setting Up

prettylight doesn't need much to work. It needs the appropriate scripts and shaders to run properly, that's all.

First things first, you'll want to initialise the system within your control object. Simply call pl_init() in your create event to set up the engine, and preferably add all light object parents within the pl_add() method. For example, all your light sources would be children of an object called objLight - you'd then add that parent object to the light objects list in order for it to work. This is so the engine knows which objects it should mess with when lighting things up!

You'll need to process the engine in a step event of your choosing (begin step is preferred) using pl_update(), draw the lights in the draw event with pl_draw(), and end the system in the room end/game end event using pl_end().

You'll also need a view to draw the lights. prettylight is currently set to process in the view with id 0 (the default one).

Making Lights

In order for something to light up, make sure it or it's parent is added to the light object list using pl_add(obj1, obj2, ...) as stated above. Then simply call pl_light_init(radius, colour, alpha) in your create event. You may modify your light using the available methods, but please note you can't specify a radius larger than the one you initially put in.

Customisation

You may toggle certain options using the provided scripts:

  • pl_set_vivid(active?) - toggles vivid lighting (uses additional surface)
  • pl_set_blurring(active?) - toggles blurring (uses shaders)
  • pl_option_set_ambience(color, brightness) - make changes to the ambience
  • pl_option_set_blur(amount, alpha) - make changes to the blur

What's Next?

prettylight is currently maintained primarily by Nik Sudan, but I'm more than happy to approve merge requests that help the project develop even further! Future features that would be cool include:

  • Shadow casters (pretty much coded, needs optimising though!)
  • Ambient blur (was in version 1, would be nice to have a comeback!)
  • Light styles (cartoony, pixelly, etc.)

dugmanjr's People

Contributors

gelscott avatar

Stargazers

 avatar

Watchers

James Cloos avatar Nicho avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.