Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I rotate a sprite from an FlxScene? #354

Open
itsamedood opened this issue Nov 21, 2021 · 0 comments
Open

How can I rotate a sprite from an FlxScene? #354

itsamedood opened this issue Nov 21, 2021 · 0 comments

Comments

@itsamedood
Copy link

I saw FlxScene and thought I would try it, but I'm not quite sure how to rotate a sprite that is inside the xml file.

Here's the xml file:

<?xml version="1.0" encoding="utf-8"?>

<scene width="1000" height="1000" bgColor="black" name="splash_screen" description="Plays on boot." version="1.0">
	<layer id="bg">
		<sprite graphic="assets/images/game/bg.png" x="320" y="120" width="2000" height="1500" />
	</layer>
	<layer id="main">
		<sprite graphic="assets/images/logos/me.png" x="384" y="-46" width="200" height="200" />
		<text id="meText" text="itsamedood" x="504" y="326.5" color="white" size="50" font="assets/fonts/hey_comic.ttf" />
	</layer>
</scene>

What I want is to rotate the sprite on the layer bg (line 5) by 0.03 every second using the update method, but how do I access the bg sprite from the xml file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant