Releases: jack27121/STANNcam
v2.3.1
What's Changed
- Fix
stanncam.move()
not moving on the first frame by @bfrymire in #67 - Fix moving camera immediately while following instance by @bfrymire in #68
- improved movement and simplified zooming by @jack27121 in #73
- fixed smearing on edges by @jack27121 in #72
Full Changelog: v2.3.0...v2.3.1
STANNcam v2.3.0
Changes from v2.2.4
Read through and check if you need to make any changes from the last version.
stanncam_fullscreen_ratio_compensate_x / y
is now calledstanncam_ratio_compensate_x / y
As it is no longer exclusive to the full screen window mode, but just whenever the window aspect ratio doesn't match the game's aspect ratio- Enum
STANNCAM_WINDOW_MODE
values have changed to be screaming snake case:WINDOWED
FULLSCREEN
BORDERLESS
__SIZE
- Added to show number of options in case you want to iterate through them
New Additions
cam.draw_no_compensate
function, the same as cam.draw but without automatically drawing in the middle of the screen when the aspect ratio doesn't match the display.cam.set_paused
cam.get_paused
cam.toggle_paused
stanncam_toggle_cameras_paused
stanncam_set_cameras_paused
stanncam_cameras_pause
stanncam_cameras_unpause
functions, you can pause the camera, any movement they were doing before being paused will resume when unpausedstanncam_get_preset_resolution
stanncam_get_preset_resolution_range
functions has been added, there is now a long list of commons pc resolutions as well as classic game console resolutions. More will be added later, you can still set whatever resolution you want manually, this is just a quick preset collection.cam.room_to_display_x / y
function (similar to room to gui)- added
stanncam_destroy
function. It does the opposite ofstanncam_init()
Enhancements
- The first camera uses the
application_surface
instead of creating a new surface, it's a bit more efficient - If stanncam gets deactivated, (like if you use deactivate_all for optimization, you'll get a warning telling you to re-activate stanncam, and how to do so. It's a helpful error if you get confused, why something broke.
- Updated JSDocs
Bug Fixes
- fixed bug that would overwrite cameras when switching rooms
- get_mouse_x/y had difficulties on mac, that got fixed and inadvertently works better on windows as well now
- fixed surface memory leak when destroying a
stanncam
STANNcam v2.2.4
Important changes
-
smooth_zoom and smooth_draw has been combined, there is now only smooth_draw
it is enabled by default and most people probably want that anyway so shouldn't anything for most people -
get_zoom_x() and get_zoom_y() has been added to get the .zoom_amount value from a cam. It's split in two because when smooth_draw is off, the values are different in each axis to maintain pixel perfection. If you exclusively have smooth_draw turned on however it's the same result if you still just use .zoom_amount
Example room changes
- made several minor tweaks to example rooms. You can toggle smooth_draw on off in room 1 with "B"
- Added a third test room, which features a pixel grid you can zoom in out, and move around with arrow keys. To check it's in order. Mainly for development.
Several bug fixes. Including
- some optimization of how drawing is handled when smooth_draw it turned off
#21 - made changes to the internal scaling code. think it solves
#18 - before you had to have an "instance" layer now it just adds stanncam using instance_create_depth.
- using move and zoom with a duration of 0 will enact the effects instantly (there was a 1 frame delay before, so you couldn't get_x on the same frame)
- zoom now has a default duration of 0 (it was missing by mistake)
STANNcam v2.2.0
Runner_GhtH9eqLJB.mp4
New sidescroller example room has been added
New features
-
Resize camera
The same way you can zoom and move the camera over time, you can now resize it -
Offset
You can offset the camera from it's x and y position over time -
Debug draw
.debug_draw is off by default, but if turned on, follow is set, you will see the bounding box for the camera rendered, and when the followed objects is touching the edges of the bounding box, red lines will be drawn to show how it works.
This also showcases bounds_dist_w and bounds_dist_h which show how far away the followed object is from the bounds edges. -
Animation curves
Each stanncam instance now has new variablesanim_curve
,anim_curve_zoom
,anim_curve_size
,anim_curve_offset
Which handle camera movement (when not following something) and zooming respectively. You can set these variables to your own animation curves to specify how the camera moves or zooms. And change them at run time! -
Smooth Zoom
Now by default smooth zoom is on. And let's the graphics appear smooth even when zoomed out. It will scale the camera's surface up only when zoomed out, to allow more to be visible. If turned off, when zoomed out everything will appear much more pixelated. Which if you are a pixel-perfect purist might still be what you want! -
Ability to drag and resize windows
If you have "Allow window resize" turned on, you can drag the game window around, and the resolution will update to match. -
Borderless windowed option
It will fill up your monitor like fullscreen, but be a borderless window
Important changes
- Toggle_fullscreen() has been removed, and replaced with stanncam_set_window_mode()
because there's now 3 modes, windowed fullscreen and borderless. A toggle didn't make sense. Read the wiki!
STANNcam v2.1.1 LTS
STANNcam v2.0.0
v2.0.0
STANNcam is now mostly struct based, in that every new camera instance is made with a constructor.
Which makes it easy to make or remove cameras on the fly.
I will start on writing documentation on the wiki page shortly
STANNcam v1.8.0
Completely refactored stanncam using constructors. Now more cameras can be created
Every camera is a struct containing different functions to use
STANNcam v1.0.0
-
changed all method names to start with stanncam for easy consistency
-
changed following code to more dynamically follow an object depending on speed, and now speed threshold. The threshold is the minimum distance from the camera to the followed object for the speed to take full effect, this lets the camera smoothly follow an object, or let it lag behind
-
added stanncam_speed method, to change spd and spd_threshold variables
-
fixed a bug that ruined zooming when switching to and from fullscreen mode
-
changed stanncam_out_of_bounds (formerly cam_out_bounds) to take the zoom level into account
-
changed example project to show the new changes
STANNcam v0.8.0
Update readme.md