Dynamic Resolution Scaling for Habbo Projector in Adobe Director

paswrd

Administrator
Staff member
Apr 18, 2017
64
2
This script dynamically adjusts the resolution of the Habbo Shockwave client based on the available screen space. If the user’s screen resolution is large enough, the script scales the client up to 1440x1080 for better visibility. However, if the screen is too small (e.g., a 1080p monitor), it keeps the default resolution to prevent the client from being cropped or misaligned.

There's really not a great way to natively support all modern resolutions. This script provides a simple and effective way to automatically adjust the client size for larger screens while preventing issues on smaller displays.
Code:
on prepareMovie
  if externalParamValue("debug") contains "1" then
    the debugPlaybackEnabled = 1
  else
    the debugPlaybackEnabled = 0
  end if
  castLib(2).preloadMode = 1
  preloadNetThing(castLib(2).fileName)
  resolutionArray = the desktopRectList[1]
  resolutionWidth = getAt(resolutionArray,3)
  resolutionHeight = getAt(resolutionArray,4)
  threshold = 300
  if(externalParamValue("dynamicResolution") contains "1") then
    
    if((resolutionWidth-threshold) >= 1440 and (resolutionHeight-threshold) >= 1080) then
      (the stage).drawRect = rect(0, 0, 1440, 1080)
      (the stage).rect = rect(the stageLeft, the stageTop, the stageLeft + 1440, the stageTop + 1080)
    end if
    

  end if
 
  the centerStage = TRUE
 
  moveToFront(the stage)
 
  set the exitLock to 1
  puppetTempo(15)
end

on stopMovie
  stopClient()
  go(1)
end


ARCHIVED FROM THE OLDSKOOLER DISCORD
Special thanks to Webbanditten for this code and addition from his v14 client.
Credits: @webbanditten
 

Attachments

  • image.png
    image.png
    6.4 KB · Views: 240