Novice learning 'Starling' discussion

Leave your mc’s x and y co-ordinates at 0,0 while testing, in case you’ve pushed it off the stage. Your stage doesn’t look very big.

You might also try bringing in a single frame as an image (for testing):

addChild(new Image(assetManager.getTexture("qq_frame_20")));

I have tried, ‘neko html5’ does not display content, ‘flash’ can display it

Flash "can display animations, but the animation frames are incorrect and out of order.

And it doesn’t support anchor points

I feel like it’s not as good as’ Adobe Animate ’

Adobe Animate supports anchor points and the frame order is also correct

This is an old version that is about to be phased out

starling.utils.AssetManager

API recommends that we use the new version

starling.assets.AssetManager

The sequence of animation frames is incorrect

Anchor points are also not supported


Try using leading zeroes on your filename.
qq_frame_02.png instead of qq_frame_2.png

Your source for this info?

Are you familiar with “Texture.fromBitmapData”?

Is this method to convert one texture after another, or to put each texture into a texture atlas?

I converted a set of PNG files into textures, switched each texture to form an animation, and drew once on the FPS tab.

2.7.1. AssetManager versions

Starling 2.4 features a new, much enhanced AssetManager. All the code examples that follow were written with this new version in mind.

The new AssetManager class can be found in the starling.assets package. For compatibility reasons, the old version is still available at its previous location (in starling.utils), but it’s now marked as deprecated. Upgrading to the new version should be really painless — the changes in the public API were kept at a minimum. In exchange, you can profit from the new version’s much higher flexibility.

1 Like

The current situation is that anchor points are not supported, and the texture order of multiple elf table frames is incorrect

Thanks for sharing those AssetManager details @785597448. It does vaguely ring a bell now you mention it. I’ll have to go back and look at that again.

Can you confirm please, have you tried using leading zeros on your PNG assets? Ideally, your PNG frames should be named something like someasset_001.png, someasset_002.png etc.

The options available at the moment are:

  1. Set your pivot point in code (the method I’ve typically used). Eg:
mc.pivotX = mc.width * 0.5;
mc.pivotY = mc.height;
  1. Manually write the pivot into the atlas XML. You only need to do this for the first frame of an animation sequence, as Starling will automatically apply it to the remaining frames. For frame 01:
<SubTexture name="qq_frame_01" pivotX="256" pivotY="256" ........
  1. Write a custom exporter for TexturePacker, so setting a pivot point is supported. I think this is worth approaching.
  2. Wait until TexturePacker supports setting a pivot point. Something we have no guarantee will ever happen.

“assetManager.addTextureAtlas()”

It’s an old version of the method

Has been marked as abandoned

So I don’t want to use the old version of the method

“AssetManager”
I want to know if there are any other ways to implement the new version

Currently, you’re jumping from problem to problem, and not really providing any feedback about what you’ve tried, what has and hasn’t worked.

I know the classic AssetManager works. That’s not the issue here. I have no issue with you wanting to try to use the new one, but would you like to focus on getting your animations working, or would you like to focus on the non-essential stuff?

I’m just another user like you. I have projects I should probably be focusing on, so let’s stay on track.

Ah haha! I was very excited that it was successful.

starling.assets.AssetManager
Firstly, I implemented it using a new method.

ATF supports’ flash ’
I tested it and found that “ATF” does not support “neko html5”

So I changed ‘ATF’ to ‘png’
I tested that “neko html5” does not support “ATF”

Also, I used ‘leading zeros’
This way, the animation frame order is correct

Novices can see how I implement it


var ss:AssetManager = new AssetManager();
ss.enqueue([

		"qq/qq-0.png",
		"qq/qq-0.xml",

		"qq/qq-1.png",
		"qq/qq-1.xml",

		"qq/qq-2.png",
		"qq/qq-2.xml",
	]);

	ss.loadQueue(function() {
		var mc:MovieClip = new MovieClip(ss.getTextures("qq_frame_"), 12);
		mc.x = 200;
		mc.y = 200;
		addChild(mc);
		Starling.current.juggler.add(mc);
	});

I’m not sure what you mean by “neko html5”. They’re two different targets.
In my testing, both Neko, and HTML5 appear to support ATF with DXT. The first two cats are spritesheets in ATF (DXT) format. The last one on the bottom is a regular PNG spritesheet.

My test project when targeting HTML5 (and testing in Chromium based browser):

openfl test html5

Same project targeting neko (gains etc2 in this one, but it’s a bit rough):

openfl test neko

I’m running this under Linux. I’m not sure if that makes a difference?

It would be great if ‘TexturePackerGUI Starling’ supports setting anchor points and exporting anchor point data

What else can be the goal of “neko and html5”.

‘ATF’ doesn’t display anything in ‘neko html5’

This is what I just tested

So I switched to PNG

I don’t know what the reason is, you said you support it, but my testing doesn’t show anything

TexturePacker
Has the author responded to your feedback?

Thank you very much for sharing your experience with me all along

1 Like

What’s your final goal for the app? Will it be a web-app? Or will it be something a user installs on a Windows system? Or something else?

It is an “. html” webpage

Online “. html” web game, users don’t need to install anything, just have a browser