Window Animations - coldrockgames/gml-raptor GitHub Wiki
Windows are animated, when they change their state. You may influence some of the parameters of these animations (like the duration, minimized dimensions, things like that).
To do this, look at the UI_Configuration
file in the __GAME_SETUP__
folder of raptor:
#macro WINDOW_MINIMIZED_WIDTH 256
#macro WINDOW_MINIMIZED_STACK_HORIZONTAL true
#macro WINDOW_HEADER_BUTTONS_MARGIN 16
#macro WINDOW_STATE_CHANGE_ANIM_FRAMES 6
You may also override the minimize animation entirely, in case, you want to do something different than the default stacking, when a window gets minimized.
For this, the Window
class offers some methods, which you can override in your child-object:
Override these functions to customize the window minimize animation and position.
Look at the current implementation, and adapt in your subclass as necessary.
get_minimized_position_target
/// @func get_minimized_position_target(_minimized_dimensions, _view_rect)
/// @desc Return a Coord2 containing x/y (upper left corner) of the
/// minimized window. This is the target position of the minimize animation.
/// The first parameter contains the dimensions (also a Coord2) the window will have,
/// when its minimized. Use it to calculate rows/columns if you want to stack the
/// minimized windows like this default implementation does.
/// The second parameter is the current view rectangle (either UI dimensions, if
/// draw_on_gui is true or the current view dimensions)
get_minimized_position_target = function(_minimized_dimensions, _view_rect) {
get_minimized_position_dimensions
/// @func get_minimized_position_dimensions()
/// @desc Return a Coord2 containing width/height of the minimized window.
/// This is the scale target of the minimize animation
get_minimized_position_dimensions = function() {
on_minimize_completed
/// @func on_minimize_completed()
/// @desc Invoked from the finished-trigger of the minimize animation.
/// Perform any additional tasks on the window after the animation
on_minimize_completed = function() {
To fully customize the process of minimizing a window, provide coordinates and dimensions through the first two methods. The minimize Animation will follow them. Finally, in the completed callback, you may even change the sprite (let the window look like an icon only, for instance), or perform any other task, when the window arrived at its final position.