Novice learning 'Starling' discussion

Interesting questions: Is OpenFL’s Assets needed, when using Starling’s AssetManager.

It’s my understanding, that while OpenFL’s Assets class has direct access to the assets defined in your project.xml, Starling’s AssetManager does not.

<assets path="assets/img" rename="img" />
<assets path="assets/fonts" rename="fonts" />
<assets path="assets/svg" rename="svg" />

That hugely simplifies access to assets.

If you’re to use Starling’s AssetManager with the intention of not using OpenFL’s Assets at all, then you might need to build your own way of retrieving assets from some location.

So in theory you can do that, it’s just harder?

1 Like

Also worth noting, even if you don’t use OpenFL’s Assets, you’d still need to lean on OpenFL’s other loader classes (URLLoader) to access the assets manually.

Nothing wrong with that of course. It may help us better understand a solution, if we had a clearer picture of what it is you’re needing to do.

1 Like

.
Do not use other loading classes of ‘openfl’.
.
Can I directly use ‘Asset Manager’ to load resource files?
.

1 Like

.
The “AS3” version of “Starling” was last released in 2021. Is it still being updated?
.

.

Actually you’re right, you can. I used to do it this way when I was using AS3 (which is years ago now).

I wonder if there are system memory implications to using the OpenFL Assets system, versus manually bundling assets and enqueuing them at runtime with Starling. I know under AIR, bundling vs enqueuing was a big deal when working with lots of large assets, because AIR’s constraints on system and GPU memory were a lot tighter.

Perhaps something to test.

The creator of Starling, Daniel Sperl, has since moved onto other projects. If I’m not mistaken, he was being supported in large part by Adobe in his efforts with Starling, and he did an incredible job! However, when the Flash end of life was announced, that also brought in the end of that arrangement.

Now many people here that are looking after OpenFL, Starling, and various other projects in the eco-system, were active members of the Starling community. @joshtynjala’s FeathersUI framework was originally built specifically for AS3 Starling. When he ported it to Haxe, he broadened it’s application by building it on top of OpenFL.

But to get to your question, Starling for OpenFL still receives maintenance, largely thanks to @joshtynjala. Version 2.7.1 was released just earlier this year. You can see a list of commits since version 2.7.0 here.

I doubt we’ll be seeing radical new features or anything like that. But it’s worth considering that the Starling framework is very mature and nothing really comes to mind in terms of features I think it’d need.

1 Like

.
I have tried it, and there is no need for various loaders of “openfl”. “Asset Manager” can load file resources separately
.
But it’s strange, when I load ‘. mp3’, I receive an ‘error’, who can help me?
.


.
starling/assets/AssetManager.hx:1042: [AssetManager] Error creating s3: Could not load sound data: [lime.media.AudioBuffer] ERROR: Unsupported sound format
.
Source/Game.hx:46: error
.

Use the OGG codec, instead of MP3. I’m not sure if OpenFL has MP3 support yet, I know it was being discussed some years ago.

If it’s any consolation, OGG is generally regarded as being slightly better quality than MP3.

1 Like

.
Thank you, I changed it to “. ogg” and it can load and play normally
.
You guys are so happy, I came into contact with AS3 and OpenFL relatively late!
.

1 Like

.
Great, I loaded the file resources using ‘Asset Manager’.
.



.
var asset:AssetManager = new AssetManager();

	asset.enqueue(["Assets/openfl.png"]);
	asset.enqueue(["Sounds/s1.ogg"]);

	asset.loadQueue(function() {
		var wl:Texture = asset.getTexture("openfl");
		var img:Image = new Image(wl);
		img.x = 200;
		img.y = 200;
		addChild(img);

		asset.getSound("s1").play(0, 100);
	}, function(e) {
		trace("error");
	}, function(e) {
		trace(e * 100 + "%");
	});

.

.
By the way, can “Asset Manager” set the “concurrent quantity”?
.
Do you all make “1x 2x 3x” textures?
.
Can Asset Manager play multiple ‘Music’ and ‘Sound’ simultaneously?
.
Can the ‘openfl Assets’ class only play one’ Music 'at a time?
.

MP3 is not yet supported on native targets (cpp, hl, neko). Originally, it was due to patent concerns, but all of the patents are now expired, so it’s simply a matter of someone having the time to implement MP3 support. PRs welcome!

MP3 should work on the html5 target, though, since all major browsers support that audio format just fine.

2 Likes

While Daniel isn’t actively working on the project anymore, he is still accepting PRs, and there have been many bug fixes, and some interesting new features, added since 2021 that you can use if you check out Starling from GitHub. Daniel has mentioned that he might eventually release a new 2.8 version with these community updates.

The getSound() method returns a regular openfl.media.Sound object, and you can certainly play those simultaneously.

2 Likes

.
By setting showStats=true, the values are correct
.



.
When I instantiated the fps class, apart from fps, the following two values seem to be incorrect?
.


.
.Seeking help, thank you.
.

.
Because I need to display real-time fps on my own text box
.
So only the fps class can be instantiated.
Is there any other way to obtain the fps value from the fps display card? This problem has been bothering me for a long time.
.

I don’t think that StatsDisplay is meant to be instantiated on its own instead of setting showStats to true.

However, if you insist, then it looks like you need to manually provide the number of draw calls. I see that Starling sets __statsDisplay.drawCount in its render() method. So if you instantiate a separate StatsDisplay, you will need to provide the drawCount value manually.

The std memory value appears to use System.totalMemory, so it is not clear to me why it would be different.

1 Like

.
In ‘Starling’
.
I have a ‘Sprite’, which contains 50 ‘MovieClips’
.
Set 49 ‘MovieClip visible=false’
.
At this moment, I move ‘Sprite. x+=10’
.
Does 49 ‘MovieClips’ consume performance?
.

.
I found that quickly moving a ‘Sprite’
.
“Sprite.x+=20”
.
During the rapid movement of Sprite, there is shaking around it
.
How to solve jitter?
.

What was the first release date of AS3 Starling?

Perhaps setting the pixelSnapping property to true on the movie clips will help.

Version 1.0 of AS3 Starling was released in 2012.

The first commit in the Gamua/Starling-Framework repository was in 2011.

1 Like