Comments (7)
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.
Hi, you set dbswf texture scale like this
factory = new StarlingFactory();
//only support scale dbswf texture
factory.scaleForTexture = 2;
factory.parseData();
from dragonbonesas.
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.
you mast get scale ratios youself, and set the scaleForTexture
from dragonbonesas.
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.
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:
but for some reason it looks like this:
I don't get it... It worked for other animations. Could it be because this one uses a shape tween?
from dragonbonesas.
This is what my dragonbones generated spritesheet looks like:
from dragonbonesas.
Related Issues (20)
- What kind of method instead addTextureAtlas in 4.7? HOT 2
- nested armature error on dispose HOT 1
- Animations is blinking if change it in LOOP_COMPLETE event HOT 2
- Lost context for Starling 1.x HOT 9
- DragonBones 4.7 mesh issue with Starling 1.8 HOT 2
- Is there a way to Scale armature.display with smooth texture? HOT 4
- slot getBounds() for collision detection HOT 3
- slot getBounds() scale?
- Assetmanager & multi-resolution problem HOT 3
- Handling multi-resolution textures with `addTextureAtlasData` HOT 3
- help : no AS easy tutorial HOT 3
- Default animation HOT 1
- found problem on ObjectDataParser.as HOT 1
- Baseobject.as HOT 1
- 动画播放第一次的时候,FRAME_EVENT不触发
- hi where is DragonBone pro source code? HOT 11
- Add support of TextureAtlas frames for trimmed textures HOT 2
- Add support of Dragon Bones 5.5 skeleton format HOT 6
- Ik Constraint Target -> Bend is Ignored?
- Animations ignore IK properties
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dragonbonesas.