# Creating @2x graphics with Spine

**URL:** <https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177>\
**Category:** Spine\
**Created:** [May 29, 2013, 12:51pm UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177 "2013-05-29T12:51:49Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan73](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/a/5e9695/32.png) [@alan73](https://forums.solar2d.com/u/alan73)\
**Post date:** [May 29, 2013, 12:51pm UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/1 "2013-05-29T12:51:49Z")

</div>

Just wondering how one goes around catering for this with Spine. Previously when doing animation or graphics I would have 2 versions, the normal and the @2x. Then setting up the config file to detect depending on the resolution of the device which one to use.

Is it possible to create two versions of your skeleton and images in Spine and then have it use the @2x version the same as you would with standard images? If so how do you do it, how do you adjust the scale and images and how do you reference the @2x version then.

Thanks

---

<div class="post-metadata">

**Author:** ![chevol](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/c/a88e57/32.png) [@chevol](https://forums.solar2d.com/u/chevol)\
**Post date:** [May 29, 2013, 9:11pm UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/2 "2013-05-29T21:11:53Z")

</div>

I am wondering the same thing

---

<div class="post-metadata">

**Author:** ![gtt](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@gtt](https://forums.solar2d.com/u/gtt)\
**Post date:** [May 30, 2013, 9:02am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/3 "2013-05-30T09:02:00Z")

</div>

We’re also started working with spine. And it’s just awesome…

I’ve looked in the corona runtime and the creation of images is done via display.newImage and not display.newImageRect, so the answer to you question is that it aint supported yet…

We do plan to use @2x images by changing the call to display.newImageRect, and in spine just work with the x1 images.

Once you do that just have the @2x images ready for corona in the same directory and it should work just fine.

In the final product I would go even one step further and just twick the runtime to work with a spritesheet and pack all the images in it.

Hope this helps…

---

<div class="post-metadata">

**Author:** ![cublah](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@cublah](https://forums.solar2d.com/u/cublah)\
**Post date:** [May 30, 2013, 12:01pm UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/4 "2013-05-30T12:01:43Z")

</div>

> [@gtt](#):
>
> We’re also started working with spine. And it’s just awesome..
> 
> I’ve looked in the corona runtime and the creation of images is done via display.newImage and not display.newImageRect, so the answer to you question is that it aint supported yet…
> 
> We do plan to use @2x images by changing the call to display.newImageRect, and in spine just work with the x1 images.
> 
> Once you do that just have the @2x images ready for corona in the same directory and it should work just fine.
> 
> In the final product I would go even one step further and just twick the runtime to work with a spritesheet and pack all the images in it.
> 
> Hope this helps..

It’s not that it’s not supported, it’s that it’s up to you to change display.newImage to display.newImageRect, as you said. We have had it working for the last month and it works fine, we have spine working with sprite sheets in hi and low res just by changing that function which is supposed to be changed to account for how you want to load the graphics.

---

<div class="post-metadata">

**Author:** ![gtt](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@gtt](https://forums.solar2d.com/u/gtt)\
**Post date:** [June 3, 2013, 10:49am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/5 "2013-06-03T10:49:51Z")

</div>

Sorry, that’s actually what I meant… I wrote “unsupported” because it is not in the public runtime release… It’s true you can modify the code as you wish and we did it on some other places as well but if the publisher of spine releases an update to the runtime obviously you’ll need to adjust it again…

---

<div class="post-metadata">

**Author:** ![chevol](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/c/a88e57/32.png) [@chevol](https://forums.solar2d.com/u/chevol)\
**Post date:** [May 29, 2013, 9:11pm UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/6 "2013-05-29T21:11:53Z")

</div>

I am wondering the same thing

---

<div class="post-metadata">

**Author:** ![gtt](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@gtt](https://forums.solar2d.com/u/gtt)\
**Post date:** [May 30, 2013, 9:02am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/7 "2013-05-30T09:02:00Z")

</div>

We’re also started working with spine. And it’s just awesome…

I’ve looked in the corona runtime and the creation of images is done via display.newImage and not display.newImageRect, so the answer to you question is that it aint supported yet…

We do plan to use @2x images by changing the call to display.newImageRect, and in spine just work with the x1 images.

Once you do that just have the @2x images ready for corona in the same directory and it should work just fine.

In the final product I would go even one step further and just twick the runtime to work with a spritesheet and pack all the images in it.

Hope this helps…

---

<div class="post-metadata">

**Author:** ![cublah](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@cublah](https://forums.solar2d.com/u/cublah)\
**Post date:** [May 30, 2013, 12:01pm UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/8 "2013-05-30T12:01:43Z")

</div>

> [@gtt](#):
>
> We’re also started working with spine. And it’s just awesome..
> 
> I’ve looked in the corona runtime and the creation of images is done via display.newImage and not display.newImageRect, so the answer to you question is that it aint supported yet…
> 
> We do plan to use @2x images by changing the call to display.newImageRect, and in spine just work with the x1 images.
> 
> Once you do that just have the @2x images ready for corona in the same directory and it should work just fine.
> 
> In the final product I would go even one step further and just twick the runtime to work with a spritesheet and pack all the images in it.
> 
> Hope this helps..

It’s not that it’s not supported, it’s that it’s up to you to change display.newImage to display.newImageRect, as you said. We have had it working for the last month and it works fine, we have spine working with sprite sheets in hi and low res just by changing that function which is supposed to be changed to account for how you want to load the graphics.

---

<div class="post-metadata">

**Author:** ![gtt](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@gtt](https://forums.solar2d.com/u/gtt)\
**Post date:** [June 3, 2013, 10:49am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/9 "2013-06-03T10:49:51Z")

</div>

Sorry, that’s actually what I meant… I wrote “unsupported” because it is not in the public runtime release… It’s true you can modify the code as you wish and we did it on some other places as well but if the publisher of spine releases an update to the runtime obviously you’ll need to adjust it again…

---

<div class="post-metadata">

**Author:** ![startappsblog](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@startappsblog](https://forums.solar2d.com/u/startappsblog)\
**Post date:** [July 23, 2015, 11:51am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/10 "2015-07-23T11:51:15Z")

</div>

Great conversation, exactly what I was wanting to know. I’m at a cross roads of going SpriteSheet vs Spine… and if @2x graphics wasn’t do-able in Spine it was a deal breaker. Interestingly it appears that over 2 years on from this post, the spine Corona runtime still uses display.newImage() rather than display.newImageRect() at line 84 of&nbsp;[https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-corona/spine-corona/spine.lua](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-corona/spine-corona/spine.lua)

Not sure if this works, but is the only fix the following (I have yet to actually purchase Spine)- &nbsp;

```
--Was this.... -- Customizes where images are found. function self:createImage (attachment) return display.newImage(attachment.name .. ".png") end --To This ?.... function self:createImage (attachment) return display.newImageRect(attachment.name .. ".png",attachment.width, attachment.height) end

```

Cheers in advance!

---

<div class="post-metadata">

**Author:** ![kilopop](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/k/a88e4f/32.png) [@kilopop](https://forums.solar2d.com/u/kilopop)\
**Post date:** [July 24, 2015, 3:58am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/11 "2015-07-24T03:58:47Z")

</div>

Try this when creating your spine objects in the skeleton:createImage function:

```
local imageSuffix = display.imageSuffix function skeleton:createImage (attachment) -- called by spine.lua (function self:createImage (attachment)) if imageSuffix ~= nil then -- does = @2 return display.newImage("spineData/"..dir..attachment.name .."@2.png") else return display.newImage("spineData/"..dir..attachment.name ..".png") end end

```

Use your own directory there instead of the example provided (“spineData/”…dir…attachment.name …"@2.png").

---

<div class="post-metadata">

**Author:** ![startappsblog](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@startappsblog](https://forums.solar2d.com/u/startappsblog)\
**Post date:** [July 24, 2015, 11:19am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/12 "2015-07-24T11:19:13Z")

</div>

Thanks kilopop, I will try out that modification! Cheers

---

<div class="post-metadata">

**Author:** ![startappsblog](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@startappsblog](https://forums.solar2d.com/u/startappsblog)\
**Post date:** [July 23, 2015, 11:51am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/13 "2015-07-23T11:51:15Z")

</div>

Great conversation, exactly what I was wanting to know. I’m at a cross roads of going SpriteSheet vs Spine… and if @2x graphics wasn’t do-able in Spine it was a deal breaker. Interestingly it appears that over 2 years on from this post, the spine Corona runtime still uses display.newImage() rather than display.newImageRect() at line 84 of&nbsp;[https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-corona/spine-corona/spine.lua](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-corona/spine-corona/spine.lua)

Not sure if this works, but is the only fix the following (I have yet to actually purchase Spine)- &nbsp;

```
--Was this.... -- Customizes where images are found. function self:createImage (attachment) return display.newImage(attachment.name .. ".png") end --To This ?.... function self:createImage (attachment) return display.newImageRect(attachment.name .. ".png",attachment.width, attachment.height) end

```

Cheers in advance!

---

<div class="post-metadata">

**Author:** ![kilopop](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/k/a88e4f/32.png) [@kilopop](https://forums.solar2d.com/u/kilopop)\
**Post date:** [July 24, 2015, 3:58am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/14 "2015-07-24T03:58:47Z")

</div>

Try this when creating your spine objects in the skeleton:createImage function:

```
local imageSuffix = display.imageSuffix function skeleton:createImage (attachment) -- called by spine.lua (function self:createImage (attachment)) if imageSuffix ~= nil then -- does = @2 return display.newImage("spineData/"..dir..attachment.name .."@2.png") else return display.newImage("spineData/"..dir..attachment.name ..".png") end end

```

Use your own directory there instead of the example provided (“spineData/”…dir…attachment.name …"@2.png").

---

<div class="post-metadata">

**Author:** ![startappsblog](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@startappsblog](https://forums.solar2d.com/u/startappsblog)\
**Post date:** [July 24, 2015, 11:19am UTC](https://forums.solar2d.com/t/creating-2x-graphics-with-spine/314177/15 "2015-07-24T11:19:13Z")

</div>

Thanks kilopop, I will try out that modification! Cheers
