Comments (9)
Hi,
Is there any progress on this one? I'm just starting with Starling and the project I'm working on could really do with this!
I've had a go at fixing it myself, but I got a bit lost as to how it all worked.
Thanks,
Owen
from starling-framework.
Not yet -- I'll try to have a look at it within this week!
from starling-framework.
Brilliant, thanks! I'll try and muddle through and see if I can fix it enough for what I need in the meantime.
from starling-framework.
Sorry for the delay! I'm currently working on performance enhancements and only looked at it for a short time.
However, what I found out so far: the frame settings are used, even when you update the texture. But I guess what you saw was that Starling does not update the image size automatically when the texture changes. The reason is a discussion I had a while ago for Sparrow:
http://forum.sparrow-framework.org/topic/scale-is-broken-in-development-branch
I'm currently favoring the following solution: adding a method to the Image class (e.g. "updateSizeFromTexture") which sets the size according to the texture (and frame). That way, both sides of the argument would have a way to do it.
What do you think about that?
from starling-framework.
Hi,
No worries.
I had a go at hacking something together, which works ok for what I need,
but I don't know enough about Starling to know whether it would have some
knock on effects (I'm assuming it does).
I changed the updateVertexData method so that it doesn't move the vertices,
but instead updates the texture uv depending on the frame
using setTexCoords (it definitely should be in a different function, but I
had trouble figuring out where it should be called). I also added in
texture rotation at this step. On each update it then calls
createVertexBuffer, which updates the texture.
I think it works ok, I've run a few different tests on it and it seems to
stand up.
I can send you over the classes I've modified so you can take a look if you
want?
Owen
On 28 November 2011 08:31, Daniel Sperl <
[email protected]
wrote:
Sorry for the delay! I'm currently working on performance enhancements and
only looked at it for a short time.However, what I found out so far: the frame settings are used, even when
you update the texture. But I guess what you saw was that Starling does not
update the image size automatically when the texture changes. The reason is
a discussion I had a while ago for Sparrow:http://forum.sparrow-framework.org/topic/scale-is-broken-in-development-branch
I'm currently favoring the following solution: adding a method to the
Image class (e.g. "updateSizeFromTexture") which sets the size according to
the texture (and frame). That way, both sides of the argument would have a
way to do it.What do you think about that?
Reply to this email directly or view it on GitHub:
from starling-framework.
Hi Owen,
great to hear that you found a way to do it, until I have fixed it myself!
Yes, it would be great if you could send me the changes!
Find my mail address here:
http://www.incognitek.com/redge/
Best regards,
Daniel
from starling-framework.
Hi Daniel,
Here are the classes I've made changes to. I've also included Tri and
TriImage, which are triangular versions of Quad and Image respectively.
Quad and Tri now extend Polygon to avoid duplicating code between the two.
I've added comments into the bits I've changed, marked with [OB]
Hope it all makes sense!
Cheers,
Owen
On 29 November 2011 15:49, Daniel Sperl <
[email protected]
wrote:
Hi Owen,
great to hear that you found a way to do it, until I have fixed it myself!
Yes, it would be great if you could send me the changes!Find my mail address here:
http://www.incognitek.com/redge/Best regards,
Daniel
Reply to this email directly or view it on GitHub:
from starling-framework.
I just wanted to tell you that I have made the necessary changes with Starling 0.9.1!
It now works like this:
After changing a texture of an image, you can call the new method
image.readjustSize();
to synchronize texture size and image size. When "scaleX" and "scaleY" are 1, the image will then have exactly the dimensions of the texture.
That should do it! =)
from starling-framework.
Great, thanks for doing that. Will check it out when I get some free time.
Owen
from starling-framework.
Related Issues (20)
- TextField AutoScale clips text if multiline and > 100% display scale HOT 2
- Glow Filter: Color issue HOT 7
- native overlay now block touch and mouse input HOT 1
- How do I use it correctly “drawToBitmapData” HOT 6
- AssetManager strange behavior
- AssetManager problem HOT 9
- Reverse delay for Tween HOT 2
- Stats showing actually rendered frames HOT 8
- ArgumentError in createVertexBuffer HOT 14
- DisplayObject dispose() method doesn't automatically remove the object from its parent HOT 3
- Render Texture: "Error #3605: Sampler 0 binds an invalid texture" when not cleared or drawn before actual Image rendering HOT 3
- Render Texture: draw method doesn't render display object with filter if parent is shifted HOT 8
- Texture: Setting vertex UV coordinates doesn't take into account the potential frame of SubTextures HOT 5
- How do we use Asset Manger with Google Play's Install Time Asset Packs? HOT 4
- Starling Texture.fromCamera() flickering and a part of the picture is missing on Windows HOT 4
- Object not removed from Stage on Android - Starling maybe? HOT 5
- Starling update from 2.5 to 2.7 doesn't catch tap around the left/bottom side HOT 2
- Juggler: String allocation when using IAnimatable as a Dictionary key HOT 4
- OpenGL error at macOS 12.2.1 (M1) HOT 2
- [Feature Suggestion] Vector Graphic Tesselation HOT 4
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 starling-framework.