0

I'm trying to set up a background in my game, and I want it to support multiple resolutions. I've tried using the scale trigger, but I'm pretty sure it multiplies the dimensions by the value. I need to resize the background by the resolution, so that won't work. Here's my code right now:

bgImage = new FlxSprite();
bgImage.loadGraphic(AssetPaths.SP_LevelBG__png, false, FlxG.width, FlxG.height);

bgImage.width = FlxG.width;
bgImage.height = FlxG.height;

add(bgImage);

Thanks in advance.

wideey
  • 13
  • 3

1 Answers1

0

Use scale: https://snippets.haxeflixel.com/sprites/scale/

bgImage.scale.x = 10;
bgImage.scale.y = 10;
SeiferTim
  • 438
  • 4
  • 18