Giter Site home page Giter Site logo

totobal5 / lens Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tabularelf/lens

0.0 0.0 0.0 225 KB

Camera Constructor adaption for doing what GameMaker should've had been doing along time ago...

License: MIT License

Game Maker Language 100.00%

lens's Introduction

Lens v1.1.1

Camera Constructor wrapper for GameMaker Studio 2.3.2+.

This is just a drop in for most of the camera_* functions presented in GameMaker Studio 2 as methods via a constructor, as .PascalCase().
It also outright removes having to supply a cameraID for every method. Leaving it down to just providing the arguments.
Most of the methods are chainable as well.

Use case:

// Creates a new Lens instance. Each instance carries its own cameraID.
cam = new Lens();
cam.SetViewCam(0).SetViewPos(32,32).SetViewSize(1280,720).Apply();

Methods

While most of it is pretty much plug in play (without having to supply CameraID), there's a few extra methods included.

.GetViewSpeed()

Returns: an array that contains the results from .GetViewSpeedX() and .GetViewSpeedY()

.GetCameraID()

Returns: CameraID

.SetViewCamera(view_camera)

Basically the same as view_camera[view_num] = camID. but internally tracks the cameraID for when .free() is called.

.Free()

Frees the internal cameraID.

.GetCameraRect()

Returns an array with ViewX, ViewY, ViewX + ViewW, ViewY + ViewH.

lens's People

Contributors

tabularelf avatar zice-o-lantern 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.