There are definitely some improvements to be made. In particular, single-frame resources should be able to use the master sprite.

Can you file a bug/improvement about the issue where Puffin1.png is loaded? That shouldn't be happening.

The master sprite image is preloaded once by the canvas/root sprite, which may be why you're seeing it loading, followed by Puffin1. Thanks again, as always!

Regards,
Max Carlson
OpenLaszlo.org

On 2/1/10 12:34 AM, Raju Bitter wrote:
I did a bit of testing with the master sprite functionality in DHTML,
that's great! I did a test with 4 images, here's the source code:

<canvas width="100%" height="800" bgcolor="black">
<!-- Take a few resources -->
<resource name="p1" src="Puffin1.png" />
<resource name="p2" src="Puffin2.png" />
<resource name="p3" src="Puffin3.png" />
<resource name="p4" src="Puffin4.png" />
<resource name="p5" src="Puffin5.png" />


<view x="20" y="20">
<simplelayout axis="x" spacing="50" />
<view resource="p1" />
<view resource="p2" />
<view resource="p3" />
<view resource="p4" />
<view resource="p5" />


</view>
</canvas>

The master sprite image is generated as imagesprite.sprite.png and
contains all 5 PNG files, but the first image Puffin1.png is still
downloaded as a separate file. Inspecting the HTML I can see that the
view with resource p1 is still using the single Puffin1.png using an
image tag, although that's part of the master sprite.

Another interesting thing is that the request is first started to
download the master sprite, and then the single image is downloaded. Is
that a feature?

But besides the technical questions, that's a great functionality which
is going to speed up many large DHTML apps!

- Raju

Reply via email to