Releases: stann-co/STANNcam
2.4.2 pre-release
adds Config file, a handful of macros can be changed, for slightly extra control #34
adds Zone priority, if colliding with multiple zones, only the highest priority zones are evaluated #96
adds instance variable to constraint zones, to be disabled on room, start
fixes #92
fixes #93
fixes rounding error when zooming in/out
there's a stanncam_config file added with macros
STANNCAM_CONFIG_SNAP_TO_FOLLOW_ON_ROOM_START if a followed object is active at the start of a room, should the camera be snapped to it?
STANNCAM_CONFIG_SNAP_TO_ZONE_ON_ROOM_START if a followed object is within a constrain zone at start of room, should the camera be snapped to it?
STANNCAM_CONFIG_ZONE_CONSTRAIN_ALWAYS_SMOOTH regardless of smooth draw, constrain zones will always be evaluated and transitioned between smoothly
STANNCAM_CONFIG_ZONE_CONSTRAIN_TRANSITION_SNAP_THRESHOLD With smooth draw off, when transitioning between zones, after this threshold the zones will snap into place (to prevent it from lerping some tiny decimal for way too long)
important change, .room_to_gui doesn't automatically snap to nearest integer anymore, sometimes you might not want that, if you do you can simply write it like .room_to_gui_x(round(my_value)) instead
Full Changelog: v2.4.0...v2.4.2
v2.4.0
What's Changed
Bug Fixes
- Pixel twitching when following player with smooth_draw off has been removed!
(with smooth draw on, a twitch may still appear, since the followed instance stays on the pixel-grid but the camera does not, recommend only using smooth_draw in games with free roam cameras, like RTS, strategy games or similar) room_to_gui_x/y,room_to_display_x/y,get_mouse_x/yall are more accurate- Improvements to resolutions changes
- Switching to fullscreen and back to windowed, now retains window resolution
Improvements
- Zone constraints now transition to and from each-other gradually
- Zones can be linked together with variable definitions. So if you enter one, the linked ones are active as well
- Complete overhaul of underlying systems for converting view space to room space, and vice versa
- Can zoom out beyond 2 and the camera size and surfaces dynamically expand
- Following code has been simplified, camera speed should be between 1 and 0, a value of 1 makes it track an instance perfectly, anything less makes it lag behind
room_to_view_x/yandview_to_room_x/yfunctions now available- smooth_draw is false by default, as it's probably what most would want
!!!Breaking changes!!!
- speed_threshold has been removed, now there's only a speed variable,
.set_speed(spd)only takes a single argument, between 1 and 0get_zoom_x()andget_zoom_y()have been removed. If you need the zoom value, you can usezoom_amount
Full Changelog: v2.3.1...v2.4.0
v2.4.0-beta
What's Changed
- Fix parallax typo by @bfrymire in #82
- Zone constraints now transition to and from eachother
- Zones can be linked together with variable definitions. So if you enter one, the linked ones are active as well
- Pixel twitching when following player with smooth_draw off has been removed!
- Complete overhaul of underlying systems for convertain view space to room space, and vice versa
- room_to_gui, room_to_display, get_mouse all are more accurate
- Can zoom out beyond 2 and the camera size and surfaces dynamically expand
get_zoom_x()andget_zoom_y()have been removed. If you need the zoom value, you can use zoom_amount- improvements to resolutions changes
Full Changelog: v2.3.1...v2.4.0-beta
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 / yis 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_MODEvalues have changed to be screaming snake case:WINDOWEDFULLSCREENBORDERLESS__SIZE- Added to show number of options in case you want to iterate through them
New Additions
cam.draw_no_compensatefunction, 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_resolutionstanncam_get_preset_resolution_rangefunctions 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 / yfunction (similar to room to gui)- added
stanncam_destroyfunction. It does the opposite ofstanncam_init()
Enhancements
- The first camera uses the
application_surfaceinstead 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