Code Monkey home page Code Monkey logo

Comments (9)

jokigenki avatar jokigenki commented on May 22, 2024

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.

PrimaryFeather avatar PrimaryFeather commented on May 22, 2024

Not yet -- I'll try to have a look at it within this week!

from starling-framework.

jokigenki avatar jokigenki commented on May 22, 2024

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.

PrimaryFeather avatar PrimaryFeather commented on May 22, 2024

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.

jokigenki avatar jokigenki commented on May 22, 2024

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:

#49 (comment)

from starling-framework.

PrimaryFeather avatar PrimaryFeather commented on May 22, 2024

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.

jokigenki avatar jokigenki commented on May 22, 2024

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:

#49 (comment)

from starling-framework.

PrimaryFeather avatar PrimaryFeather commented on May 22, 2024

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.

jokigenki avatar jokigenki commented on May 22, 2024

Great, thanks for doing that. Will check it out when I get some free time.

Owen

from starling-framework.

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.