Skip to content

Commit

Permalink
use SimpleGraphic arg instead of loadGraphic()
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeDaleHim committed Nov 11, 2023
1 parent bd49767 commit 4cdfd1c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/backend/LoadingManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class LoadingManager extends MusicBeatState
__THREADPOOLS.run(loadImages);
__THREADPOOLS.run(loadSounds);

loadingSprite = new FlxSprite().loadGraphic(Paths.image('loading'));
loadingSprite = new FlxSprite(Paths.image('loading'));
loadingSprite.antialiasing = true;
loadingSprite.angle = Math.random() * 360;
loadingSprite.angularVelocity = 360;
Expand Down
4 changes: 2 additions & 2 deletions source/game/cutscenes/DialogueBox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class DialogueBox extends FlxTypedGroup<FlxSprite>
}
case 'thorns':
{
portraitLeft = new FlxSprite(320, 170).loadGraphic(Paths.image('cutscenes/$song/spiritFaceForward'));
portraitLeft = new FlxSprite(320, 170, Paths.image('cutscenes/$song/spiritFaceForward'));
portraitLeft.scale.set(6, 6);
portraitLeft.antialiasing = false;
portraitLeft.visible = false;
Expand Down Expand Up @@ -153,7 +153,7 @@ class DialogueBox extends FlxTypedGroup<FlxSprite>
};
add(dialogueText);

handSelect = new FlxSprite(1000, 575).loadGraphic(Paths.image('cutscenes/week6/hand_textbox'));
handSelect = new FlxSprite(1000, 575, Paths.image('cutscenes/week6/hand_textbox'));
handSelect.scale.set(6 * 0.9, 6 * 0.9);
handSelect.updateHitbox();
handSelect.visible = false;
Expand Down
2 changes: 1 addition & 1 deletion source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ class PlayState extends MusicBeatState

generateSong();

healthBarBG = new FlxSprite(0, FlxG.height * (Settings.getPref('downscroll', false) ? 0.1 : 0.9)).loadGraphic(Paths.image('game/ui/healthBar'));
healthBarBG = new FlxSprite(0, FlxG.height * (Settings.getPref('downscroll', false) ? 0.1 : 0.9), Paths.image('game/ui/healthBar'));
healthBarBG.screenCenter(X);
healthBarBG.scrollFactor.set();
addToHUD(healthBarBG);
Expand Down
2 changes: 1 addition & 1 deletion source/states/debug/characters/OffsetEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class OffsetEditorState extends MusicBeatState
if (FlxG.sound.music != null)
FlxG.sound.music.kill();

background = new FlxSprite().loadGraphic(Paths.image("menus/freeplayBG"));
background = new FlxSprite(Paths.image("menus/freeplayBG"));
background.scrollFactor.set();
background.cameras = [bgCamera];
add(background);
Expand Down
2 changes: 1 addition & 1 deletion source/states/menus/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class FreeplayState extends MusicBeatState
{
CacheManager.freeMemory(BITMAP, true);

background = new FlxSprite(0, 0).loadGraphic(Paths.image("menus/freeplayBG"));
background = new FlxSprite(Paths.image("menus/freeplayBG"));
background.scale.set(1.1, 1.1);
background.screenCenter();
background.scrollFactor.set();
Expand Down
4 changes: 2 additions & 2 deletions source/states/menus/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ class MainMenuState extends MusicBeatState
camFollow = new FlxObject(0, 0, 1, 1);
add(camFollow);

mainBG = new FlxSprite(-80).loadGraphic(Paths.image('menus/mainBG'));
mainBG = new FlxSprite(-80, Paths.image('menus/mainBG'));
mainBG.scrollFactor.set(0, 0.20);
mainBG.scale.set(1.175, 1.175);
mainBG.updateHitbox();
mainBG.screenCenter();
mainBG.antialiasing = Settings.getPref('antialiasing', true);
add(mainBG);

flickerBG = new FlxSprite(-80).loadGraphic(Paths.image('menus/flickerBG'));
flickerBG = new FlxSprite(-80, Paths.image('menus/flickerBG'));
flickerBG.scrollFactor.set(0, 0.20);
flickerBG.scale.set(1.175, 1.175);
flickerBG.updateHitbox();
Expand Down
2 changes: 1 addition & 1 deletion source/states/menus/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class TitleState extends MusicBeatState

if (!initialized)
{
newgroundsLogo = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('title/newgrounds_logo'));
newgroundsLogo = new FlxSprite(0, FlxG.height * 0.52, Paths.image('title/newgrounds_logo'));
newgroundsLogo.antialiasing = Settings.getPref('antialiasing', true);

newgroundsLogo.scale.set(0.8, 0.8);
Expand Down
2 changes: 1 addition & 1 deletion source/states/options/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class OptionsMenu extends MusicBeatState

override function create()
{
background = new FlxSprite().loadGraphic(Paths.image('menus/settingsBG'));
background = new FlxSprite(Paths.image('menus/settingsBG'));
background.scrollFactor.set();
add(background);

Expand Down

0 comments on commit 4cdfd1c

Please sign in to comment.