Giter VIP home page Giter VIP logo

Comments (7)

SudoPlz avatar SudoPlz commented on May 12, 2024

If that is too much to ask then please tell me of a way to scale down my assets in order to support other resolutions (Android devices) with different width and height scale factors. Having one generic scale factor does not work so well for me.

from dragonbonesas.

akdcl avatar akdcl commented on May 12, 2024

Hi, you set dbswf texture scale like this
factory = new StarlingFactory();
//only support scale dbswf texture
factory.scaleForTexture = 2;
factory.parseData();

from dragonbonesas.

SudoPlz avatar SudoPlz commented on May 12, 2024

factory.scaleForTexture = 2; works when we deal with iOS.. Things are simple on iOS because the screens have similar ratois, but what about Android.. ScaleFactor does not work well there since there are so many different resolutions with different aspect ratios... correct?
I need to different scale ratios, one for width and one for height.
Perhaps if there was:
factory = new StarlingFactory();
//only support scale dbswf texture
factory.setScaleForTexture(wScale, hScale);
factory.parseData();

from dragonbonesas.

akdcl avatar akdcl commented on May 12, 2024

you mast get scale ratios youself, and set the scaleForTexture

from dragonbonesas.

SudoPlz avatar SudoPlz commented on May 12, 2024

Yes but don't you see? Even setting the correct scaleForTexture will not do, because it scales down proportionally and that is not always wanted. I want to be able to scale all the textures unproportionally like so:
factory.setScaleForTexture(wScale, hScale);
Is that hard to implement?

from dragonbonesas.

SudoPlz avatar SudoPlz commented on May 12, 2024

Ok let me show you what I tried to do.. I created MyCustomStarlingFactory and changed the following lines on this funtion override protected function generateTextureAtlas(content:Object, textureAtlasRawData:Object):ITextureAtlas

What I changed:
var width:int = getNearest2N(content.width) * scaleForTexture;
var height:int = getNearest2N(content.height) * scaleForTexture;
is now
var width:int = getNearest2N(content.width* wScaleForTexture);
var height:int = getNearest2N(content.height* hScaleForTexture);

_helpMatrix.scale(scaleForTexture, scaleForTexture);
is now:
_helpMatrix.scale(wScaleForTexture, hScaleForTexture);

texture = Texture.fromBitmapData(bitmapData, generateMipMaps, optimizeForRenderToTexture, scaleForTexture);
is now
texture = Texture.fromBitmapData(bitmapData, generateMipMaps, optimizeForRenderToTexture, 1);

This worked fine and I can improportionally scale most of my animation BUT I have a problem.
For some reason I get wrong visual on my animations.

It should look like this:
right
but for some reason it looks like this:

wrong
I don't get it... It worked for other animations. Could it be because this one uses a shape tween?

from dragonbonesas.

SudoPlz avatar SudoPlz commented on May 12, 2024

This is what my dragonbones generated spritesheet looks like:
mc

from dragonbonesas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.