[SOLVED] Spine2D Extension - Scaling for multiple devices

Hey All,

I'm currently using the ByRobin Spine2D extension, and am curious to know how to apply scaling for each mobile device. In the past I have used a 'Freeform' block for my images (image_API) to find any image with the file name ".....@1x.png", "....@2x.png", "...@3x.png", and so on based on the device used, which works perfectly! But I'm curious to know if there is a way to do this for Spine Assets as well. I have attached a few screenshots on what I have currently done for my spine assets. But if there is a way to use the correct scale for each mobile device, that would be awesome!

Cheers in advance!

JBG

« Last Edit: February 17, 2019, 04:10:54 pm by JuicyBeetleGames »

robinschaafsma

  • *
  • Posts: 711
Hi JuicyBeetleGames,

I think the advantage of Spine is that you have less assets in your game, if you create separate scale files you don't have this advantage.

A better way is to use the scale option inside the create spine block. See attach...
This way it should be scaling for each mobile device.

Hope this helps. (I tested manually on flash and it works)

Hey Robin,

Wow, I ONLY just realised there is a block called "current scale" which is exactly what I needed".... hahaha!

Since my Spine file was created at a size 4x the scale, I would essentially use the [3 / scale factor] which should technically give me the correct scale regardless of device being used?

Also, when it comes to collision bounds, does the box collider natively scale with the Spine scale, or would I also need to scale the collision bounds as well (i.e. create the box collider to the new scale size, or just set it to the original Width/Height of the Spine file)?

Thanks again!

JBG

robinschaafsma

  • *
  • Posts: 711
Quote
Since my Spine file was created at a size 4x the scale, I would essentially use the [3 / scale factor] which should technically give me the correct scale regardless of device being used?
You can test it to set the current scale block to 1, 1.5 2,3 or 4. I did that in flash.. so you can test if it scaling is alright.
Example: (Codeblock: Engine.SCALE = 4;)
Quote
Also, when it comes to collision bounds, does the box collider natively scale with the Spine scale, or would I also need to scale the collision bounds as well (i.e. create the box collider to the new scale size, or just set it to the original Width/Height of the Spine file)?
Yes the box collider should native scaling with the spine scale.

Awesome!

Thank you so much Robin!

Cheers,

JBG