scr_positions.gml 811 B

1234567891011121314151617181920
  1. // Les actifs du script ont changé pour v2.3.0 Voir
  2. // https://help.yoyogames.com/hc/en-us/articles/360005277377 pour plus d’informations
  3. // @function get_win_midx();
  4. /// @param {real} _spr_width Sprite Width (use if origin on abs left of sprite)
  5. /// @description Return window middle or how much back to put it with the object width
  6. function get_win_midx(_spr_width = 0){
  7. return ((window_get_width()/2) - (_spr_width/2));
  8. }
  9. // @function center_2width();
  10. /// @param {real} _x1 x pos of largest width
  11. /// @param {real} _large_w Width of largest
  12. /// @param {real} _small_w Width of smallest
  13. /// @description Return how much to push smallest width to center to the largest
  14. function center_2width(_x1, _large_w, _small_w){
  15. var _diff = _large_w - _small_w
  16. return _x1 + (_diff / 2)
  17. }