From 6e2877c2a9dc2d6de1ef793d35b6746f766d86b5 Mon Sep 17 00:00:00 2001 From: Microkat <89645987+KadePleaseHelpMe@users.noreply.github.com> Date: Sat, 14 Dec 2024 09:47:47 -0500 Subject: [PATCH] Added flipX and flipY to loadSpriteFromXML() (#487) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #478 * Added flipX and flipY to loadSpriteFromXML() why was this not already implemented? Nevermind I'm pretty sure it's because parseBool isn't a thing * WHOOPS gotta update my heckin repo * Wow neo is good at simplifying stuff rip parseBool but HAXE MAKE IT A THING * sigma ¯\_(ツ)_/¯ * Allow for flipx and flipy as opposed to flipX and flipY (cammel text) * gaming chair 🪑 --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com> --- source/funkin/backend/utils/XMLUtil.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/funkin/backend/utils/XMLUtil.hx b/source/funkin/backend/utils/XMLUtil.hx index df5519859..a074f97d3 100644 --- a/source/funkin/backend/utils/XMLUtil.hx +++ b/source/funkin/backend/utils/XMLUtil.hx @@ -143,6 +143,8 @@ class XMLUtil { var graphicSizey:Null = Std.parseInt(node.att.graphicSizey); if (graphicSizey.isNotNull()) spr.setGraphicSize(0, graphicSizey); } + if (node.has.flipX) spr.flipX = node.att.flipX == "true"; + if (node.has.flipY) spr.flipY = node.att.flipY == "true"; if (node.has.updateHitbox && node.att.updateHitbox == "true") spr.updateHitbox(); if (node.has.zoomfactor) @@ -392,4 +394,4 @@ typedef BeatAnim = { interface IXMLEvents { public function onPropertySet(property:String, value:Dynamic):Void; -} \ No newline at end of file +}