File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,6 +320,13 @@ class PlayState extends MusicBeatSubState
320320 */
321321 public var cameraZoomRate : Int = Constants .DEFAULT_ZOOM_RATE ;
322322
323+ /**
324+ * How many beats (quarter notes) the zoom rate is offset.
325+ * For if you want the zoom to happen off-beat.
326+ * @default Zero beats (on-beat).
327+ */
328+ public var cameraZoomRateOffset : Int = Constants .DEFAULT_ZOOM_OFFSET ;
329+
323330 /**
324331 * Whether the game is currently in the countdown before the song resumes.
325332 */
@@ -1779,7 +1786,7 @@ class PlayState extends MusicBeatSubState
17791786 if (Preferences .zoomCamera
17801787 && FlxG .camera .zoom < (1.35 * FlxCamera .defaultZoom )
17811788 && cameraZoomRate > 0
1782- && Conductor .instance .currentBeat % cameraZoomRate == 0 )
1789+ && ( Conductor .instance .currentBeat + cameraZoomRateOffset ) % cameraZoomRate == 0 )
17831790 {
17841791 // Set zoom multiplier for camera bop.
17851792 cameraBopMultiplier = cameraBopIntensity ;
Original file line number Diff line number Diff line change @@ -42,12 +42,15 @@ class SetCameraBopSongEvent extends SongEvent
4242
4343 var rate : Null <Int > = data .getInt (' rate' );
4444 if (rate == null ) rate = Constants .DEFAULT_ZOOM_RATE ;
45+ var offset : Null <Int > = data .getInt (' offset' );
46+ if (rate == null ) offset = Constants .DEFAULT_ZOOM_OFFSET ;
4547 var intensity : Null <Float > = data .getFloat (' intensity' );
4648 if (intensity == null ) intensity = 1.0 ;
4749
4850 PlayState .instance .cameraBopIntensity = (Constants .DEFAULT_BOP_INTENSITY - 1.0 ) * intensity + 1.0 ;
4951 PlayState .instance .hudCameraZoomIntensity = (Constants .DEFAULT_BOP_INTENSITY - 1.0 ) * intensity * 2.0 ;
5052 PlayState .instance .cameraZoomRate = rate ;
53+ PlayState .instance .cameraZoomRateOffset = offset ;
5154 trace (' Set camera zoom rate to ${PlayState .instance .cameraZoomRate }' );
5255 }
5356
@@ -77,6 +80,14 @@ class SetCameraBopSongEvent extends SongEvent
7780 type : SongEventFieldType .FLOAT ,
7881 units : ' x'
7982 },
83+ {
84+ name : ' offset' ,
85+ title : ' Offset' ,
86+ defaultValue : 0 ,
87+ step : 1 ,
88+ type : SongEventFieldType .INTEGER ,
89+ units : ' beats'
90+ },
8091 {
8192 name : ' rate' ,
8293 title : ' Rate' ,
Original file line number Diff line number Diff line change @@ -237,6 +237,11 @@ class Constants
237237 */
238238 public static final DEFAULT_ZOOM_RATE : Int = 4 ;
239239
240+ /**
241+ * The default offset of camera zooms (in beats).
242+ */
243+ public static final DEFAULT_ZOOM_OFFSET : Int = 0 ;
244+
240245 /**
241246 * The default BPM for charts, so things don't break if none is specified.
242247 */
You can’t perform that action at this time.
0 commit comments